EasyCV  0.9.36
Easy! Computer Vision
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
cvac::ServiceManager Class Referenceabstract

#include <ServiceMan.h>

Inheritance diagram for cvac::ServiceManager:
cvac::ServiceManagerI

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
 
SandboxManagergetSandbox ()
 
void createSandbox ()
 

Static Public Attributes

static const char * SERVICELOCKFILE = ".services_started.lock"
 

Protected Attributes

std::string mServiceName
 
int mStopState
 
SandboxManagermSandbox
 

Detailed Description

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!

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
None 
Running 
Stopping 
Stopped 

Member Function Documentation

void ServiceManager::clearStop ( )

Tell manager to clear stop complete

void ServiceManager::createSandbox ( )
virtual std::string cvac::ServiceManager::getDataDir ( )
pure virtual

Implemented in cvac::ServiceManagerI.

virtual std::string cvac::ServiceManager::getModelFileFromConfig ( )
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.

SandboxManager* cvac::ServiceManager::getSandbox ( )
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.

Member Data Documentation

SandboxManager* cvac::ServiceManager::mSandbox
protected
std::string cvac::ServiceManager::mServiceName
protected
int cvac::ServiceManager::mStopState
protected
const char * ServiceManager::SERVICELOCKFILE = ".services_started.lock"
static

The documentation for this class was generated from the following files: