Class CDispatchService#
Defined in File dispatchservice.h
Inheritance Relationships#
Base Types#
public sdv::CSdvObject
(Class CSdvObject)public sdv::core::ISignalTransmission
(Struct ISignalTransmission)public sdv::core::ISignalAccess
(Struct ISignalAccess)public sdv::core::IDispatchTransaction
(Struct IDispatchTransaction)public sdv::IObjectControl
(Struct IObjectControl)
Class Documentation#
-
class CDispatchService : public sdv::CSdvObject, public sdv::core::ISignalTransmission, public sdv::core::ISignalAccess, public sdv::core::IDispatchTransaction, public sdv::IObjectControl#
data dispatch service to read/write and react on signal changes
Public Functions
-
CDispatchService()#
Constructor.
-
virtual IInterfaceAccess *CreateTxTrigger(uint32_t uiCycleTime, uint32_t uiDelayTime, uint32_t uiBehaviorFlags, sdv::IInterfaceAccess *pTriggerCallback)#
Create a TX trigger object that defines how to trigger the signal transmission. Overload of sdv::core::ISignalTransmission::CreateTxTrigger.
- Parameters:
uiCycleTime – [in] When set to any value other than 0, provides a cyclic trigger (ms). Could be 0 if cyclic triggering is not required.
uiDelayTime – [in] When set to any value other than 0, ensures a minimum time between two triggers. Could be 0 if minimum time should not be enforced.
uiBehaviorFlags – [in] Zero or more flags from sdv::core::ETxTriggerBehavior.
pTriggerCallback – [in] Pointer to the trigger callback object. This object needs to expose the ITxTriggerCallback interface. This interface must stay valid during the lifetime of the generated trigger object.
- Returns:
On success, returns an interface to the trigger object. Use the ITxTrigger interface to assign signals to the trigger. Returns null when a trigger was requested without cycletime and without trigger behavior (which would mean it would never trigger). Use IObjectDestroy to destroy the trigger object.
-
virtual sdv::IInterfaceAccess *RegisterTxSignal(const sdv::u8string &ssSignalName, sdv::any_t anyDefVal) override#
Register a signal for sending over the network; reading from the dispatch service. Data is provided by the signal publisher and dependable on the requested behavior stored until it is sent. Overload of sdv::core::ISignalTransmission::RegisterTxSignal.
- Parameters:
ssSignalName – [in] Name of the signal. To guarantee uniqueness, it is preferred to add the group hierarchy to the signal name separated by a dot. E.g. with CAN: MAB.BcmChas1Fr03.SteerReCtrlReqAgReq
anyDefVal – [in] The default value of the signal.
- Returns:
Returns the IInterfaceAccess interface that allows access to the ISignalRead interface for reading the signal value.
-
virtual sdv::IInterfaceAccess *RegisterRxSignal(const sdv::u8string &ssSignalName) override#
Register a signal for reception over the network; providing to the dispatch service. Overload of sdv::core::ISignalTransmission::RegisterRxSignal.
- Parameters:
ssSignalName – [in] Name of the signal. To guarantee uniqueness, it is preferred to add the group hierarchy to the signal name separated by a dot. E.g. with CAN: MAB.BcmChas1Fr03.SteerReCtrlReqAgReq
- Returns:
Returns the IInterfaceAccess interface that allows access to the ISignalWrite interface for writing the signal value.
-
virtual sdv::IInterfaceAccess *RequestSignalPublisher(const sdv::u8string &ssSignalName) override#
Requested a registered signal for publication (send signal). Overload of sdv::core::ISignalAccess::RequestSignalPublisher.
- Parameters:
ssSignalName – [in] Name of the signal. To guarantee uniqueness, it is preferred to add the group hierarchy to the signal name separated by a dot. E.g. with CAN: MAB.BcmChas1Fr03.SteerReCtrlReqAgReq
- Returns:
Returns the IInterfaceAccess interface that allows access to the ISignalWrite interface for writing the signal value.
-
virtual sdv::IInterfaceAccess *AddSignalSubscription(const sdv::u8string &ssSignalName, sdv::IInterfaceAccess *pSubscriber) override#
Add a registered signal for subscription (receive signal). Overload of sdv::core::ISignalAccess::AddSignalSubscription.
- Parameters:
ssSignalName – [in] Name of the signal. To guarantee uniqueness, it is preferred to add the group hierarchy to the signal name separated by a dot. E.g. with CAN: MAB.BcmChas1Fr03.SteerReCtrlReqAgReq
pSubscriber – [in] Pointer to the IInterfaceAccess of the subscriber. The subscriber should implement the ISignalReceiveEvent interface.
- Returns:
Returns an interface that can be used to manage the subscription. Use IObjectDestroy to destroy the signal object.
-
virtual sdv::sequence<sdv::core::SSignalRegistration> GetRegisteredSignals() const override#
Get a list of registered signals.
- Returns:
List of registration functions.
-
virtual sdv::IInterfaceAccess *CreateTransaction() override#
CreateTransaction a transaction. Overload of sdv::core::IDispatchTransaction::CreateTransaction.
When starting a group transaction, any writing to a signal will not be reflected yet until the transaction is finalized. For the data link layer, this also allows freezing the reading values until all values have been read.
- Returns:
Returns the transaction interface or NULL when the transaction could not be started. Use IObjectDestroy to destroy the transaction object.
-
uint64_t GetNextTransactionID()#
Get the next transaction ID.
- Returns:
Returns the next transaction ID.
-
void CreateDirectTransactionID()#
Create a new direct transaction ID.
The read transaction ID is used fir direct transmission after a read transaction was started. This prevents direct transmission overwriting the protected read transaction.
-
uint64_t GetDirectTransactionID() const#
Get the current direct transaction ID.
- Returns:
The transaction ID.
-
virtual void Initialize(const sdv::u8string &ssObjectConfig) override#
Initialize the object. Overload of sdv::IObjectControl::Initialize.
- Parameters:
ssObjectConfig – [in] Optional configuration string.
-
virtual sdv::EObjectStatus GetStatus() const override#
Get the current status of the object. Overload of sdv::IObjectControl::GetStatus.
- Returns:
Return the current status of the object.
-
virtual void SetOperationMode(sdv::EOperationMode eMode) override#
Set the component operation mode. Overload of sdv::IObjectControl::SetOperationMode.
- Parameters:
eMode – [in] The operation mode, the component should run in.
-
virtual void Shutdown() override#
Shutdown called before the object is destroyed. Overload of sdv::IObjectControl::Shutdown.
-
void UnregisterSignal(const sdv::u8string &ssSignalName, sdv::core::ESignalDirection eDirection)#
Unregister a previously registered signal. This will render all subscriptions and provider connections invalid.
- Parameters:
ssSignalName – [in] Name of the signal to unregister.
eDirection – [in] The signal direction determines from which map the signal should be unregistered.
-
CSignal *FindSignal(const sdv::u8string &rssSignalName, sdv::core::ESignalDirection eDirection)#
Find the signal with the supplied name.
- Parameters:
rssSignalName – [in] Name of the signal to find.
eDirection – [in] The signal direction determines at which map the signal should be searched for.
- Returns:
Pointer to the signal or NULL when the signal could not be found.
-
void FinishTransaction(const CTransaction *pTransaction)#
Finalize a transaction transaction. Any update made on this interface between the start and the finalize will be in effect at once.
- Parameters:
pTransaction – [in] The transaction to finalize.
-
CScheduler &GetScheduler()#
Get the trigger execution scheduler.
- Returns:
Returns a reference to the contained trigger execution scheduler.
-
CDispatchService()#