#include <dc_filterservice.h>
Public Types | |
typedef DC_Filter_Base_t* (* | FilterFactory_f )(char *) |
typedef DC_Policy_Base_t* (* | PolicyFactory_f )(char *) |
Public Methods | |
DC_FilterService_t (void) | |
~DC_FilterService_t (void) | |
int | init (char *sbAppName_in, FilterFactory_f fcnFilterFactory_in, int *pargc, char ***pargv, PerfCallback_f fcnPerfCallback_in=NULL) |
void | setPolicyFactory (PolicyFactory_f fcnPolicyFactory_in) |
bool | isRemoteProcess (void) |
int | RemoteProcess (void) |
char* | getAppName (void) const |
int | PlacementPlanning (DC_FilterLayout_t &layout, DC_Work_t &work, DC_Placement_t &placement) |
int | ReuseFilterInstance (DC_FilterLayout_t &layout, DC_Work_t &work, DC_Placement_t &placement, DC_FilterInstance_t *pinstance) |
int | NewFilterInstance (DC_FilterLayout_t &layout, DC_Work_t &work, DC_Placement_t &placement, DC_FilterInstance_t *&pinstance) |
int | GetFilterInstance (DC_FilterLayout_t &layout, DC_Work_t &work, DC_Placement_t &placement, DC_FilterInstance_t *&pinstance) |
int | StopFilterInstance (DC_FilterInstance_t *&pinstance, bool fWait=true) |
int | ProbeWork (DC_WorkHandle_t wh, int *status) |
int | WaitWork (DC_WorkHandle_t wh) |
Wait for a unit of work to finish. More... | |
DC_WorkHandle_t | WaitAnyWork (void) |
Wait for any appended work to finish. More... | |
int | ExitStatus (DC_WorkHandle_t wh) |
void | FilterLock (void) |
void | FilterUnlock (void) |
char* | FindAppConfig (const char *sbName, const char *sbFilterName=NULL, int wId=-1) |
Examines the section [AppName] of the console configuration file. More... | |
long | FindAppConfigInt (const char *sbName, const char *sbFilterName=NULL, int wId=-1, bool fInterpretUnits=true) |
Examines the section [AppName] of the console configuration file. | |
double | FindAppConfigDbl (const char *sbName, const char *sbFilterName=NULL, int wId=-1) |
Examines the section [AppName] of the console configuration file. | |
Protected Attributes | |
char* | sbAppName |
int* | pargc |
char*** | pargv |
FilterFactory_f | fcnFilterFactory |
PolicyFactory_f | fcnPolicyFactory |
DC_ConsoleProcessState* | pConsole |
DC_RemoteProcessState* | pRemote |
DC_ReaderServerLoop* | pReader |
InetAddress | addrReader |
For localhost communication with reader. | |
ClientSocket | sockReader |
InetAddress | addrLocal |
Listen socket. | |
ServerSocket | sockLocal |
DC_Mutex | mutexFilterInternal |
Currently used for ConsoleOutput/ConsolePrintf and >1 filter fd writes and FindAppConfigXXX(). | |
bool | fCalledRun |
Runtime state. |
Applications should instantiate one of these.
|
Reap the work entry, and return the exit status. Inputs: wh - valid work handle from an AppendWork() or WaitAnyWork() call Return: int - <0 == DC_ERR_xxx, >=0 = exit status |
|
Examines the section [AppName] of the console configuration file. Searches in the console config info for an entry in the seciton with the applications name (as specified in the init() call). Inputs: sbName - entry to find wId - sub section value (ie: [AppName.wId]) -1 = just use the AppName as the section name sbFilterName - NULL=don't use, else [AppName.FilterName] or [AppName.FilterName.wId] Return: char * - NULL=not found, !NULL=value (must be freed by caller!) |
|
Convenience routine to first try to reuse an existing filter instance, and if that fails, create a new one. Inputs: layout - describes set of filters and constraints to instantiate work - uow to add to the new instance placement - describes where filters should be started Output: pinstance - ptr to context of the instance to use Return: int - DC_ERR_OK=success, DC_ERR_xxx=failure |
|
Creates a new filter instance context for use by the application. Inputs: layout - describes set of filters and constraints to instantiate work - uow to add to the new instance placement - describes where filters should be started Output: pinstance - ptr to a new instance context to use Return: int - DC_ERR_OK=success, DC_ERR_xxx=failure |
|
called by remote process main thread |
|
Attempts a controlled shutdown of the given filter instance. Inputs: pinstance - ptr to context of the instance to use fWait - true=wait for instance to stop, false=async stop Output: pinstance - NULL Return: int - DC_ERR_OK=success, DC_ERR_xxx=failure |
|
Wait for any appended work to finish. Block until any work is finished, and return this work handle. Return: int - <0 == DC_ERR_xxx, >=0 = work handle to use in ExitStatus() |
|
Wait for a unit of work to finish. Block until the given piece of work is finish, reap the entry, and return the exit status. Inputs: wh - valid work handle from an AppendWork() call Return: int - <0 == DC_ERR_xxx, >=0 = exit status |
|
Initializes system and determines if we are the console. Inputs: sbAppName_in - name of the application fcnFilterFactory_in - user fcn ptr that creates filter objects pargc, pargv - command line args Return: int - 0=ok, !0=error |