cvtdriver
Driver for SmartFarm Device Converter
cvtdriver.h
이 파일의 문서화 페이지로 가기
1 
12 #ifndef _CVT_DRIVER_
13 #define _CVT_DRIVER_
14 
15 #include <ctime>
16 
17 #include "cvtdevice.h"
18 #include "cvtoption.h"
19 
20 namespace stdcvt {
21 
22 /*
23  @brief CvtDriver is a virtual class for a converter driver.
24 */
25 class CvtDriver {
26 private:
27  int _modelcode;
28  int _apispec;
29  time_t _updated;
30 
31 public:
37  CvtDriver(int modelcode, int apispec) {
38  _modelcode = modelcode;
39  _apispec = apispec;
40  _updated = 0; // 데이터가 업데이트되지 않은 상태라면 0
41  }
42 
47  int getmodelcode() {
48  return _modelcode;
49  }
50 
55  int getapispec() {
56  return _apispec;
57  }
58 
63  time_t getlastupdated() {
64  return _updated;
65  }
66 
72  void updated () {
73  _updated = time(0);
74  }
75 
82  virtual string getversion () = 0;
83 
89  virtual string getmodel () = 0;
90 
96  virtual string getcompany () = 0;
97 
103  virtual bool initialize (CvtOption option) = 0;
104 
109  virtual bool finalize () = 0;
110 
115  virtual bool preprocess () = 0;
116 
121  virtual bool postprocess () = 0;
122 
129  virtual CvtDevice *getdevice(int index) = 0;
130 
137  virtual bool sharedevice(CvtDevice *pdevice) = 0;
138 
145  virtual CvtCommand *getcommand() = 0;
146 
152  virtual bool control(CvtCommand *pcmd) = 0;
153 };
154 
155 
156 } // namespace stdcvt
157 
158 #endif
virtual string getmodel()=0
virtual bool preprocess()=0
Definition: cvtoption.h:32
time_t getlastupdated()
Definition: cvtdriver.h:63
Definition: cvtdevice.h:30
Definition: cvtcommand.h:22
Definition: cvtdriver.h:25
virtual string getversion()=0
virtual bool sharedevice(CvtDevice *pdevice)=0
int getapispec()
Definition: cvtdriver.h:55
virtual string getcompany()=0
virtual CvtDevice * getdevice(int index)=0
virtual bool postprocess()=0
virtual bool finalize()=0
virtual bool initialize(CvtOption option)=0
void updated()
Definition: cvtdriver.h:72
virtual CvtCommand * getcommand()=0
Definition: cvtcode.h:17
int getmodelcode()
Definition: cvtdriver.h:47
virtual bool control(CvtCommand *pcmd)=0
CvtDriver(int modelcode, int apispec)
Definition: cvtdriver.h:37