openDAQ
Open data acquisition platform
InstancePtr Class Reference

The top-level openDAQ object. It acts as container for the openDAQ context and the base module manager. More...

+ Inheritance diagram for InstancePtr:
+ Collaboration diagram for InstancePtr:

Detailed Description

The top-level openDAQ object. It acts as container for the openDAQ context and the base module manager.

It forwards all Device and PropertyObject calls to the current root device, making the calls on the Instance and root device equivalent.

On creation, it creates a Client device - a default device implementation that can load any function blocks present in the module manager search path. If the native openDAQ client-module is loaded, the Client device can connect to any TMS enabled device by using the addDevice function. The Client is set as the root device when the instance is created.

Public Member Functions

daq::ModuleManagerPtr getModuleManager () const
 Gets the Module manager. More...
 
daq::GenericDevicePtr getRootDevice () const
 Gets the current root device. More...
 
void setRootDevice (const daq::StringPtr &connectionString, const daq::PropertyObjectPtr &config=nullptr) const
 Adds a device with the connection string as root device. More...
 
daq::DictPtr< daq::IString, daq::IServerType > getAvailableServerTypes () const
 Get a dictionary of available server types as <IString, IServerType> pairs. More...
 
daq::ListPtr< daq::IServer > addStandardServers () const
 Creates and adds streaming and "OpenDAQOPCUA" servers with default configurations. More...
 
- Public Member Functions inherited from GenericDevicePtr< IInstance >
daq::DeviceInfoPtr getInfo () const
 Gets the device info. It contains data about the device such as the device's serial number, location, and connection string. More...
 
daq::DeviceDomainPtr getDomain () const
 Gets the device's domain data. It allows for querying the device for its domain (time) values. More...
 
daq::GenericFolderPtr< daq::IFolder > getInputsOutputsFolder () const
 Gets a folder containing channels. More...
 
daq::ListPtr< daq::IComponent > getCustomComponents () const
 Gets a list of all components/folders in a device that are not titled 'IO', 'Sig', 'Dev', 'Synchronization' or 'FB'. More...
 
daq::ListPtr< daq::ISignal > getSignals (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets a list of the device's signals. More...
 
daq::ListPtr< daq::ISignal > getSignalsRecursive (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets a list of the signals that belong to the device. More...
 
daq::ListPtr< daq::IChannel > getChannels (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets a flat list of the device's physical channels. More...
 
daq::ListPtr< daq::IChannel > getChannelsRecursive (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets a flat list of the device's physical channels. Also finds all visible channels of visible child devices. More...
 
daq::ListPtr< daq::IDevice > getDevices (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets a list of child devices that the device is connected to. More...
 
daq::ListPtr< daq::IDeviceInfo > getAvailableDevices () const
 Gets a list of available devices, containing their Device Info. More...
 
daq::DictPtr< daq::IString, daq::IDeviceType > getAvailableDeviceTypes () const
 Get a dictionary of available device types as <IString, IDeviceType> pairs. More...
 
daq::GenericDevicePtr< daq::IDevice > addDevice (const daq::StringPtr &connectionString, const daq::PropertyObjectPtr &config=nullptr) const
 Connects to a device at the given connection string and returns it. More...
 
void removeDevice (const daq::GenericDevicePtr< daq::IDevice > &device) const
 Disconnects from the device provided as argument and removes it from the internal list of devices. More...
 
daq::ListPtr< daq::IFunctionBlock > getFunctionBlocks (const daq::SearchFilterPtr &searchFilter=nullptr) const
 Gets the list of added function blocks. More...
 
daq::DictPtr< daq::IString, daq::IFunctionBlockType > getAvailableFunctionBlockTypes () const
 Gets all function block types that are supported by the device, containing their description. More...
 
daq::FunctionBlockPtr addFunctionBlock (const daq::StringPtr &typeId, const daq::PropertyObjectPtr &config=nullptr) const
 Creates and adds a function block to the device with the provided unique ID and returns it. More...
 
void removeFunctionBlock (const daq::FunctionBlockPtr &functionBlock) const
 Removes the function block provided as argument, disconnecting its signals and input ports. More...
 
daq::StringPtr saveConfiguration () const
 Saves the configuration of the device to string. More...
 
void loadConfiguration (const daq::StringPtr &configuration, const daq::UpdateParametersPtr &config=nullptr) const
 Loads the configuration of the device from string. More...
 
daq::UInt getTicksSinceOrigin () const
 Gets the number of ticks passed since the device's absolute origin. More...
 
daq::StreamingPtr addStreaming (const daq::StringPtr &connectionString, const daq::PropertyObjectPtr &config=nullptr) const
 Connects to a streaming at the given connection string, adds it as a streaming source of device and returns created streaming object. More...
 
daq::PropertyObjectPtr createDefaultAddDeviceConfig () const
 Creates config object that can be used when adding a device. Contains Device and Streaming default configuration for all available Device/Streaming types. Also contains general add-device configuration settings. More...
 
daq::SyncComponentPtr getSyncComponent () const
 Gets the sync component of the device. More...
 
daq::ServerPtr addServer (const daq::StringPtr &typeId, const daq::PropertyObjectPtr &config) const
 Creates and adds to the device a server with the provided unique type ID and returns it. More...
 
void removeServer (const daq::ServerPtr &server) const
 Removes the server provided as argument. More...
 
daq::ListPtr< daq::IServer > getServers () const
 Get list of added servers. More...
 
void lock () const
 Lock a device with a session user. Once locked, no properties of the device can be changed via the protocol layer. Only the same user who locked the device can unlock it. If no user was specified when the device was locked, any user will be able to unlock it.
 
void unlock () const
 Unlock a device with a session user. A device can only be unlocked by the same user who locked it. If no user was specified when the device was locked, any user will be able to unlock it.
 
daq::Bool isLocked () const
 Returns truee if device is locked. Once locked, no properties of the device can be changed via the protocol layer. More...
 
daq::ListPtr< daq::ILogFileInfo > getLogFileInfos () const
 Gets a list of available log files. More...
 
daq::StringPtr getLog (const daq::StringPtr &id, daq::Int size=-1, daq::Int offset=0) const
 Retrieves a chunk of the log file with the provided ID. This function extracts a specified portion (or the entire content) of the log file, starting at the given offset. If the size and offset are not specified, it will attempt to return the entire log file by default. More...
 

Member Function Documentation

◆ addStandardServers()

daq::ListPtr<daq::IServer> addStandardServers ( ) const
inline

Creates and adds streaming and "OpenDAQOPCUA" servers with default configurations.

Returns
List of added created servers.

◆ getAvailableServerTypes()

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

Get a dictionary of available server types as <IString, IServerType> pairs.

Returns
The dictionary of available server types.

◆ getModuleManager()

daq::ModuleManagerPtr getModuleManager ( ) const
inline

Gets the Module manager.

Returns
The module manager.

◆ getRootDevice()

daq::GenericDevicePtr getRootDevice ( ) const
inline

Gets the current root device.

Returns
The current root device.

All Device calls invoked on the Instance are forwarded to the current root device.

◆ setRootDevice()

void setRootDevice ( const daq::StringPtr &  connectionString,
const daq::PropertyObjectPtr &  config = nullptr 
) const
inline

Adds a device with the connection string as root device.

Parameters
connectionStringThe connection string containing the address of the device.
configA config object to configure a client device. This object can contain properties like max sample rate, port to use for 3rd party communication, number of channels to generate, or other device specific settings. In case of nullptr, a default configuration is used.

All Device calls invoked on the Instance are forwarded to the root device. The root device can only be set once.