RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DAQ::Manager Class Reference

#include <daq.h>

Public Member Functions

void foreachDevice (void(*callback)(Device *, void *), void *param)
 
DeviceloadDevice (const std::string &driver, const std::list< std::string > &params)
 

Static Public Member Functions

static ManagergetInstance (void)
 

Private Member Functions

 Manager (void)
 
 ~Manager (void)
 
 Manager (const Manager &)
 
Manageroperator= (const Manager &)
 
void insertDevice (Device *)
 
void removeDevice (Device *)
 
void registerDriver (Driver *, const std::string &)
 
void unregisterDriver (const std::string &)
 

Private Attributes

Mutex mutex
 
std::list< Device * > devices
 
std::map< std::string, Driver * > driverMap
 

Static Private Attributes

static Managerinstance = 0
 

Friends

class Device
 
class Driver
 

Detailed Description

Provides a central meeting point for interfacing with all DAQ objects available in the system.

See also
DAQ::Device
DAQ::Driver

Definition at line 73 of file daq.h.

Constructor & Destructor Documentation

DAQ::Manager::Manager(void )
inlineprivate

Definition at line 114 of file daq.h.

DAQ::Manager::~Manager(void )
inlineprivate

Definition at line 115 of file daq.h.

DAQ::Manager::Manager(const Manager)
inlineprivate

Definition at line 116 of file daq.h.

Member Function Documentation

void DAQ::Manager::foreachDevice(void(*)(Device *, void *) callback,
void * param 
)

Loop through each Device and execute a callback. The callback takes two parameters, a Device pointer and param, the second parameter to foreachDevice.

Parameters
callbackThe callback function
paramA parameter to the callback function.
See also
DAQ::Device

Definition at line 43 of file daq.cpp.

DAQ::Manager * DAQ::Manager::getInstance(void )
static

Manager is a Singleton, which means that there can only be one instance. This function returns a pointer to that single instance.

Returns
The instance of Manager.

Definition at line 129 of file daq.cpp.

void DAQ::Manager::insertDevice(DAQ::Devicedevice)
private

Definition at line 66 of file daq.cpp.

DAQ::Device * DAQ::Manager::loadDevice(const std::string & driver,
const std::list< std::string > & params 
)

Function for creating a device from the specified driver.

Parameters
driverThe driver for the device.
paramsParameters to the driver.
See also
DAQ::Device
DAQ::Driver

Definition at line 52 of file daq.cpp.

Manager& DAQ::Manager::operator=(const Manager)
inlineprivate

Definition at line 117 of file daq.h.

void DAQ::Manager::registerDriver(Driverdriver,
const std::string & name 
)
private

Definition at line 97 of file daq.cpp.

void DAQ::Manager::removeDevice(DAQ::Devicedevice)
private

Definition at line 85 of file daq.cpp.

void DAQ::Manager::unregisterDriver(const std::string & name)
private

Definition at line 114 of file daq.cpp.

Friends And Related Function Documentation

friend class Device
friend

Definition at line 76 of file daq.h.

friend class Driver
friend

Definition at line 77 of file daq.h.

Member Data Documentation

std::list<Device *> DAQ::Manager::devices
private

Definition at line 131 of file daq.h.

std::map<std::string,Driver *> DAQ::Manager::driverMap
private

Definition at line 132 of file daq.h.

DAQ::Manager * DAQ::Manager::instance = 0
staticprivate

Definition at line 120 of file daq.h.

Mutex DAQ::Manager::mutex
private

Definition at line 130 of file daq.h.


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