UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
PEP_Client Class Reference

#include <pep_client.hpp>

Public Types

enum  ClientStatus { BeforeRun = 0, Running, Finished }
 

Public Member Functions

 PEP_Client (const char *szAppName, bool bServerRuntime=false)
 
virtual ~PEP_Client ()
 
const char * appName () const
 
int jobNumber () const
 
void newJobNumber ()
 
void resetJobNumber ()
 
pid_t pid () const
 
ClientStatus status () const
 
ClientStatus status (int *pExitStatus)
 
int run (const char *szLogFpath=NULL)
 
ErrCode waitForExit (int *pExitStatus=NULL)
 
bool hasProperty (const char *szPropName, const char *szType=NULL) const
 
const char * property (const char *szPropName) const
 

Public Attributes

ProtocolpepParameters
 
ProtocolpepRuntime
 
ProtocolpepResults
 
ProtocolpepProperties
 

Protected Attributes

char * m_szAppName
 
pid_t m_nPid
 
int m_nJob
 
ClientStatus m_eStatus
 

Detailed Description

The class for PEP client to run.

Member Enumeration Documentation

Status of the PEP client.

Constructor & Destructor Documentation

PEP_Client::PEP_Client ( const char *  szAppName,
bool  bServerRuntime = false 
)

Create the PEP client application starter environment. Runtime is created in pepServer mode only if bServerRuntime is true.

virtual PEP_Client::~PEP_Client ( )
virtual

Destroy the object

Member Function Documentation

const char* PEP_Client::appName ( ) const

Return name of the client.

bool PEP_Client::hasProperty ( const char *  szPropName,
const char *  szType = NULL 
) const

Check given property name for existence. If given type is supplied as the second argument then the type is checked. Returns true or false.

int PEP_Client::jobNumber ( ) const

Return the client job number if its running or finished. Before first run -1 is returned.

void PEP_Client::newJobNumber ( )

Obtain new job number.

pid_t PEP_Client::pid ( ) const

Return the client pid if its running otherwise some garbage is returned.

const char* PEP_Client::property ( const char *  szPropName) const

Returns type argument of given property name. Returns NULL if the property does not have type argument.

void PEP_Client::resetJobNumber ( )

Reset job number as if it is not run yet.

int PEP_Client::run ( const char *  szLogFpath = NULL)

Run the client and store its job number. The parameter szLogFile allows to append all log messages from the PEP client to this file. Return 0 in case of success and error code otherwise.

ClientStatus PEP_Client::status ( ) const

Return the status of the client.

ClientStatus PEP_Client::status ( int *  pExitStatus)

Return the status of the client checking actually the existence of the process.

ErrCode PEP_Client::waitForExit ( int *  pExitStatus = NULL)

Wait for the client's exit and return its status code (see waitpid API). Results are read from the file and inputted to pepResults protocol handle.

Member Data Documentation

ClientStatus PEP_Client::m_eStatus
protected

The status of the client.

int PEP_Client::m_nJob
protected

The job number of currently running or finished client.

pid_t PEP_Client::m_nPid
protected

The pid of currently running client.

char* PEP_Client::m_szAppName
protected

The name of the client.


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