/* * dbVoltageChannel.hh * * Created on: July 28, 2014 * Author: Hovanes Egiyan */ #ifndef _DBVOLTAGECHANNEL_HH_ #define _DBVOLTAGECHANNEL_HH_ #include "dbSubsystem.hh" #include "baseEpicsChannel.hh" class dbVoltageChannel { protected: dbSubsystem* subsystemPtr; int chanID; std::string moduleType; std::string chanFunc; baseEpicsChannel* typedChanObj; static QString sqlFindModuleType; static QString sqlFindChannelProps; static map instanceFunMap; template static baseEpicsChannel* createChannel(std::string uri, std::string name, dbSubsystem* subsystemPtr, int chID ) { return new T(uri, name, subsystemPtr, chID ); } public: // dbChannel( string uri, int chanID = 0, dbSubsystem* parent = 0 ); dbVoltageChannel(dbSubsystem* subsystem, std::string mType = "", std::string name = "", std::string func = "" ); virtual ~dbVoltageChannel(); int getChannelProperties(); void loadRecords( std::string detPrefix, std::string iocPrefix ); static int initInstMap(); inline dbSubsystem* GetSubsystemPointer() {return subsystemPtr;} inline int GetChanID() {return chanID;} inline std::string GetModuleType() {return moduleType;} inline std::string GetChanFunction() {return chanFunc;} inline baseEpicsChannel* GetTypeChanObject() {return typedChanObj;} }; // A class for exceptions inherited from string struct NoModuleTypeException : public std::exception { std::string s; NoModuleTypeException(std::string ss) : s(ss) {} ~NoModuleTypeException() throw () {} // Updated const char* what() const throw() { return s.c_str(); } }; #endif /* _DBVOLTAGECHANNEL_HH_ */