40 lines
801 B
C++
40 lines
801 B
C++
#ifndef _DCAPP_DATASERVICE_DATASERVICE_H_
|
|
#define _DCAPP_DATASERVICE_DATASERVICE_H_
|
|
|
|
#include <unistd.h>
|
|
#include "service.h"
|
|
|
|
class DataService :public IService {
|
|
public:
|
|
DataService() {
|
|
printf(".11.\n");
|
|
}
|
|
~DataService(){
|
|
printf(".22.\n");
|
|
}
|
|
|
|
/**
|
|
* 服务初始化
|
|
*/
|
|
virtual int Init(void *pData) {
|
|
printf("--- DataService Init.....\n");
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* 执行业务(业务循环) while(1){doSomeThings...}
|
|
*/
|
|
virtual void Exec() {
|
|
while(1){
|
|
//printf("-- DataService doThins...\n");
|
|
sleep(2);
|
|
}
|
|
}
|
|
|
|
virtual const char* getServiceName(){
|
|
return "DataService";
|
|
}
|
|
|
|
};
|
|
|
|
#endif // _DCAPP_DATASERVICE_DATASERVICE_H_
|