EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Static Public Attributes | List of all members
Engine Class Referenceabstract

The base class of the archive engines. More...

#include <Engine.h>

Inheritance diagram for Engine:
Guardable EngineConfigListener EngineEA3

Public Member Functions

 Engine (const std::string &index_name)
 Create Engine that writes to given index. More...
 
virtual ~Engine ()
 Destructor.
 
virtual OrderedMutexgetMutex ()
 Guardable interface. More...
 
virtual void addChannel (const std::string &group_name, const std::string &channel_name, double scan_period, bool disabling, bool monitor)=0
 Add a channel. More...
 
virtual void read_config (Guard &guard, const std::string &file_name)=0
 Read the given config file. More...
 
virtual unsigned long write (Guard &guard)=0
 Write all current buffers to disk. More...
 
const std::string & getIndexName (Guard &guard) const
 
void setDescription (Guard &guard, const std::string &description)
 Set the description string. More...
 
const std::string & getDescription (Guard &guard) const
 
const epicsTime & getStartTime (Guard &guard) const
 
const epicsTime & getNextWriteTime (Guard &guard) const
 
void attachToProcessVariableContext (Guard &guard)
 Join the engine's ProcessVariableContext. More...
 
double getWriteDuration (Guard &guard) const
 
size_t getWriteCount (Guard &guard) const
 
double getProcessDelayAvg (Guard &guard) const
 
const EngineConfiggetConfig (Guard &guard) const
 
WritableEngineConfiggetWritableConfig (Guard &guard)
 
virtual void write_config (Guard &guard)
 Write a new config file. More...
 
GroupInfoaddGroup (Guard &guard, const std::string &group_name)
 Add a group. More...
 
const stdList< GroupInfo * > & getGroups (Guard &guard) const
 
GroupInfofindGroup (Guard &engine_guard, const std::string &name)
 
const stdList< ArchiveChannel * > & getChannels (Guard &guard) const
 
ArchiveChannelfindChannel (Guard &engine_guard, const std::string &name)
 
size_t getNumConnected (Guard &guard) const
 
void start (Guard &guard)
 Start the sample mechanism. More...
 
bool isRunning (Guard &guard) const
 
bool process ()
 Main process routine. More...
 
void stop (Guard &guard)
 Stop sampling. More...
 
- Public Member Functions inherited from EngineConfigListener
virtual void addChannel (const stdString &group_name, const stdString &channel_name, double scan_period, bool disabling, bool monitor)=0
 Invoked for each channel that the EngineConfigParser found. More...
 

Static Public Attributes

static const double MAX_DELAY
 max delay
 

Detailed Description

The base class of the archive engines.

Constructor & Destructor Documentation

Engine::Engine ( const std::string &  index_name)

Create Engine that writes to given index.

Member Function Documentation

virtual void Engine::addChannel ( const std::string &  group_name,
const std::string &  channel_name,
double  scan_period,
bool  disabling,
bool  monitor 
)
pure virtual

Add a channel.

Also an EngineConfigListener

Implemented in EngineEA3.

GroupInfo* Engine::addGroup ( Guard guard,
const std::string &  group_name 
)

Add a group.

If the group already exists, that existing group is returned.

Returns
Returns the group
void Engine::attachToProcessVariableContext ( Guard guard)
inline

Join the engine's ProcessVariableContext.

While the engine supports multithreaded access, that's why there are all those Guard arguments, threads other than the main thread which end up calling ProcessVariable methods must join the PV context of the engine.

ArchiveChannel* Engine::findChannel ( Guard engine_guard,
const std::string &  name 
)
Returns
Returns channel with given name or 0.
GroupInfo* Engine::findGroup ( Guard engine_guard,
const std::string &  name 
)
Returns
Returns group with given name or 0.
const stdList< ArchiveChannel * > & Engine::getChannels ( Guard guard) const
inline
Returns
Returns all channels.
const EngineConfig & Engine::getConfig ( Guard guard) const
inline
Returns
Returns the current configuration.
const std::string & Engine::getDescription ( Guard guard) const
inline
Returns
Returns the description.
const stdList< GroupInfo * > & Engine::getGroups ( Guard guard) const
inline
Returns
Returns all groups.
const std::string & Engine::getIndexName ( Guard guard) const
inline
Returns
Returns the description.
virtual OrderedMutex& Engine::getMutex ( )
virtual

Guardable interface.

Implements Guardable.

const epicsTime & Engine::getNextWriteTime ( Guard guard) const
inline
Returns
Returns the next write time.
size_t Engine::getNumConnected ( Guard guard) const
Returns
Returns number of connected channels.
double Engine::getProcessDelayAvg ( Guard guard) const
inline
Returns
Returns average delay in seconds spent waiting in process().

This could be considered the engine's idle time.

const epicsTime & Engine::getStartTime ( Guard guard) const
inline
Returns
Returns the start time.
WritableEngineConfig & Engine::getWritableConfig ( Guard guard)
inline
Returns
Returns the current configuration.
size_t Engine::getWriteCount ( Guard guard) const
inline
Returns
Returns average write count.
double Engine::getWriteDuration ( Guard guard) const
inline
Returns
Returns average write duration in seconds.
bool Engine::isRunning ( Guard guard) const
inline
Returns
Returns true if start() has been called but not stop().
See Also
start()
bool Engine::process ( )

Main process routine.

Returns
Returns true if we should process again.
virtual void Engine::read_config ( Guard guard,
const std::string &  file_name 
)
pure virtual

Read the given config file.

Implemented in EngineEA3.

void Engine::setDescription ( Guard guard,
const std::string &  description 
)
inline

Set the description string.

void Engine::start ( Guard guard)

Start the sample mechanism.

void Engine::stop ( Guard guard)

Stop sampling.

virtual unsigned long Engine::write ( Guard guard)
pure virtual

Write all current buffers to disk.

Typically done within process(), also explicitly invoked when shutting down.

Implemented in EngineEA3.

virtual void Engine::write_config ( Guard guard)
virtual

Write a new config file.


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