Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / ImplRepo_Service / Config_Backing_Store.h
blob53c3161f953ced0cf7435f9846c92374c4b04f7e
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Config_Backing_Store.h
7 * These classes define ACE_Configuration implementations of the backing store.
9 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
10 * @author Priyanka Gontla <gontla_p@ociweb.com>
12 //=============================================================================
14 #ifndef CONFIG_BACKING_STORE_H
15 #define CONFIG_BACKING_STORE_H
17 #include "ace/config-lite.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "Locator_Repository.h"
25 #include "ace/Configuration.h"
27 /**
28 * @class Config_Backing_Store
30 * @brief ACE_Configuration backing store interface containing all ImR persistent
31 * information.
34 class Config_Backing_Store : public Locator_Repository
36 public:
37 Config_Backing_Store(const Options& opts,
38 CORBA::ORB_ptr orb,
39 ACE_Configuration& config);
41 virtual ~Config_Backing_Store();
43 protected:
44 /// perform config backing store specific initialization
45 /// (loads servers and activators from the backing store)
46 virtual int init_repo(PortableServer::POA_ptr imr_poa);
48 /// perform server persistent update
49 virtual int persistent_update(const Server_Info_Ptr& info, bool add);
51 /// perform activator persistent update
52 virtual int persistent_update(const Activator_Info_Ptr& info, bool add);
54 /// perform persistent remove
55 virtual int persistent_remove(const ACE_CString& name, bool activator);
57 /// remove the section with the given name from the key section
58 int remove(const ACE_CString& name, const ACE_TCHAR* key);
60 /// the ACE_Configuration backing store
61 ACE_Configuration& config_;
62 /// the status of the config_
63 int status_;
65 private:
66 /// load all servers
67 void loadServers();
68 /// load all activators
69 void loadActivators();
72 /**
73 * @class Heap_Backing_Store
75 * @brief Heap file backing store containing all ImR persistent information.
78 class Heap_Backing_Store : public Config_Backing_Store
80 public:
81 Heap_Backing_Store(const Options& opts,
82 CORBA::ORB_ptr orb);
84 virtual ~Heap_Backing_Store();
86 /// indicate the Heap filename as the persistence mode for the repository
87 virtual const ACE_TCHAR* repo_mode() const;
89 private:
90 /// the Heap filename
91 const ACE_TString filename_;
92 /// the Heap used for the actual backing store
93 ACE_Configuration_Heap heap_;
96 /**
97 * @class Registry_Backing_Store
99 * @brief Win32 registry backing store containing all ImR persistent
100 * information.
103 class Registry_Backing_Store : public Config_Backing_Store
105 public:
106 Registry_Backing_Store(const Options& opts,
107 CORBA::ORB_ptr orb);
109 virtual ~Registry_Backing_Store();
111 /// indicate Registry as the persistence mode for the repository
112 virtual const ACE_TCHAR* repo_mode() const;
114 private:
115 #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
116 /// the Win32 registry used for the actual backing store
117 ACE_Configuration_Win32Registry win32registry_;
118 #else
119 // invalid config (used to simplify #defines)
120 ACE_Configuration_Heap invalid_config_;
121 #endif
125 #endif /* CONFIG_BACKING_STORE_H */