BusBricks: ServiceBase Class Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
ServiceBase Class Referenceabstract

Service-base-class to add class-functions to vtable. More...

#include <Service.h>

Inheritance diagram for ServiceBase:
[legend]

Public Member Functions

virtual String get_response ()=0
 Get the get the response-payload, stored at the response_pdu of the service instance

 
virtual bool responseAvailable ()=0
 Check, if a response of the service is available (services sendStack not empty)
 
virtual void clearResponse ()=0
 Clear the response-buffer (delete item, that was returned by get_response from the service-sendStack)
 
virtual void stackProcessing ()=0
 Execute the service's functions for each item on the receive-stack and add all response-payloads to be send to the send-stack.
 
virtual bool impart_pdu (String *pdu)=0
 Add a new Content-Object created from a received payload to the services receive-Stack. The payload is the representation of the Content-Object, during the construction, the Content-object creates it's content from the representation. The Content-object is added to the rec_stack.
 
virtual uint8_t * get_ServiceID ()=0
 Get pointer to the 1-byte ServiceID of the Service (unique for each Service-template derived Class)
 
virtual uint8_t * get_InstanceID ()=0
 Get pointer to the 1-byte InstanceID of the Service-instance (unique for each Instance of Service within the whole communication-network)
 
virtual ~ServiceBase ()
 Destroy the Service Base object.
 

Detailed Description

Service-base-class to add class-functions to vtable.

Author
Felix Schuelke (flxsc.nosp@m.ode@.nosp@m.gmail.nosp@m..com)

Member Function Documentation

◆ clearResponse()

virtual void ServiceBase::clearResponse ( )
pure virtual

Clear the response-buffer (delete item, that was returned by get_response from the service-sendStack)

Implemented in Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

◆ get_InstanceID()

virtual uint8_t * ServiceBase::get_InstanceID ( )
pure virtual

Get pointer to the 1-byte InstanceID of the Service-instance (unique for each Instance of Service within the whole communication-network)

Returns
uint8_t* InstanceID of the Service-instance

Implemented in Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

◆ get_response()

virtual String ServiceBase::get_response ( )
pure virtual

Get the get the response-payload, stored at the response_pdu of the service instance

Returns
String response-pdu as String

Implemented in Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

◆ get_ServiceID()

virtual uint8_t * ServiceBase::get_ServiceID ( )
pure virtual

Get pointer to the 1-byte ServiceID of the Service (unique for each Service-template derived Class)

Returns
uint8_t* ServiceID of the service

Implemented in Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

◆ impart_pdu()

virtual bool ServiceBase::impart_pdu ( String * pdu)
pure virtual

Add a new Content-Object created from a received payload to the services receive-Stack. The payload is the representation of the Content-Object, during the construction, the Content-object creates it's content from the representation. The Content-object is added to the rec_stack.

Parameters
pdupayload from received Frame-object as pointer to string
Returns
true content-object added to service-rec_stack
false rec_stack is full, content-object not added

Implemented in Service< content_class, stackSize >.

Here is the caller graph for this function:

◆ responseAvailable()

virtual bool ServiceBase::responseAvailable ( )
pure virtual

Check, if a response of the service is available (services sendStack not empty)

Returns
true a response-payload is available
false no response-payload is available

Implemented in Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

◆ stackProcessing()

virtual void ServiceBase::stackProcessing ( )
pure virtual

Execute the service's functions for each item on the receive-stack and add all response-payloads to be send to the send-stack.

Implemented in ErrorService, MessageService, Service< content_class, stackSize >, Service< Error, STACKSIZE >, and Service< Message, STACKSIZE >.

Here is the caller graph for this function:

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