BusBricks: ServiceCluster< number_of_services > Class Template Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
ServiceCluster< number_of_services > Class Template Reference

The ServiceCluster provides functions to manage multiple services. The ServiceCluster is added to the ServiceInterface and contains references to all services, associated with the interface. More...

#include <ServiceCluster.h>

Inheritance diagram for ServiceCluster< number_of_services >:
[legend]
Collaboration diagram for ServiceCluster< number_of_services >:
[legend]

Public Member Functions

 ServiceCluster (ServiceBase *serviceList[number_of_services])
 Construct a new Service Cluster object from associated services.
 
ServiceBasegetService_byID (uint8_t ServiceID) override
 Get pointer to the service with the given service-ID by iterating through the associated services and calling their get_ServiceID-function.
 
ServiceBasegetService_byPos (uint8_t ServicePosition) override
 Get pointer to the service at a specific position in the cluster (positions starting by zero)
 
uint8_t getNumberOfServices () const override
 Get the total Number Of Services-objects associated to the cluster.
 
errorCodes impartPdu (Frame *FrameToAdd) override
 Add the payload of the referenced Frame to the belonging Service (Multiplexing by Service-ID)
 
- Public Member Functions inherited from ServiceClusterBase
virtual ~ServiceClusterBase ()
 Destroy the Service Cluster Base object.
 
- Public Member Functions inherited from ErrorState
 ErrorState ()
 Default constructor for ErrorState.
 
 ~ErrorState ()
 Destroy the ErrorState object.
 
void raiseError (errorCodes code)
 raises a new error by setting the given error-code as errorState
 
errorCodes getErrorState ()
 Get the currently active error-code.
 
void clearErrorState ()
 sets the current error-state to "no Error"
 

Detailed Description

template<uint8_t number_of_services>
class ServiceCluster< number_of_services >

The ServiceCluster provides functions to manage multiple services. The ServiceCluster is added to the ServiceInterface and contains references to all services, associated with the interface.

Author
Felix Schuelke
Template Parameters
number_of_servicesnumber of service-instances, the cluster contains

Constructor & Destructor Documentation

◆ ServiceCluster()

template<uint8_t number_of_services>
ServiceCluster< number_of_services >::ServiceCluster ( ServiceBase * serviceList[number_of_services])
inline

Construct a new Service Cluster object from associated services.

Parameters
serviceListArray of references to the associated services

Member Function Documentation

◆ getNumberOfServices()

template<uint8_t number_of_services>
uint8_t ServiceCluster< number_of_services >::getNumberOfServices ( ) const
inlineoverridevirtual

Get the total Number Of Services-objects associated to the cluster.

Returns
uint8_t total Number Of Services-objects associated to the cluster

Implements ServiceClusterBase.

◆ getService_byID()

template<uint8_t number_of_services>
ServiceBase * ServiceCluster< number_of_services >::getService_byID ( uint8_t ServiceID)
inlineoverridevirtual

Get pointer to the service with the given service-ID by iterating through the associated services and calling their get_ServiceID-function.

Parameters
ServiceID1-byte service-ID (unique for service-class)
Returns
ServiceBase* pointer to the service with the given ID

Implements ServiceClusterBase.

◆ getService_byPos()

template<uint8_t number_of_services>
ServiceBase * ServiceCluster< number_of_services >::getService_byPos ( uint8_t ServicePosition)
inlineoverridevirtual

Get pointer to the service at a specific position in the cluster (positions starting by zero)

Parameters
ServicePositionposition of the service in the cluster (0-based)
Returns
ServiceBase* pointer to the service at the given position

Implements ServiceClusterBase.

◆ impartPdu()

template<uint8_t number_of_services>
errorCodes ServiceCluster< number_of_services >::impartPdu ( Frame * FrameToAdd)
inlineoverridevirtual

Add the payload of the referenced Frame to the belonging Service (Multiplexing by Service-ID)

Parameters
FrameToAddFrame, thats PDU has to be added to the Service
Returns
true PDU added successfully
false failed to add PDU

Implements ServiceClusterBase.

Here is the call graph for this function:

The documentation for this class was generated from the following file: