IODA Bundle
ODBAPISettings.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2012 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef ODBAPISettings_H
12 #define ODBAPISettings_H
13 
14 #include "eckit/thread/ThreadSingleton.h"
15 #include "eckit/io/Length.h"
16 
17 namespace eckit {
18 class PathName;
19 class DataHandle;
20 }
21 
22 namespace odc {
23 
24 class ODBAPISettings : private eckit::NonCopyable {
25 public:
26 
27  static ODBAPISettings& instance();
28 
29  size_t headerBufferSize();
30  void headerBufferSize(size_t);
31 
32  size_t setvbufferSize();
33  void setvbufferSize(size_t);
34 
35  eckit::DataHandle* writeToFile(const eckit::PathName&, const eckit::Length& = eckit::Length(0), bool openDataHandle = true);
36  eckit::DataHandle* appendToFile(const eckit::PathName&, const eckit::Length& = eckit::Length(0), bool openDataHandle = true);
37 
38  void setHome(const char *argv0);
39  std::string fileInHome(const std::string&);
40 
41  void treatIntegersAsDoubles(bool flag);
42  bool integersAsDoubles() const;
43 
44  static bool debug;
45 
46 private:
48 
49  static void createDirectories(const eckit::PathName& path);
50 
53 
54  bool useAIO_;
56 
57  friend struct eckit::NewAlloc0<ODBAPISettings>;
58  std::string home_;
59 };
60 
61 } // namespace odc
62 
63 #endif
void setHome(const char *argv0)
static void createDirectories(const eckit::PathName &path)
eckit::DataHandle * writeToFile(const eckit::PathName &, const eckit::Length &=eckit::Length(0), bool openDataHandle=true)
std::string fileInHome(const std::string &)
void treatIntegersAsDoubles(bool flag)
eckit::DataHandle * appendToFile(const eckit::PathName &, const eckit::Length &=eckit::Length(0), bool openDataHandle=true)
static ODBAPISettings & instance()
bool integersAsDoubles() const
Definition: ColumnInfo.h:23