FeeServer::MonitorThread Class Reference
[Processes]

#include <feeserver/fee_mon.hh>

Inheritance diagram for FeeServer::MonitorThread:

Inheritance graph
[legend]
Collaboration diagram for FeeServer::MonitorThread:

Collaboration graph
[legend]

List of all members.


Detailed Description

Thread that updates published services.

Public Types

typedef std::map< std::string,
Item * > 
ItemMap

Public Member Functions

 MonitorThread (Main &main, unsigned int rate=1000)
void * operator() ()
bool Suspend ()
bool Resume ()
void SetRate (unsigned int rate)
unsigned int Rate () const
int Publish (ServiceBase &service)
int Unpublish (const std::string &name)
void RemoveServices ()
ItemMapItems ()

Protected Attributes

Main_main
ItemMap _items
unsigned int _update_rate
Mutex _mutex
Condition _condition
bool _suspend
bool _changed
const unsigned int _interval_multiplier

Member Typedef Documentation

typedef std::map<std::string, Item*> FeeServer::MonitorThread::ItemMap

Map of items


Constructor & Destructor Documentation

FeeServer::MonitorThread::MonitorThread ( Main main,
unsigned int  rate = 1000 
)

Constructor

Parameters:
main Reference to fee server main.
rate Update rate in miliseconds.


Member Function Documentation

void * FeeServer::MonitorThread::operator() (  )  [virtual]

Do the thread thing

Implements FeeServer::Thread.

bool FeeServer::MonitorThread::Suspend (  ) 

Suspend the thread. Must not be called from monitor thread it self, as it would dead-lock the thread.

Returns:
true on succes, false otherwise

bool FeeServer::MonitorThread::Resume (  ) 

Resume the thread. Must not be called from monitor thread it self, as it would dead-lock the thread.

Returns:
true on succes, false otherwise

void FeeServer::MonitorThread::SetRate ( unsigned int  rate  )  [inline]

Set the update rate

unsigned int FeeServer::MonitorThread::Rate (  )  const [inline]

Get the update rate

int FeeServer::MonitorThread::Publish ( ServiceBase service  ) 

Add a service

Parameters:
service Service to publish
Returns:
0 on success, negativ erroe code otherwise

int FeeServer::MonitorThread::Unpublish ( const std::string &  name  ) 

Un-publish a service. It is not removed from the list, but will not be updated

Parameters:
name Name of service to remove
Returns:
0 on success, negativ erroe code otherwise

void FeeServer::MonitorThread::RemoveServices (  ) 

Remove all services

ItemMap& FeeServer::MonitorThread::Items (  )  [inline]

Get item map


Member Data Documentation

Reference to server.

Items

unsigned int FeeServer::MonitorThread::_update_rate [protected]

Update rate, in which the whole Item-list should be checked for changes. This value is given in milliseconds.

Mutex for suspension

Condition for suspension

Flag to indicate suspension

The service list is changed - restart inner loop.

const unsigned int FeeServer::MonitorThread::_interval_multiplier [protected]

Interval multiplier


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

Generated on Thu Jun 26 17:02:31 2008 for FeeServer++ 0.9 by  doxygen 1.5.6