Class CSignal#

Nested Relationships#

Nested Types#

Class Documentation#

class CSignal#

Signal administration.

Public Functions

CSignal(CDispatchService &rDispatchSvc, const sdv::u8string &rssName, sdv::core::ESignalDirection eDirection, sdv::any_t anyDefVal = sdv::any_t())#

Signal class constructor.

Parameters:
  • rDispatchSvc[in] Reference to the dispatch service.

  • rssName[in] Reference to the name string.

  • anyDefVal[in] Any containing the default value (for send-signals).

  • eDirection[in] Definition whether the signal is a send or receive signal.

~CSignal()#

Destructor.

sdv::u8string GetName() const#

Get the name of the signal.

Returns:

String with the signal name.

sdv::core::ESignalDirection GetDirection() const#

Get the signal direction.

Returns:

The signal direction.

sdv::any_t GetDefVal() const#

Get the signal default value.

Returns:

Any structure with default value.

CProvider *CreateProvider()#

Create a provider object.

Returns:

Returns a pointer to the provider object or NULL when the signal is not configured to be a provider.

void RemoveProvider(CProvider *pProvider)#

Remove a provider object.

Remark

If there are no other consumer/provider objects any more, the signal is unregistered from the dispatch service.

Parameters:

pProvider[in] Pointer to the provider to remove.

CConsumer *CreateConsumer(sdv::IInterfaceAccess *pEvent = nullptr)#

Create a consumer object.

Parameters:

pEvent[in] The event to be triggered on a signal change. Optional.

Returns:

Returns a pointer to the consumer object or NULL when the signal is not configured to be a consumer.

void RemoveConsumer(CConsumer *pConsumer)#

Remove a consumer object.

Remark

If there are no other consumer/provider objects any more, the signal is unregistered from the dispatch service.

Parameters:

pConsumer[in] Pointer to the consumer to remove.

void WriteFromProvider(const sdv::any_t &ranyVal, uint64_t uiTransactionID, std::set<CTrigger*> &rsetTriggers)#

Update the signal value with the transaction ID supplied. A new entry will be created if the transaction is larger.

Parameters:
  • ranyVal[in] Reference to the value to update the signal with.

  • uiTransactionID[in] The transaction ID or 0 for current transaction ID.

  • rsetTriggers[in] Set of triggers to execute on a spontaneous write.

sdv::any_t ReadFromConsumer(uint64_t uiTransactionID) const#

Get the signal value.

Parameters:

uiTransactionID[in] The transaction ID or 0 for current transaction ID.

Returns:

Returns the value.

void DistributeToConsumers(const sdv::any_t &ranyVal)#

Distribute a value to all consumers.

Parameters:

ranyVal[in] Reference of the value to distribute.

void AddTrigger(CTrigger *pTrigger)#

Add a trigger to the signal. This trigger will be returned when creating a trigger list.

Parameters:

pTrigger[in] Pointer to the trigger object.

void RemoveTrigger(CTrigger *pTrigger)#

Remove the trigger from the signal.

Parameters:

pTrigger[in] Pointer to the trigger object.

bool EqualsDefaultValue() const#

Returns whether the signal equals the default value.

Returns:

Return the result of the comparison.

struct SSignalObjectHelper#

Helper object to manage object lifetime.

Public Functions

virtual ~SSignalObjectHelper() = default#

Default destructor (needs to be virtual to allow deletion of derived class).