Class CSignal#
Defined in File signal_support.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class CSignal#
Signal class wrapping the signal access functions.
Public Functions
-
CSignal() = default#
Default constructor.
-
CSignal(const CSignal &rSignal) = delete#
Copy constructor (not available).
- Parameters:
rSignal – [in] Reference to the signal class to copy from.
-
inline CSignal(CSignal &&rSignal)#
Move constructor.
- Parameters:
rSignal – [in] Reference to the signal class to move from.
-
CSignal &operator=(const CSignal &rSignal) = delete#
Assignment operator (not available).
- Parameters:
rSignal – [in] Reference to the signal class to copy from.
- Returns:
Reference to this class.
-
inline CSignal &operator=(CSignal &&rSignal)#
Move operator.
- Parameters:
rSignal – [in] Reference to the signal class to move from.
- Returns:
Reference to this class.
-
inline ~CSignal()#
Destructor
-
inline void Reset()#
Reset the signal.
-
inline operator bool() const#
Operator testing for validity of this class.
-
template<typename TType>
inline void Write(TType tVal, const CTransaction &rTransaction = CTransaction())# Update the signal value. This function is available for Rx signals (receiving data from the network) and for services of publishing signals.
- Parameters:
tVal – [in] The value to update the signal with.
rTransaction – [in] Reference to the transaction to use for reading.
-
inline any_t Read(const CTransaction &rTransaction = CTransaction()) const#
Read the signal value. This function is available for Tx signals (sending data over the network).
- Parameters:
rTransaction – [in] Reference to the transaction to use for reading.
- Returns:
The signal value or empty when no value or interface is available.
-
inline bool UsedForRegistration() const#
Was this signal class used for registration of the signal.
- Returns:
Set when this signal is used for registration.
Protected Functions
-
inline CSignal(CDispatchService &rDispatch, const u8string &rssName, IInterfaceAccess *pSignal, bool bRegistering)#
Constructor for signal interface received by a call to RegisterTxSignal, RegisterRxSignal or RequestSignalPublisher.
- Parameters:
rDispatch – [in] Reference to the dispatch class.
rssName – [in] Reference to the string holding the name of the signal.
pSignal – [in] The signal interface access allowing access to the ISignalWrite interface.
bRegistering – [in] Boolean indicating that the signal was created using a registration function rather than an access function.
-
inline CSignal(CDispatchService &rDispatch, const u8string &rssName, std::function<void(any_t)> func)#
Constructor for signal receiving callback.
- Parameters:
rDispatch – [in] Reference to the dispatch class.
rssName – [in] Reference to the string holding the name of the signal.
func – [in] Callback function being called on receiving data.
-
template<typename TType>
inline CSignal(CDispatchService &rDispatch, const u8string &rssName, std::atomic<TType> &rtVal)# Constructor for signal receiving callback.
- Template Parameters:
TType – Type of the variable to update automatically on an event call.
- Parameters:
rDispatch – [in] Reference to the dispatch class.
rssName – [in] Reference to the string holding the name of the signal.
rtVal – [in] Reference to the variable to update automatically on an event call.
-
inline IInterfaceAccess *GetSubscriptionEventHandler()#
Get the subscription event handler, if existing.
- Returns:
Interface to the subscription handler or NULL when no handler is available.
-
inline void Assign(IInterfaceAccess *pSubscription)#
Assign subscription object returned by the dispatch service.
- Parameters:
pSubscription – [in] The interface to the subscription object.
-
CSignal() = default#