openDAQ
Open data acquisition platform
GenericInputPortPtr< InterfaceType > Class Template Reference

Signals accepted by input ports can be connected, forming a connection between the input port and signal, through which Packets can be sent. More...

+ Inheritance diagram for GenericInputPortPtr< InterfaceType >:
+ Collaboration diagram for GenericInputPortPtr< InterfaceType >:

Detailed Description

template<typename InterfaceType>
class GenericInputPortPtr< InterfaceType >

Signals accepted by input ports can be connected, forming a connection between the input port and signal, through which Packets can be sent.

Any openDAQ object which wishes to receive signal data must create an input port and connect it to said signals. Such objects are for example function blocks, and readers.

An input port can filter out incompatible signals by returning false when such a signal is passed as argument to acceptsSignal, and also rejects the signals when they are passed as argument to connect.

Depending on the configuration, an input port might not require a signal to be connected, returning false when requiresSignal is called. Such input ports are usually a part of function blocks that do not require a given signal to perform calculations.

Public Member Functions

daq::Bool acceptsSignal (const daq::SignalPtr &signal) const
 Returns true if the signal can be connected to the input port; false otherwise. More...
 
void connect (const daq::SignalPtr &signal) const
 Connects the signal to the input port, forming a Connection. More...
 
void disconnect () const
 Disconnects the signal from the input port.
 
daq::SignalPtr getSignal () const
 Gets the signal connected to the input port. More...
 
daq::Bool getRequiresSignal () const
 Returns true if the input port requires a signal to be connected; false otherwise. More...
 
daq::ConnectionPtr getConnection () const
 Gets the Connection object formed between the Signal and Input port. More...
 
- Public Member Functions inherited from GenericComponentPtr< InterfaceType >
daq::StringPtr getLocalId () const
 Gets the local ID of the component. More...
 
daq::StringPtr getGlobalId () const
 Gets the global ID of the component. More...
 
daq::Bool getActive () const
 Returns true if the component is active; false otherwise. More...
 
void setActive (daq::Bool active) const
 Sets the component to be either active or inactive. Also recursively sets the active field of all child components if component is a folder. More...
 
daq::ContextPtr getContext () const
 Gets the context object. More...
 
daq::ComponentPtr getParent () const
 Gets the parent of the component. More...
 
daq::StringPtr getName () const
 Gets the name of the component. More...
 
void setName (const daq::StringPtr &name) const
 Sets the name of the component. More...
 
daq::StringPtr getDescription () const
 Gets the description of the component. More...
 
void setDescription (const daq::StringPtr &description) const
 Sets the description of the component. More...
 
daq::TagsPtr getTags () const
 Gets the tags of the component. More...
 
daq::Bool getVisible () const
 Gets visible metadata state of the component. More...
 
void setVisible (daq::Bool visible) const
 Sets visible attribute state of the component. More...
 
daq::ListPtr< daq::IString > getLockedAttributes () const
 Gets a list of the component's locked attributes. The locked attributes cannot be modified via their respective setters. More...
 
daq::Event< daq::ComponentPtr, daq::CoreEventArgsPtr > getOnComponentCoreEvent () const
 Gets the Core Event object that triggers whenever a change to this component happens within the openDAQ core structure. More...
 
daq::ComponentStatusContainerPtr getStatusContainer () const
 Gets the container of Component statuses. More...
 
daq::ComponentPtr findComponent (const daq::StringPtr &id) const
 Finds the component (signal/device/function block) with the specified (global) id. More...
 
daq::OperationModeType getOperationMode () const
 Gets the operation mode of the device. More...
 
- Public Member Functions inherited from GenericPropertyObjectPtr< InterfaceType >
daq::StringPtr getClassName () const
 Gets the name of the class the Property object was constructed with. More...
 
void setPropertyValue (const daq::StringPtr &propertyName, const daq::BaseObjectPtr &value) const
 Sets the value of the Property with the given name. More...
 
daq::BaseObjectPtr getPropertyValue (const daq::StringPtr &propertyName) const
 Gets the value of the Property with the given name. More...
 
daq::BaseObjectPtr getPropertySelectionValue (const daq::StringPtr &propertyName) const
 Gets the selected value of the Property, if the Property is a Selection property. More...
 
void clearPropertyValue (const daq::StringPtr &propertyName) const
 Clears the Property value from the Property object. More...
 
daq::Bool hasProperty (const daq::StringPtr &propertyName) const
 Checks if the Property object contains a property named propertyName. More...
 
daq::PropertyPtr getProperty (const daq::StringPtr &propertyName) const
 Gets the Property with the given propertyName. More...
 
void addProperty (const daq::PropertyPtr &property) const
 Adds the property to the Property object. More...
 
void removeProperty (const daq::StringPtr &propertyName) const
 Removes the Property named propertyName from the Property object. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnPropertyValueWrite (const daq::StringPtr &propertyName) const
 Gets the Event that is triggered whenever a Property value is written to the Property named propertyName. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnPropertyValueRead (const daq::StringPtr &propertyName) const
 Gets the Event that is triggered whenever a Property value of a Property named propertyName is read. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnAnyPropertyValueWrite () const
 Gets the Event that is triggered whenever any Property value is written. The event is triggered after the specific Property event. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnAnyPropertyValueRead () const
 Gets the Event that is triggered whenever any Property value is read.The event is triggered after the specific Property event. More...
 
daq::ListPtr< daq::IProperty > getVisibleProperties () const
 Returns a list of visible properties contained in the Property object. More...
 
daq::ListPtr< daq::IProperty > getAllProperties () const
 Returns a list of all properties contained in the Property object. More...
 
void setPropertyOrder (const daq::ListPtr< daq::IString > &orderedPropertyNames) const
 Sets a custom order of properties as defined in the list of property names. More...
 
void beginUpdate () const
 Begins batch configuration of the object. More...
 
void endUpdate () const
 Ends batch configuration of the object. More...
 
daq::Bool getUpdating () const
 Returns the state of batch configuration. More...
 
daq::Event< daq::PropertyObjectPtr, daq::EndUpdateEventArgsPtr > getOnEndUpdate () const
 Gets the Event that is triggered whenever the batch configuration is applied. More...
 
daq::PermissionManagerPtr getPermissionManager () const
 Gets the permission manager of property object. More...
 

Member Function Documentation

◆ acceptsSignal()

daq::Bool acceptsSignal ( const daq::SignalPtr &  signal) const
inline

Returns true if the signal can be connected to the input port; false otherwise.

Parameters
signalThe signal being evaluated for compatibility.
Returns
True if the signal can be connected; false otherwise.
Exceptions
NotAssignedExceptionif the accepted signal criteria is not defined by the input port.

◆ connect()

void connect ( const daq::SignalPtr &  signal) const
inline

Connects the signal to the input port, forming a Connection.

Parameters
signalThe signal to be connected to the input port.
Exceptions
OpendaqErrExceptionif the signal is not accepted.
NotAssignedExceptionif the accepted signal criteria is not defined by the input port.

The signal is notified of the connection formed between it and the input port.

◆ getConnection()

daq::ConnectionPtr getConnection ( ) const
inline

Gets the Connection object formed between the Signal and Input port.

Returns
The Connection object.

◆ getRequiresSignal()

daq::Bool getRequiresSignal ( ) const
inline

Returns true if the input port requires a signal to be connected; false otherwise.

Returns
True if the input port requires a signal to be connected; false otherwise.

◆ getSignal()

daq::SignalPtr getSignal ( ) const
inline

Gets the signal connected to the input port.

Returns
The signal connected to the input port.