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

This class represents bundle resource template for Protocol Bridge to be registered in the container and make resource server. More...

Inherits OIC::Service::BundleResource.

Public Member Functions

 ProtocolBridgeResource ()
 Constructor for ProtocolBridgeResource. More...
 
virtual ~ProtocolBridgeResource ()
 Virtual destructor for ProtocolBridgeResource. More...
 
virtual void initAttributes ()=0
 Initialize attributes of the resource. More...
 
virtual RCSResourceAttributes handleGetAttributesRequest (const std::map< std::string, std::string > &queryParams)=0
 This function should be implemented by the according bundle resource and execute the according business logic (e.g., light switch or sensor resource) to retrieve a sensor value. More...
 
virtual void handleSetAttributesRequest (const RCSResourceAttributes &attrs, const std::map< std::string, std::string > &queryParams)=0
 This function should be implemented by the according bundle resource and execute the according business logic (e.g., light switch or sensor resource) and write either on soft sensor values or external bridged devices. More...
 
- Public Member Functions inherited from OIC::Service::BundleResource
 BundleResource ()
 Constructor for BundleResource. More...
 
virtual ~BundleResource ()
 Virtual destructor for BundleResource. More...
 
std::list< std::string > getAttributeNames ()
 Return the list of attribute names of the resource. More...
 
void registerObserver (NotificationReceiver *pNotiReceiver)
 Register notification receiver(resource container) to notify for the changes of attributes. More...
 
const RCSResourceAttributes getAttributes ()
 Return all attributes of the resource. More...
 
void setAttributes (const RCSResourceAttributes &attrs)
 Set attributes of the resource. More...
 
void setAttributes (const RCSResourceAttributes &attrs, bool notify)
 
RCSResourceAttributes::Value getAttribute (const std::string &key)
 Return the value of an attribute. More...
 
void setAttribute (const std::string &key, RCSResourceAttributes::Value &&value, bool notify)
 Sets the value of an attribute. More...
 
void setAttribute (const std::string &key, RCSResourceAttributes::Value &value, bool notify)
 Sets the value of an attribute. More...
 
void setAttribute (const std::string &key, RCSResourceAttributes::Value &&value)
 Sets the value of an attribute. More...
 
void setAttribute (const std::string &key, RCSResourceAttributes::Value &value)
 Sets the value of an attribute. More...
 

Additional Inherited Members

- Public Types inherited from OIC::Service::BundleResource
typedef std::shared_ptr
< BundleResource
Ptr
 
- Public Attributes inherited from OIC::Service::BundleResource
std::string m_bundleId
 
std::string m_name
 
std::string m_uri
 
std::string m_resourceType
 
std::string m_interface
 
std::string m_address
 
std::map< std::string,
std::vector< std::map
< std::string, std::string > > > 
m_mapResourceProperty
 

Detailed Description

This class represents bundle resource template for Protocol Bridge to be registered in the container and make resource server.

Constructor & Destructor Documentation

OIC::Service::ProtocolBridgeResource::ProtocolBridgeResource ( )
inline

Constructor for ProtocolBridgeResource.

virtual OIC::Service::ProtocolBridgeResource::~ProtocolBridgeResource ( )
inlinevirtual

Virtual destructor for ProtocolBridgeResource.

Member Function Documentation

virtual RCSResourceAttributes OIC::Service::ProtocolBridgeResource::handleGetAttributesRequest ( const std::map< std::string, std::string > &  queryParams)
pure virtual

This function should be implemented by the according bundle resource and execute the according business logic (e.g., light switch or sensor resource) to retrieve a sensor value.

If a new sensor value is retrieved, the setAttribute data should be called to update the value. The implementor of the function can decide weather to notify OIC clients about the changed state or not.

Parameters
queryParamsRequest parameters
Returns
Value of all attributes

Implements OIC::Service::BundleResource.

virtual void OIC::Service::ProtocolBridgeResource::handleSetAttributesRequest ( const RCSResourceAttributes attrs,
const std::map< std::string, std::string > &  queryParams 
)
pure virtual

This function should be implemented by the according bundle resource and execute the according business logic (e.g., light switch or sensor resource) and write either on soft sensor values or external bridged devices.

The call of this method could for example trigger a HTTP PUT request on an external APIs. This method is responsible to update the resource internal data and call the setAttribute method.

The implementor of the function can decide weather to notify OIC clients about the changed state or not.

Parameters
attrsAttributes to set
queryParamsRequest parameters
Returns
void

Implements OIC::Service::BundleResource.

virtual void OIC::Service::ProtocolBridgeResource::initAttributes ( )
pure virtual

Initialize attributes of the resource.

Returns
void

Implements OIC::Service::BundleResource.


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