1 #ifndef _ots_DataManagerSingleton_h_
2 #define _ots_DataManagerSingleton_h_
7 #include "otsdaq/DataManager/DataManager.h"
11 class ConfigurationTree;
22 if(theInstances_.find(instanceUID) != theInstances_.end())
24 delete theInstances_[instanceUID];
25 theInstances_.erase(theInstances_.find(instanceUID));
31 const std::string& supervisorConfigurationPath,
32 const std::string& instanceUID)
34 if(theInstances_.find(instanceUID) == theInstances_.end())
36 __COUT__ <<
"Creating supervisor application UID: " << instanceUID
37 <<
" POINTER: " << theInstances_[instanceUID] << std::endl;
38 theInstances_[instanceUID] =
static_cast<DataManager*
>(
39 new C(configurationTree, supervisorConfigurationPath));
40 __COUT__ <<
"Creating supervisor application UID: " << instanceUID
41 <<
" POINTER: " << theInstances_[instanceUID] << std::endl;
44 __COUT__ <<
"An instance of application UID " << instanceUID
45 <<
" already exists so your input parameters are ignored!"
48 return static_cast<C*
>(theInstances_[instanceUID]);
51 static DataManager* getInstance(std::string instanceUID)
53 if(theInstances_.find(instanceUID) == theInstances_.end())
55 __COUT__ <<
"Can't find supervisor application UID " << instanceUID
58 __SS__ <<
"An instance of the class MUST already exists so I am crashing!"
63 __COUT__ <<
"An instance of application UID " << instanceUID
64 <<
" already exists so your input parameters are ignored!"
67 return theInstances_[instanceUID];
71 DataManagerSingleton(
void) { ; }
72 ~DataManagerSingleton(
void) { ; }
73 static std::map<std::string, DataManager*> theInstances_;
static void deleteInstance(std::string instanceUID)
There is no way I can realize that the singletonized class has been deleted!