|
ndmspc
v1.2.0-0.1.rc3
|
Represents a CloudEvent object for HTTP communication. More...
#include <NCloudEvent.h>
Public Member Functions | |
| NCloudEvent (std::string id="0", std::string source="unknown", std::string specVersion="1.0", std::string type="unknown") | |
| Constructs a new NCloudEvent with specified parameters. More... | |
| NCloudEvent (THttpCallArg *arg) | |
| Constructs a new NCloudEvent from an HTTP call argument. More... | |
| virtual | ~NCloudEvent () |
| Destroys the NCloudEvent instance. | |
| virtual void | Clear (Option_t *opt="") |
| Clears the event data. More... | |
| virtual void | Print (Option_t *opt="") const |
| Prints the event details. More... | |
| bool | IsValid () const |
| Checks if the event is valid. More... | |
| std::string | GetId () const |
| Gets the event identifier. More... | |
| std::string | GetSource () const |
| Gets the event source URI. More... | |
| std::string | GetSpecVersion () const |
| Gets the CloudEvent specification version. More... | |
| std::string | GetType () const |
| Gets the event type. More... | |
| std::string | GetDatacontentType () const |
| Gets the event data content type. More... | |
| std::string | GetData () const |
| Gets the event data payload. More... | |
| std::string | GetInfo () const |
| Gets additional event information. More... | |
| void | HandleNCloudEventRequest (THttpCallArg *arg) |
| Handles an HTTP request for a CloudEvent. More... | |
| void | SetId (std::string id) |
| Sets the event identifier. More... | |
| void | SetSource (std::string source) |
| Sets the event source URI. More... | |
| void | SetSpecVersion (std::string specVersion) |
| Sets the CloudEvent specification version. More... | |
| void | SetDatacontentType (std::string datacontenttype) |
| Sets the event data content type. More... | |
| void | SetType (std::string type) |
| Sets the event type. More... | |
| void | SetData (std::string data) |
| Sets the event data payload. More... | |
Private Attributes | |
| bool | fIsValid {false} |
| Validity flag for the event. | |
| std::string | fId {} |
| Event identifier. | |
| std::string | fSource {} |
| Event source URI-reference. | |
| std::string | fSpecVersion {} |
| CloudEvent specification version. | |
| std::string | fType {} |
| Event type. | |
| std::string | fDataContentType {} |
| Event data content type. | |
| std::string | fData {} |
| Event data payload. | |
Represents a CloudEvent object for HTTP communication.
NCloudEvent encapsulates the CloudEvent specification fields and provides methods for manipulating and accessing event data. It supports construction from explicit parameters or from an HTTP call argument, and offers utilities for validation, printing, and event handling.
Definition at line 21 of file NCloudEvent.h.
| Ndmspc::NCloudEvent::NCloudEvent | ( | std::string | id = "0", |
| std::string | source = "unknown", |
||
| std::string | specVersion = "1.0", |
||
| std::string | type = "unknown" |
||
| ) |
Constructs a new NCloudEvent with specified parameters.
| id | Event identifier (default: "0"). |
| source | Event source URI (default: "unknown"). |
| specVersion | CloudEvent specification version (default: "1.0"). |
| type | Event type (default: "unknown"). |
Definition at line 11 of file NCloudEvent.cxx.
| Ndmspc::NCloudEvent::NCloudEvent | ( | THttpCallArg * | arg | ) |
Constructs a new NCloudEvent from an HTTP call argument.
| arg | Pointer to THttpCallArg containing event data. |
Definition at line 15 of file NCloudEvent.cxx.
References HandleNCloudEventRequest().
|
virtual |
Clears the event data.
| opt | Optional parameter for clear operation. |
Definition at line 71 of file NCloudEvent.cxx.
References fData, fDataContentType, fId, fIsValid, fSource, fSpecVersion, and fType.
Referenced by HandleNCloudEventRequest().
|
inline |
Gets the event data payload.
Definition at line 96 of file NCloudEvent.h.
References fData.
|
inline |
Gets the event data content type.
Definition at line 90 of file NCloudEvent.h.
References fDataContentType.
|
inline |
Gets the event identifier.
Definition at line 66 of file NCloudEvent.h.
References fId.
| std::string Ndmspc::NCloudEvent::GetInfo | ( | ) | const |
Gets additional event information.
Definition at line 64 of file NCloudEvent.cxx.
References fData, fDataContentType, fId, fSource, fSpecVersion, and fType.
Referenced by Print().
|
inline |
Gets the event source URI.
Definition at line 72 of file NCloudEvent.h.
References fSource.
|
inline |
Gets the CloudEvent specification version.
Definition at line 78 of file NCloudEvent.h.
References fSpecVersion.
|
inline |
Gets the event type.
Definition at line 84 of file NCloudEvent.h.
References fType.
| void Ndmspc::NCloudEvent::HandleNCloudEventRequest | ( | THttpCallArg * | arg | ) |
Handles an HTTP request for a CloudEvent.
| arg | Pointer to THttpCallArg containing request data. |
Definition at line 21 of file NCloudEvent.cxx.
References Clear(), fData, fDataContentType, fId, fIsValid, fSource, fSpecVersion, and fType.
Referenced by NCloudEvent().
|
inline |
Checks if the event is valid.
Definition at line 60 of file NCloudEvent.h.
References fIsValid.
|
virtual |
Prints the event details.
| opt | Optional parameter for print operation. |
Definition at line 81 of file NCloudEvent.cxx.
References GetInfo().
|
inline |
Sets the event data payload.
| data | Data payload string. |
Definition at line 144 of file NCloudEvent.h.
References fData.
|
inline |
Sets the event data content type.
| datacontenttype | Data content type string. |
Definition at line 132 of file NCloudEvent.h.
References fDataContentType.
|
inline |
Sets the event identifier.
| id | Event ID string. |
Definition at line 114 of file NCloudEvent.h.
References fId.
|
inline |
Sets the event source URI.
| source | Source URI string. |
Definition at line 120 of file NCloudEvent.h.
References fSource.
|
inline |
Sets the CloudEvent specification version.
| specVersion | Specification version string. |
Definition at line 126 of file NCloudEvent.h.
References fSpecVersion.
|
inline |
Sets the event type.
| type | Event type string. |
Definition at line 138 of file NCloudEvent.h.
References fType.