bes  Updated for version 3.20.6
BESH4MCache.h
1 //
8 #ifndef _bes_h4m_cache_h
9 #define _bes_h4m_cache_h
10 
11 #include <unistd.h>
12 #include <string>
13 #include <vector>
14 #include "BESFileLockingCache.h"
15 
17 {
18 private:
19  static bool d_enabled;
20  static BESH4Cache *d_instance;
21  static void delete_instance() { delete d_instance; d_instance = 0; }
22 
23  BESH4Cache();
24 
25 public:
26  static const std::string PATH_KEY;
27  static const std::string PREFIX_KEY;
28  static const std::string SIZE_KEY;
29  virtual ~BESH4Cache() {}
30 
31  static long getCacheSizeFromConfig();
32  static std::string getCachePrefixFromConfig();
33  static std::string getCacheDirFromConfig();
34 
35  bool is_valid(const std::string & cache_file_name, const int expected_file_size);
36  static BESH4Cache *get_instance();
37  bool get_data_from_cache(const std::string &cache_file_name, const int expected_file_size,int &fd);
38  bool write_cached_data(const std::string &cache_file_name,const int expected_file_size,const std::vector<double> &val);
39  bool write_cached_data2(const std::string &cache_file_name,const int expected_file_size,const void *buf);
40 };
41 
42 #endif
43 
BESH4Cache::get_instance
static BESH4Cache * get_instance()
Definition: BESH4MCache.cc:100
BESFileLockingCache
Implementation of a caching mechanism for compressed data.
Definition: BESFileLockingCache.h:85
BESH4Cache
Definition: BESH4MCache.h:16