ndmspc  v1.2.0-0.1.rc3
Ndmspc::NCloudEvent Class Reference

Represents a CloudEvent object for HTTP communication. More...

#include <NCloudEvent.h>

Inheritance diagram for Ndmspc::NCloudEvent:

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.
 

Detailed Description

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.

Author
Martin Vala mvala.nosp@m.@cer.nosp@m.n.ch

Definition at line 21 of file NCloudEvent.h.

Constructor & Destructor Documentation

◆ NCloudEvent() [1/2]

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.

Parameters
idEvent identifier (default: "0").
sourceEvent source URI (default: "unknown").
specVersionCloudEvent specification version (default: "1.0").
typeEvent type (default: "unknown").

Definition at line 11 of file NCloudEvent.cxx.

◆ NCloudEvent() [2/2]

Ndmspc::NCloudEvent::NCloudEvent ( THttpCallArg *  arg)

Constructs a new NCloudEvent from an HTTP call argument.

Parameters
argPointer to THttpCallArg containing event data.

Definition at line 15 of file NCloudEvent.cxx.

References HandleNCloudEventRequest().

Member Function Documentation

◆ Clear()

void Ndmspc::NCloudEvent::Clear ( Option_t *  opt = "")
virtual

Clears the event data.

Parameters
optOptional parameter for clear operation.

Definition at line 71 of file NCloudEvent.cxx.

References fData, fDataContentType, fId, fIsValid, fSource, fSpecVersion, and fType.

Referenced by HandleNCloudEventRequest().

◆ GetData()

std::string Ndmspc::NCloudEvent::GetData ( ) const
inline

Gets the event data payload.

Returns
Data payload string.

Definition at line 96 of file NCloudEvent.h.

References fData.

◆ GetDatacontentType()

std::string Ndmspc::NCloudEvent::GetDatacontentType ( ) const
inline

Gets the event data content type.

Returns
Data content type string.

Definition at line 90 of file NCloudEvent.h.

References fDataContentType.

◆ GetId()

std::string Ndmspc::NCloudEvent::GetId ( ) const
inline

Gets the event identifier.

Returns
Event ID string.

Definition at line 66 of file NCloudEvent.h.

References fId.

◆ GetInfo()

std::string Ndmspc::NCloudEvent::GetInfo ( ) const

Gets additional event information.

Returns
Info string.

Definition at line 64 of file NCloudEvent.cxx.

References fData, fDataContentType, fId, fSource, fSpecVersion, and fType.

Referenced by Print().

◆ GetSource()

std::string Ndmspc::NCloudEvent::GetSource ( ) const
inline

Gets the event source URI.

Returns
Source URI string.

Definition at line 72 of file NCloudEvent.h.

References fSource.

◆ GetSpecVersion()

std::string Ndmspc::NCloudEvent::GetSpecVersion ( ) const
inline

Gets the CloudEvent specification version.

Returns
Specification version string.

Definition at line 78 of file NCloudEvent.h.

References fSpecVersion.

◆ GetType()

std::string Ndmspc::NCloudEvent::GetType ( ) const
inline

Gets the event type.

Returns
Event type string.

Definition at line 84 of file NCloudEvent.h.

References fType.

◆ HandleNCloudEventRequest()

void Ndmspc::NCloudEvent::HandleNCloudEventRequest ( THttpCallArg *  arg)

Handles an HTTP request for a CloudEvent.

Parameters
argPointer 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().

◆ IsValid()

bool Ndmspc::NCloudEvent::IsValid ( ) const
inline

Checks if the event is valid.

Returns
True if valid, false otherwise.

Definition at line 60 of file NCloudEvent.h.

References fIsValid.

◆ Print()

void Ndmspc::NCloudEvent::Print ( Option_t *  opt = "") const
virtual

Prints the event details.

Parameters
optOptional parameter for print operation.

Definition at line 81 of file NCloudEvent.cxx.

References GetInfo().

◆ SetData()

void Ndmspc::NCloudEvent::SetData ( std::string  data)
inline

Sets the event data payload.

Parameters
dataData payload string.

Definition at line 144 of file NCloudEvent.h.

References fData.

◆ SetDatacontentType()

void Ndmspc::NCloudEvent::SetDatacontentType ( std::string  datacontenttype)
inline

Sets the event data content type.

Parameters
datacontenttypeData content type string.

Definition at line 132 of file NCloudEvent.h.

References fDataContentType.

◆ SetId()

void Ndmspc::NCloudEvent::SetId ( std::string  id)
inline

Sets the event identifier.

Parameters
idEvent ID string.

Definition at line 114 of file NCloudEvent.h.

References fId.

◆ SetSource()

void Ndmspc::NCloudEvent::SetSource ( std::string  source)
inline

Sets the event source URI.

Parameters
sourceSource URI string.

Definition at line 120 of file NCloudEvent.h.

References fSource.

◆ SetSpecVersion()

void Ndmspc::NCloudEvent::SetSpecVersion ( std::string  specVersion)
inline

Sets the CloudEvent specification version.

Parameters
specVersionSpecification version string.

Definition at line 126 of file NCloudEvent.h.

References fSpecVersion.

◆ SetType()

void Ndmspc::NCloudEvent::SetType ( std::string  type)
inline

Sets the event type.

Parameters
typeEvent type string.

Definition at line 138 of file NCloudEvent.h.

References fType.


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