openDAQ
Open data acquisition platform
ModulePtr Class Reference

A module is an object that provides device and function block factories. The object is usually implemented in an external dynamic link / shared library. IModuleManager is responsible for loading all modules. More...

Inherits ObjectPtr< IModule >.

Detailed Description

A module is an object that provides device and function block factories. The object is usually implemented in an external dynamic link / shared library. IModuleManager is responsible for loading all modules.

Public Member Functions

daq::VersionInfoPtr getVersionInfo () const
 Retrieves the module version information. More...
 
daq::StringPtr getName () const
 Gets the module name. More...
 
daq::StringPtr getId () const
 Gets the module id. More...
 
daq::ListPtr< daq::IDeviceInfo > getAvailableDevices () const
 Returns a list of known devices info. The implementation can start discovery in background and only return the results in this function. More...
 
daq::DictPtr< daq::IString, daq::IDeviceType > getAvailableDeviceTypes () const
 Returns a dictionary of known and available device types this module can create. More...
 
daq::DevicePtr createDevice (const daq::StringPtr &connectionString, const daq::ComponentPtr &parent, const daq::PropertyObjectPtr &config=nullptr) const
 Creates a device object that can communicate with the device described in the specified connection string. The device object is not automatically added as a sub-device of the caller, but only returned by reference. More...
 
daq::DictPtr< daq::IString, daq::IFunctionBlockType > getAvailableFunctionBlockTypes () const
 Returns a dictionary of known and available function block types this module can create. More...
 
daq::FunctionBlockPtr createFunctionBlock (const daq::StringPtr &id, const daq::ComponentPtr &parent, const daq::StringPtr &localId, const daq::PropertyObjectPtr &config=nullptr) const
 Creates and returns a function block with the specified id. The function block is not automatically added to the FB list of the caller. More...
 
daq::DictPtr< daq::IString, daq::IServerType > getAvailableServerTypes () const
 Returns a dictionary of known and available servers types that this module can create. More...
 
daq::ServerPtr createServer (const daq::StringPtr &serverTypeId, const daq::DevicePtr &rootDevice, const daq::PropertyObjectPtr &config=nullptr) const
 Creates and returns a server with the specified server type. More...
 
daq::StreamingPtr createStreaming (const daq::StringPtr &connectionString, const daq::PropertyObjectPtr &config=nullptr) const
 Creates and returns a streaming object using the specified connection string and config object. More...
 
daq::DictPtr< daq::IString, daq::IStreamingType > getAvailableStreamingTypes () const
 Returns a dictionary of known and available streaming types that this module (client) can create. More...
 

Member Function Documentation

◆ createDevice()

daq::DevicePtr createDevice ( const daq::StringPtr &  connectionString,
const daq::ComponentPtr &  parent,
const daq::PropertyObjectPtr &  config = nullptr 
) const
inline

Creates a device object that can communicate with the device described in the specified connection string. The device object is not automatically added as a sub-device of the caller, but only returned by reference.

Returns
The device object created to communicate with and control the device.
Parameters
connectionStringDescribes the connection info of the device to connect to.
parentThe parent component/device to which the device attaches.
configA configuration object that contains parameters used to configure a device in the form of key-value pairs.

◆ createFunctionBlock()

daq::FunctionBlockPtr createFunctionBlock ( const daq::StringPtr &  id,
const daq::ComponentPtr &  parent,
const daq::StringPtr &  localId,
const daq::PropertyObjectPtr &  config = nullptr 
) const
inline

Creates and returns a function block with the specified id. The function block is not automatically added to the FB list of the caller.

Parameters
idThe id of the function block to create. Ids can be retrieved by calling getAvailableFunctionBlockTypes().
parentThe parent component/device to which the device attaches.
localIdThe local id of the function block.
configFunction block configuration. In case of a null value, implementation should use default configuration.
Returns
The created function block.

◆ createServer()

daq::ServerPtr createServer ( const daq::StringPtr &  serverTypeId,
const daq::DevicePtr &  rootDevice,
const daq::PropertyObjectPtr &  config = nullptr 
) const
inline

Creates and returns a server with the specified server type.

Parameters
serverTypeIdThe id of the server type to create. ServerType can be retrieved by calling getAvailableServerTypes().
configServer configuration. In case of a null value, implementation should use default configuration.
rootDeviceRoot device.
Returns
The created server.

◆ createStreaming()

daq::StreamingPtr createStreaming ( const daq::StringPtr &  connectionString,
const daq::PropertyObjectPtr &  config = nullptr 
) const
inline

Creates and returns a streaming object using the specified connection string and config object.

Parameters
connectionStringTypically a connection string usually has a well known prefix, such as daq.lt//.
configA config object that contains parameters used to configure a streaming connection. In case of a null value, implementation should use default configuration.
Returns
The created streaming object.

◆ getAvailableDevices()

daq::ListPtr<daq::IDeviceInfo> getAvailableDevices ( ) const
inline

Returns a list of known devices info. The implementation can start discovery in background and only return the results in this function.

Returns
The list of known devices information.

◆ getAvailableDeviceTypes()

daq::DictPtr<daq::IString, daq::IDeviceType> getAvailableDeviceTypes ( ) const
inline

Returns a dictionary of known and available device types this module can create.

Returns
The dictionary of known device types.

◆ getAvailableFunctionBlockTypes()

daq::DictPtr<daq::IString, daq::IFunctionBlockType> getAvailableFunctionBlockTypes ( ) const
inline

Returns a dictionary of known and available function block types this module can create.

Returns
The dictionary of known function block types.

◆ getAvailableServerTypes()

daq::DictPtr<daq::IString, daq::IServerType> getAvailableServerTypes ( ) const
inline

Returns a dictionary of known and available servers types that this module can create.

Returns
The dictionary of known server types.

◆ getAvailableStreamingTypes()

daq::DictPtr<daq::IString, daq::IStreamingType> getAvailableStreamingTypes ( ) const
inline

Returns a dictionary of known and available streaming types that this module (client) can create.

Returns
The dictionary of known streaming types.

◆ getId()

daq::StringPtr getId ( ) const
inline

Gets the module id.

Returns
The module id.

◆ getName()

daq::StringPtr getName ( ) const
inline

Gets the module name.

Returns
The module name.

◆ getVersionInfo()

daq::VersionInfoPtr getVersionInfo ( ) const
inline

Retrieves the module version information.

Returns
The semantic version information.