00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _ots_FrontEndHardwareBase_h_
00009 #define _ots_FrontEndHardwareBase_h_
00010
00011
00012 #include "otsdaq-core/Macros/CoutMacros.h"
00013
00014 #include <string>
00015 #include <vector>
00016 #include <stdexcept>
00017
00018 namespace ots
00019 {
00020
00021 class FrontEndHardwareBase
00022 {
00023 public:
00024 FrontEndHardwareBase(unsigned int version = -1):version_(version) {;}
00025 virtual ~FrontEndHardwareBase() {;}
00026
00027
00028
00029
00030
00031 virtual void write (const std::string& sendBuffer) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00032 virtual void write (const std::vector<std::string>& sendBuffers) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00033 virtual void writeAndAcknowledge(const std::string& sendBuffer, int timeoutSeconds = -1) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00034 virtual void writeAndAcknowledge(const std::vector<std::string>& sendBuffers, int timeoutSeconds = -1) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00035 virtual void read (const std::string& sendBuffer , std::string& receiveBuffer, int timeoutSeconds = -1) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00036 virtual void read (const std::vector<std::string>& sendBuffers, std::vector<std::string>& receiveBuffers, int timeoutSeconds = -1) throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function");}
00037
00038
00039 virtual int flushRead () throw(std::runtime_error){__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return 0;}
00040
00041 static const std::string PURDUE_HARDWARE_NAME;
00042 static const std::string OTS_HARDWARE_NAME;
00043 protected:
00044 unsigned int version_;
00045 };
00046
00047 const std::string FrontEndHardwareBase::PURDUE_HARDWARE_NAME = "PurdueHardware";
00048 const std::string FrontEndHardwareBase::OTS_HARDWARE_NAME = "OtsUDPHardware";
00049
00050 }
00051
00052 #endif // _ots_FrontEndHardwareBase_h_