Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

FileCommMonitor Class Reference
[Communications Facilities]

#include <FileCommMonitor.hh>

List of all members.


Detailed Description

Monitors a set of file descriptors from file communication portals for messages.

This class monitors a set of file descriptors in a sub-thread, reads messages from them, and uses the CommManager to process them. The file descriptors are derived from FileCommPortal instances.


Public Member Functions

 FileCommMonitor (CommManager *mgr)
 ~FileCommMonitor ()
void registerPortal (FileCommPortal *portal)
bool unregisterPortal (FileCommPortal *portal)

Static Public Member Functions

FileCommMonitorinstance (CommManager *mgr)


Constructor & Destructor Documentation

FileCommMonitor::FileCommMonitor CommManager mgr  ) 
 

Constructor which connects the monitor to a manager.

Note that this constructor has the side effect of kicking off a thread which is monitoring the registered FileCommPortals for input. If there are no FileCommPortals, it simply wakes up every 100ms to check to see if there have been any registered.

FileCommMonitor::~FileCommMonitor  ) 
 

Destructor. Shuts down the monitoring thread.


Member Function Documentation

FileCommMonitor* FileCommMonitor::instance CommManager mgr  )  [static]
 

Returns the file monitor instance. Looks up the file monitor instance in the communications manager's symbol table. If it is there, it returns it, otherwise it creates one and returns it.

Parameters:
[in] mgr The communications manager
Returns:
The file monitor instance

void FileCommMonitor::registerPortal FileCommPortal portal  ) 
 

Register a file communications portal [in] portal The file descriptor based portal to monitor

bool FileCommMonitor::unregisterPortal FileCommPortal portal  ) 
 

Unregister a file communications portal [in] portal The file descriptor based portal to stop monitoring

Returns:
Returns true if portal was monitored and now is not.


RHexLib Reference Documentation