PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/include/nebu/topology/physicalLocalStoreFactory.h

https://github.com/deltaforge/nebu-common-cpp
C Header | 51 lines | 24 code | 12 blank | 15 comment | 0 complexity | 62ea80cd4f00abf162a48d0db85d9230 MD5 | raw file
 1
 2#ifndef NEBU_PHYSICALLOCALSTOREFACTORY_H_
 3#define NEBU_PHYSICALLOCALSTOREFACTORY_H_
 4
 5#include "tinyxml2.h"
 6
 7#include "nebu/topology/physicalLocalStore.h"
 8
 9namespace nebu
10{
11	namespace common
12	{
13
14		/**Creates a LocalStore from xml.*/
15		class PhysicalLocalStoreFactory
16		{
17		public:
18			static const std::string ROOT_NAME;
19			static const std::string ATTR_ID;
20
21			/** Simple default (empty) constructor. */
22			PhysicalLocalStoreFactory() { };
23			/** Simple default (empty) destructor. */
24			virtual ~PhysicalLocalStoreFactory() { };
25
26		  /** Parses a PhysicalLocalStore from the xml.
27			 * @param[in] elem to parse.
28			 * @return a newly created PhysicalLocalStore.
29			 */
30			virtual Traits<PhysicalLocalStore>::Ptr parseXML(const tinyxml2::XMLElement *elem) const;
31
32			/** Gets an instance of this class.
33			 * Creates one if none has been found previously.
34			 * @return an instance of this class.
35			 */
36			static std::shared_ptr<PhysicalLocalStoreFactory> getInstance();
37			/** Set an instance of this class to return with getInstance().
38			 * Especially usefull for mocking.
39			 * @param[in] instance to set.
40			 */
41			static void setInstance(std::shared_ptr<PhysicalLocalStoreFactory> instance);
42
43		private:
44			static std::shared_ptr<PhysicalLocalStoreFactory> instance;
45		};
46
47	}
48}
49
50#endif
51