EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
RPCServerConfig.h
1 #ifndef EA4_STORAGE_RPC_SERVER_CONFIG_H
2 #define EA4_STORAGE_RPC_SERVER_CONFIG_H
3 
4 #include <list>
5 
6 // tools
7 #include "tools/ToolsConfig.h"
8 
9 // storage
10 #include "storage/AutoIndex.h"
11 
12 namespace ea4 { namespace storage {
13 
19 
20  public:
21 
23  static RPCServerConfig* getInstance();
24 
25  public:
26 
28  class Entry {
29 
30  public:
31 
33  void clear() {
34  key = 0;
35  name.assign(0,0);
36  path.assign(0,0);
37  }
38 
39  int key;
40  std::string name;
41  std::string path;
42  };
43 
44 
45  public:
46 
49  const char* getConfigName();
50 
52  bool read(const char *filename);
53 
55  bool find(int key, std::string& path);
56 
58  Index* openIndex(int key);
59 
61  void dump();
62 
63  public:
64 
66  std::list<Entry> config;
67 
69  std::string verTxt;
70 
72  int ver;
73 
74  private:
75 
76  static RPCServerConfig* theInstance;
77 
78 
79 };
80 
81 }}
82 
83 #endif
84 
85 
Configuration entry.
Definition: RPCServerConfig.h:28
std::string verTxt
version
Definition: RPCServerConfig.h:69
std::string path
path to the Index file
Definition: RPCServerConfig.h:41
bool find(int key, std::string &path)
Finds path for key or returns false.
void clear()
clear
Definition: RPCServerConfig.h:33
const char * getConfigName()
Returns the name of the XML file defined by the env variable &#39;SERVERCONFIG&#39;.
void dump()
Print this configuration.
bool read(const char *filename)
Reads the XML file that matches serverconfig.dtd.
Index * openIndex(int key)
Returns the selected Index file.
int key
entry key
Definition: RPCServerConfig.h:39
int ver
version
Definition: RPCServerConfig.h:72
std::string name
name
Definition: RPCServerConfig.h:40
Base interface for the archiver&#39;s indices.
Definition: Index.h:16
std::list< Entry > config
Collection of the config entries.
Definition: RPCServerConfig.h:66
static RPCServerConfig * getInstance()
Returns singleton.
The RPC Server Configuration.
Definition: RPCServerConfig.h:18