00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #ifndef ABSTRACT_SERVER_EQUIPMENT_H_ 00004 #define ABSTRACT_SERVER_EQUIPMENT_H_ 00005 00006 #include <fesa-core/Core/AbstractComponentEquipment.h> 00007 #include <fesa-core/Exception/FesaException.h> 00008 00009 namespace fesa 00010 { 00011 00012 class AbstractServerController; 00013 class FesaDeviceServer; 00014 class SubscriptionTreeManager; 00015 class AbstractServerDeviceClass; 00016 00022 class AbstractServerEquipment : public AbstractComponentEquipment 00023 { 00024 public: 00025 00029 static AbstractServerEquipment* getInstance(); 00030 00034 void initialize(); 00035 00040 void start(RunMode runMode); 00041 00046 AbstractServerDeviceClass* getServerDeviceClass(const std::string& serverDeviceClass); 00047 00053 AbstractServerDeviceClass* getDeviceClassFromDeviceName(const std::string& devicename); 00054 00059 void reportErrorToAllSubscribers(std::string Message); 00060 00065 AbstractServerController* getServerController(); 00066 00067 protected: 00068 00072 AbstractServerEquipment(); 00073 00077 virtual ~AbstractServerEquipment(); 00078 00082 void waitSignal(); 00083 00088 AbstractServerController* pServerController_; 00089 00090 const std::string getServerNameFromConfigurationFile(); 00091 00096 FesaDeviceServer* pFesaDeviceServer_; 00097 00102 static AbstractServerEquipment* theInstance_; 00103 00104 SubscriptionTreeManager* pSubscriptionTreeManager_; 00105 00106 }; 00107 00108 //****************************************************************** 00109 00110 inline AbstractServerDeviceClass* AbstractServerEquipment::getServerDeviceClass( 00111 const std::string& serverDeviceClass) 00112 00113 { 00114 return (AbstractServerDeviceClass*) this->getDeviceClass(serverDeviceClass); 00115 00116 } 00117 00118 inline AbstractServerEquipment* AbstractServerEquipment::getInstance() 00119 { 00120 if (theInstance_ == NULL) 00121 throw FesaException(__FILE__, __LINE__, FesaErrorServerEquipmentNotCreated.c_str()); 00122 else 00123 return theInstance_; 00124 } 00125 00126 } // fesa 00127 00128 #endif // ABSTRACT_SERVER_EQUIPMENT_H_