IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OIC::Service::RCSSetResponse Class Reference

This class provides factory methods to create the response for a received set request. More...

Public Types

enum  AcceptanceMethod { AcceptanceMethod::DEFAULT, AcceptanceMethod::ACCEPT, AcceptanceMethod::IGNORE }
 Options for handling a set request. More...
 

Public Member Functions

bool isSeparate () const
 Returns whether it is a separate response. More...
 
AcceptanceMethod getAcceptanceMethod () const
 Returns the acceptance method. More...
 
RCSSetResponsesetAcceptanceMethod (AcceptanceMethod method)
 Sets the acceptance method for the RCSSetResponse. More...
 

Static Public Member Functions

static RCSSetResponse defaultAction ()
 Creates a default RCSSetResponse that has AcceptanceMethod::DEFAULT. More...
 
static RCSSetResponse accept ()
 Creates a default RCSSetResponse that has AcceptanceMethod::ACCEPT. More...
 
static RCSSetResponse accept (int errorCode)
 Creates a RCSSetResponse that has AcceptanceMethod::ACCEPT and error code passed. More...
 
static RCSSetResponse ignore ()
 Creates a default RCSSetResponse that has AcceptanceMethod::IGNORE. More...
 
static RCSSetResponse ignore (int errorCode)
 Creates a RCSSetResponse that has AcceptanceMethod::IGNORE and error code passed. More...
 
static RCSSetResponse create (int errorCode)
 Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT and error code passed. More...
 
static RCSSetResponse create (const RCSResourceAttributes &attrs)
 Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT with custom attributes. More...
 
static RCSSetResponse create (RCSResourceAttributes &&attrs)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static RCSSetResponse create (const RCSResourceAttributes &attrs, int errorCode)
 Creates a RCSSetResponse with error code passed. More...
 
static RCSSetResponse create (RCSResourceAttributes &&attrs, int errorCode)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static RCSSetResponse separate ()
 Creates a RCSSetResponse for a separate response. More...
 

Detailed Description

This class provides factory methods to create the response for a received set request.

The response consists of an error code and result attributes.

AcceptanceMethod provides ways how the request will be handled.

See Also
RCSResourceObject

Member Enumeration Documentation

Options for handling a set request.

This overrides SetRequestHandlerPolicy.

See Also
SetRequestHandlerPolicy
Enumerator
DEFAULT 

Follow SetRequestHandlerPolicy of the RCSResourceObject.

ACCEPT 

Accept the request attributes even if there is an unknown key or mismatched type.

IGNORE 

Ignore the request attributes.

Member Function Documentation

static RCSSetResponse OIC::Service::RCSSetResponse::accept ( )
static

Creates a default RCSSetResponse that has AcceptanceMethod::ACCEPT.

The response will have 200 for the errorCode. The attributes of RCSResourceObject will be set as the result attributes.

See Also
accept(int)
static RCSSetResponse OIC::Service::RCSSetResponse::accept ( int  errorCode)
static

Creates a RCSSetResponse that has AcceptanceMethod::ACCEPT and error code passed.

The attributes of the RCSResourceObject will be set as the result attributes.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
errorCodeThe error code to set in response.
See Also
accept()
static RCSSetResponse OIC::Service::RCSSetResponse::create ( int  errorCode)
static

Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT and error code passed.

The attributes of the RCSResourceObject will be set as the result attributes.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
errorCodeThe error code to set in response.
See Also
create(const RCSResourceAttributes&)
create(RCSResourceAttributes&&)
create(const RCSResourceAttributes&, int)
create(RCSResourceAttributes&&, int)
static RCSSetResponse OIC::Service::RCSSetResponse::create ( const RCSResourceAttributes attrs)
static

Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT with custom attributes.

This sends the passed attributes as the result attributes instead of the one the RCSResourceObject holds.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
attrsThe attributes to set.
See Also
RCSResourceAttributes
create(int)
create(RCSResourceAttributes&&)
create(const RCSResourceAttributes&, int)
create(RCSResourceAttributes&&, int)
static RCSSetResponse OIC::Service::RCSSetResponse::create ( RCSResourceAttributes &&  attrs)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
attrsThe attributes to set.
See Also
RCSResourceAttributes
create(int)
create(const RCSResourceAttributes&)
create(const RCSResourceAttributes&, int)
create(RCSResourceAttributes&&, int)
static RCSSetResponse OIC::Service::RCSSetResponse::create ( const RCSResourceAttributes attrs,
int  errorCode 
)
static

Creates a RCSSetResponse with error code passed.

This sends the passed attributes as the result attributes instead of the one the RCSResourceObject holds.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
attrsThe attributes to set.
errorCodeThe error code for response.
See Also
RCSResourceAttributes
create(int)
create(const RCSResourceAttributes&)
create(RCSResourceAttributes&&)
create(RCSResourceAttributes&&, int)
static RCSSetResponse OIC::Service::RCSSetResponse::create ( RCSResourceAttributes &&  attrs,
int  errorCode 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
attrsThe attributes to set.
errorCodeThe error code for response.
See Also
RCSResourceAttributes
create(int)
create(const RCSResourceAttributes&)
create(RCSResourceAttributes&&)
create(const RCSResourceAttributes&, int)
static RCSSetResponse OIC::Service::RCSSetResponse::defaultAction ( )
static

Creates a default RCSSetResponse that has AcceptanceMethod::DEFAULT.

The response will have 200 for the errorCode. The attributes of RCSResourceObject will be set as the result attributes.

AcceptanceMethod OIC::Service::RCSSetResponse::getAcceptanceMethod ( ) const

Returns the acceptance method.

static RCSSetResponse OIC::Service::RCSSetResponse::ignore ( )
static

Creates a default RCSSetResponse that has AcceptanceMethod::IGNORE.

The response will have 200 for the errorCode. The attributes of RCSResourceObject will be set as the result attributes.

static RCSSetResponse OIC::Service::RCSSetResponse::ignore ( int  errorCode)
static

Creates a RCSSetResponse that has AcceptanceMethod::IGNORE and error code passed.

The attributes of the RCSResourceObject will be set as the result attributes.

Parameters
errorCodeThe error code to set in response.
bool OIC::Service::RCSSetResponse::isSeparate ( ) const

Returns whether it is a separate response.

See Also
separate()
static RCSSetResponse OIC::Service::RCSSetResponse::separate ( )
static

Creates a RCSSetResponse for a separate response.

The separate response is to delay sending actual response to the client.

Note
A separate response needs to be set with RCSSeparateResponse to send the result of the request.
See Also
RCSSeparateResponse
RCSSetResponse& OIC::Service::RCSSetResponse::setAcceptanceMethod ( AcceptanceMethod  method)

Sets the acceptance method for the RCSSetResponse.

Parameters
methodAcceptanceMethod value to set
Returns
The reference to this RCSSetResponse
See Also
AcceptanceMethod

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