Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
OperationRequest Class Reference

Public Member Functions

 OperationRequest (nByte operationCode, const OperationRequestParameters &parameters=OperationRequestParameters())
 
 ~OperationRequest (void)
 
 OperationRequest (const OperationRequest &toCopy)
 
OperationRequestoperator= (const OperationRequest &toCopy)
 
const Common::Objectoperator[] (unsigned int index) const
 
Common::JString toString (bool withParameters=false, bool withParameterTypes=false) const
 
Common::Object getParameterForCode (nByte parameterCode) const
 
nByte getOperationCode (void) const
 
const OperationRequestParametersgetParameters (void) const
 
OperationRequestParametersgetParameters (void)
 
void setParameters (const OperationRequestParameters &parameters)
 

Detailed Description

This is a container for an Operation request, which consists of a code and parameters.

Constructor & Destructor Documentation

◆ OperationRequest() [1/2]

OperationRequest ( nByte  operationCode,
const OperationRequestParameters parameters = OperationRequestParameters() 
)

Constructor: Creates a new instance with the specified parameters.

Parameters
operationCodeidentifies the type of the operation.
parametersthe payload of the operation.

◆ ~OperationRequest()

~OperationRequest ( void  )

Destructor.

◆ OperationRequest() [2/2]

OperationRequest ( const OperationRequest toCopy)

Copy-Constructor: Creates a new instance that is a deep copy of the argument instance.

Parameters
toCopyThe instance to copy.

Member Function Documentation

◆ operator=()

OperationRequest & operator= ( const OperationRequest toCopy)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator[]()

const Object & operator[] ( unsigned int  index) const

operator[]. Accesses the value at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes.

◆ toString()

JString toString ( bool  withParameters = false,
bool  withParameterTypes = false 
) const
Parameters
withParametersdetermines if the payload of the event should be included in the returned string
withParameterTypesdetermines if the type information should be included for the payload
Returns
a JString representation of the instance for debugging purposes.

◆ getParameterForCode()

Object getParameterForCode ( nByte  parameterCode) const

Alternative access to the Parameters.

Parameters
parameterCodeThe key code of an event value
Returns
The parameters value, or an empty Object instance if the key does not exist in the parameters.

◆ getOperationCode()

nByte getOperationCode ( void  ) const
Returns
the operation code that identifies the type of the operation request.

◆ getParameters() [1/2]

const OperationRequestParameters & getParameters ( void  ) const
Returns
a read only reference to all parameters of the operation request.

◆ getParameters() [2/2]

OperationRequestParameters & getParameters ( void  )
Returns
a mutable reference to all parameters of the operation request.

◆ setParameters()

void setParameters ( const OperationRequestParameters parameters)
Parameters
parametersSets the payload of the operation.