EasyCV
0.9.36
Easy! Computer Vision
|
#include <ServiceMan.h>
Public Types | |
enum | StopStateType { None, Running, Stopping, Stopped } |
typedef enum cvac::ServiceManager::StopStateType | StopState |
Public Member Functions | |
bool | stopRequested () |
void | stopCompleted () |
bool | isStopCompleted () |
void | clearStop () |
void | stopService () |
void | setStoppable () |
void | waitForStopService () |
virtual std::string | getModelFileFromConfig ()=0 |
std::string | getServiceName () |
virtual std::string | getDataDir ()=0 |
SandboxManager * | getSandbox () |
void | createSandbox () |
Static Public Attributes | |
static const char * | SERVICELOCKFILE = ".services_started.lock" |
Protected Attributes | |
std::string | mServiceName |
int | mStopState |
SandboxManager * | mSandbox |
Class to manage the Ice Service functions
It has to be created via its subclass ServiceManagerI.
NOTE: A ServiceManager can manage either a detector or detectorTrainer but not both!
void ServiceManager::clearStop | ( | ) |
Tell manager to clear stop complete
void ServiceManager::createSandbox | ( | ) |
|
pure virtual |
Implemented in cvac::ServiceManagerI.
|
pure virtual |
Look for a property entry in config.service that corresponds to ServiceName.TrainedModel = filename Return filename if found, empty string otherwise.
Implemented in cvac::ServiceManagerI.
|
inline |
std::string ServiceManager::getServiceName | ( | ) |
Get the service name of this service
bool ServiceManager::isStopCompleted | ( | ) |
Poll to see if a stop is completed
void ServiceManager::setStoppable | ( | ) |
Tell ServiceManager that we are running and will listen for a stop request.
void ServiceManager::stopCompleted | ( | ) |
Tell manager that the stop has been completed. The user should call this after an operation was stopped
bool ServiceManager::stopRequested | ( | ) |
Returns true if a stop has been requested for this service. The user needs to call this when running lengthly operations and stop the operation if it returns true. If the user supports these functions then he needs to call the setRunning call before the lengthly operation so the ServiceManager will wait for the stop to be completed. After the lengthly operation the user should call clearStop.
void ServiceManager::stopService | ( | ) |
Requests that a given service be stopped.
void ServiceManager::waitForStopService | ( | ) |
Requests that the service be stopped. And waits for the service to acknowlege the stop.
|
protected |
|
protected |
|
protected |
|
static |