- Interface to an ECS engine
#include <ECS/Engine.hh>
class ECS_Engine
{
public:
_ECSAIO_PRIVAPI ECS_Engine(int32 engineId);
_ECSAIO_PRIVAPI ECS_Engine(ECS_Engine const& other);
_ECSAIO_PRIVAPI ECS_Engine const& operator=(ECS_Engine const& other);
_ECSAIO_PRIVAPI virtual ~ECS_Engine();
virtual bool isValid() const;
virtual ostream& print(ostream& os) const;
_ECSAIO_PRIVAPI int32 processEvent
(
const ECS_Event& event,
const char* streamName = 0
);
_ECSAIO_PRIVAPI int32 getInstanceId();
_ECSAIO_PRIVAPI int32 nEventReceivers();
_ECSAIO_PRIVAPI ECS_EventReceiver* getNthEventReceiver
(int32 index);
_ECSAIO_PRIVAPI int32 addEventReceiver(ECS_EventReceiver& receiver);
_ECSAIO_PRIVAPI int32 removeEventReceiver(ECS_EventReceiver& receiver);
_ECSAIO_PRIVAPI int32 removeAllEventReceivers();
_ECSAIO_PRIVAPI int32 nAnnotaters();
_ECSAIO_PRIVAPI ECS_Annotater* getNthAnnotater(int32 index);
_ECSAIO_PRIVAPI int32 addAnnotater(ECS_Annotater& annotater);
_ECSAIO_PRIVAPI int32 removeAnnotater(ECS_Annotater& annotater);
_ECSAIO_PRIVAPI int32 removeAllAnnotaters();
};
Concrete
ECS Developers
This is the class to be used for programmatic interaction with an ECS engine.
This is the class to use to send events to an engine and to register classes to receive events which are output by an engine, and to handle annotation requests.
_ECSAIO_PRIVAPI ECS_Engine(int32 engineId);
_ECSAIO_PRIVAPI ECS_Engine(ECS_Engine const& other);
_ECSAIO_PRIVAPI ECS_Engine const& operator=(ECS_Engine const& other);
_ECSAIO_PRIVAPI virtual ~ECS_Engine();
virtual bool isValid() const;
virtual ostream& print(ostream& os) const;
os.
_ECSAIO_PRIVAPI int32 processEvent
(
const ECS_Event& event,
const char* streamName = 0
);
streamName (default 0).
Note: Sending an event requires all events/requests in the queue to be processed. Callbacks may occur to instances of ECS_Annotater or ECS_EventReceiver before this method returns.
Returns
ECS_SUCCESS
ECS_AIO_TYPE1_PREEMPTION_OCCURED
This is a positive return code and does not necessarily indicate a problem. However, there is an overhead involved in establishing and terminating connection with an engine. If this return occurs frequently and performance is an issue then you may want to consider restructuring your application into separate processes.
ECS_AIO_TYPE2_PREEMPTION_OCCURED
This is a similar error to the above, however it is slightly less serious. In this case, it is the number of receivers that is causing a problem. Each receiver registered consumes a channel for transmission of events between the engine and this process. The number of these connections is limited. If multiple receivers are registered for another engine there may not be any connections left to use for sending the event to this engine.
This status indicates that the API has found another unused event connection and has closed it so that one could be opened to this engine.
ECS_AIO_INVALID
ECS_AIO_ENGINE_LIMIT_REACHED
ECS_AIO_TOO_MANY_RECEIVERS
ESOK_COMMUNICATION_ERROR
ECS_BAD_PARAMETER
EIO_NULL_CHR
_ECSAIO_PRIVAPI int32 getInstanceId();
_ECSAIO_PRIVAPI int32 nEventReceivers();
_ECSAIO_PRIVAPI ECS_EventReceiver* getNthEventReceiver(int32 index);
indexth event receiver registered with this class.
The first receiver has an index of 1. If an invalid index is specified then 0 will be returned.
Receivers are not stored in insertion order. The order of the iteration may change if receivers are added or removed.
_ECSAIO_PRIVAPI int32 addEventReceiver(ECS_EventReceiver& receiver);
ECS_EventReceiver (or subclass) to receive events output from this engine.
Multiple event receivers may be registered. There is a limit dictated by the engine and underlying communication mechanism.
Returns
ECS_SUCCESS
ECS_AIO_TYPE1_PREEMPTION_OCCURED
This is a positive return code and does not necessarily indicate a problem. However further interaction with that engine will not be possible until all the receivers associated with another engine are removed.
ECS_AIO_TYPE2_PREEMPTION_OCCURED
This is a similar error to ECS_AIO_TYPE1_PREEMPTION_OCCURED, however in this case it will still be possible to process annotation requests from that engine.
ECS_AIO_INVALID
ECS_AIO_ENGINE_LIMIT_REACHED
ECS_AIO_TOO_MANY_RECEIVERS
ESOK_COMMUNICATION_ERROR
_ECSAIO_PRIVAPI int32 removeEventReceiver(ECS_EventReceiver& receiver);
_ECSAIO_PRIVAPI int32 removeAllEventReceivers();
Following this call all events output by this engine will be ignored until at least one new event receiver is registered.
_ECSAIO_PRIVAPI int32 nAnnotaters();
_ECSAIO_PRIVAPI ECS_Annotater* getNthAnnotater(int32 index);
ECS_Annotater subclass to which is registered to process annotation requests from this engine.
_ECSAIO_PRIVAPI int32 addAnnotater(ECS_Annotater& annotater);
ECS_Annotater subclass to which annotation requests should be directed.
The first annotater has an index of 1. If an invalid index is specified then 0 will be returned.
Annotaters are not stored in insertion order. The order of the iteration may change if annotaters are added or removed.
_ECSAIO_PRIVAPI int32 removeAnnotater(ECS_Annotater& annotater);
_ECSAIO_PRIVAPI int32 removeAllAnnotaters();
None
ECS_EventReceiver
ECS
1.5
1998/02/25
Hewlett-Packard Company
Copyright (c) 1997 Hewlett-Packard Company. All Rights Reserved.