Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DeviceDriver Class Reference

#include <DeviceDriver.h>

Inheritance diagram for DeviceDriver:

List of all members.


Detailed Description

description of DeviceDriver

Definition at line 12 of file DeviceDriver.h.


Public Types

typedef InstanceTracker
< DeviceDriver, std::string,
Factory1Arg< DeviceDriver,
std::string > > 
registry_t

Public Member Functions

virtual ~DeviceDriver ()
 destructor, removes from registry in case we're deleting it from some other source than registry's own destroy()
virtual std::string getClassName () const =0
 Returns the name of the class (aka its type).
virtual MotionHookgetMotionSink ()
virtual void getSensorSources (std::map< std::string, DataSource * > &sources)
virtual void getImageSources (std::map< std::string, DataSource * > &sources)
virtual void addSourceListener (SourceListener *l)
 add a listener to sourceListeners
virtual void removeSourceListener (SourceListener *l)
 remove a listener from sourceListeners

Static Public Member Functions

static registry_tgetRegistry ()

Protected Member Functions

 DeviceDriver (const std::string &, const std::string &instancename)
 constructor, pass the name of the class's type so we can use it in error messages, and a name for the instance so we can register it for MotionHook's to lookup
virtual void registerInstance ()
 To be called be "deepest" subclass constructor at the end of construction.
virtual void fireDataSourcesUpdated ()
 calls SourceListener::dataSourcesUpdated() for entries registered in sourceListeners

Protected Attributes

const std::string instanceName
 holds the name of this instance of CommPort (mainly for error message reporting by the class itself)
std::set< SourceListener * > sourceListeners
 list (of LoadDataThreads) to be notified when a data source is added or removed

Classes

class  SourceListener
 allows LoadDataThreads to be notified when a data source is added or removed More...

Member Typedef Documentation

typedef InstanceTracker<DeviceDriver,std::string,Factory1Arg<DeviceDriver,std::string> > registry_t

Definition at line 26 of file DeviceDriver.h.


Constructor & Destructor Documentation

virtual ~DeviceDriver (  )  [inline, virtual]

destructor, removes from registry in case we're deleting it from some other source than registry's own destroy()

Definition at line 15 of file DeviceDriver.h.

DeviceDriver ( const std::string &  ,
const std::string &  instancename 
) [inline, protected]

constructor, pass the name of the class's type so we can use it in error messages, and a name for the instance so we can register it for MotionHook's to lookup

Definition at line 43 of file DeviceDriver.h.


Member Function Documentation

virtual std::string getClassName (  )  const [pure virtual]

Returns the name of the class (aka its type).

Suggested implementation is to declare a static string member, set it to the result of calling the registry's registerType, and then return that member here

Implemented in CameraDriver, CameraDriver, CreateDriver, DynamixelDriver, ImageStreamDriver, LoggedDataDriver, SSC32Driver, and TeRKDriver.

Referenced by registerInstance().

virtual MotionHook* getMotionSink (  )  [inline, virtual]

Reimplemented in CreateDriver, DynamixelDriver, SSC32Driver, and TeRKDriver.

Definition at line 22 of file DeviceDriver.h.

virtual void getSensorSources ( std::map< std::string, DataSource * > &  sources  )  [inline, virtual]

virtual void getImageSources ( std::map< std::string, DataSource * > &  sources  )  [inline, virtual]

Reimplemented in CameraDriver, CameraDriver, ImageStreamDriver, LoggedDataDriver, and TeRKDriver.

Definition at line 24 of file DeviceDriver.h.

virtual void addSourceListener ( SourceListener l  )  [inline, virtual]

add a listener to sourceListeners

Definition at line 37 of file DeviceDriver.h.

Referenced by LoadDataThread::setDataSource().

virtual void removeSourceListener ( SourceListener l  )  [inline, virtual]

remove a listener from sourceListeners

Definition at line 39 of file DeviceDriver.h.

Referenced by LoadDataThread::setDataSource().

virtual void registerInstance (  )  [inline, protected, virtual]

To be called be "deepest" subclass constructor at the end of construction.

Don't want to register until completed construction! plist::Collection listeners would be triggered and might start performing operations on instance while partially constructed

Definition at line 52 of file DeviceDriver.h.

virtual void fireDataSourcesUpdated (  )  [inline, protected, virtual]

calls SourceListener::dataSourcesUpdated() for entries registered in sourceListeners

Definition at line 65 of file DeviceDriver.h.

Referenced by TeRKDriver::connect().


Member Data Documentation

const std::string instanceName [protected]

holds the name of this instance of CommPort (mainly for error message reporting by the class itself)

Definition at line 73 of file DeviceDriver.h.

Referenced by ImageStreamDriver::getData(), SSC32Driver::nextName(), ImageStreamDriver::nextName(), CreateDriver::nextName(), CameraDriver::nextName(), registerInstance(), and ~DeviceDriver().

std::set<SourceListener*> sourceListeners [protected]

list (of LoadDataThreads) to be notified when a data source is added or removed

Definition at line 74 of file DeviceDriver.h.

Referenced by addSourceListener(), fireDataSourcesUpdated(), and removeSourceListener().


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

Tekkotsu Hardware Abstraction Layer 4.0
Generated Thu Nov 22 01:01:19 2007 by Doxygen 1.5.4