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

Represents an error with it's error-content (error-code and an error-message), and provides methods for converting between sendable PDU and error-content. More...

Inheritance diagram for Error:
[legend]
Collaboration diagram for Error:
[legend]

Public Member Functions

 Error ()
 Default constructor for Error.
 
 ~Error ()
 Destroy the Error object.
 
 Error (String *representation)
 Constructor for Error from a string-formatted PDU.
 
 Error (ErrorContent_t *errorContent)
 Constructor for Error from ErrorContent_t.
 
 Error (char instanceId, errorCodes code)
 Constructor for Error from error-code.
 
String to_string ()
 Converts the Error to a well formatted, printable string.
 
- Public Member Functions inherited from Content< ErrorContent_t, String >
 Content (ErrorContent_t content)
 Construct a new Content object from an instance from type content_type (content itself)
 
 Content (String representation)
 Construct a new Content object from it's representation from type representation_type.
 
Stringget_representation ()
 Get the address of the informations representation of type representation-type.
 
ErrorContent_tget_content ()
 Get the address of the informations content of type content_type.
 
bool isValid ()
 Representation and Content of the object are existent (not default)
 

Additional Inherited Members

- Protected Member Functions inherited from Content< ErrorContent_t, String >
- Protected Attributes inherited from Content< ErrorContent_t, String >
ErrorContent_t content
 Content of an information (view on information (content) closer to Service-Layer)

 
String representation
 Representation of an information (view on information (content) closer to physical layer)

 

Detailed Description

Represents an error with it's error-content (error-code and an error-message), and provides methods for converting between sendable PDU and error-content.

This class handles the mapping between string-formatted PDUs (Representation) and errors with error-code and error-message (Content). It offers constructors for creating Error objects from different types of inputs and provides methods to convert between a Error's content and its PDU representation.

Note
The Error class inherits from Content<ErrorContent_t, String>, providing a specialized implementation for handling errors.

Constructors

Methods

  • String to_string(): Returns a string well formatted and printable representation of the error.
  • void rep_to_content(): Converts the byte-representation (PDU) to error content. This method is overridden from the base class Content.
  • void content_to_rep(): Converts error content to sendable byte-representation (PDU). This method is overridden from the base class Content.

Constructor & Destructor Documentation

◆ Error() [1/4]

Error::Error ( )

Default constructor for Error.

Initializes an empty Error object

◆ Error() [2/4]

Error::Error ( String * representation)

Constructor for Error from a string-formatted PDU.

Initializes the Error-object based on the provided string representation of the PDU.

Parameters
representationA pointer to the string-formatted PDU.

◆ Error() [3/4]

Error::Error ( ErrorContent_t * errorContent)

Constructor for Error from ErrorContent_t.

Initializes the Error-object using the provided ErrorContent_t structure.

Parameters
errorContentA pointer to the ErrorContent_t structure containing the error details.

◆ Error() [4/4]

Error::Error ( char instanceId,
errorCodes code )

Constructor for Error from error-code.

Initializes the Error-object using the provided error-code.

Parameters
codeerror-code

Member Function Documentation

◆ to_string()

String Error::to_string ( )

Converts the Error to a well formatted, printable string.

Returns
A String representing the error.

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