IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OC::OCRepresentation Class Reference

Classes

class  AttributeItem
 
class  const_iterator
 
class  iterator
 

Public Member Functions

 OCRepresentation ()
 
virtual ~OCRepresentation ()
 
void setDevAddr (const OCDevAddr &)
 
const std::string getHost () const
 
OCRepPayloadgetPayload () const
 
void addChild (const OCRepresentation &)
 
void clearChildren ()
 
const std::vector
< OCRepresentation > & 
getChildren () const
 
void setChildren (const std::vector< OCRepresentation > &children)
 
void setUri (const char *uri)
 
void setUri (const std::string &uri)
 
std::string getUri () const
 
const std::vector< std::string > & getResourceTypes () const
 
const std::vector< std::string > & getDataModelVersions () const
 
void setResourceTypes (const std::vector< std::string > &resourceTypes)
 
void addResourceType (const std::string &str)
 
const std::vector< std::string > & getResourceInterfaces () const
 
void setResourceInterfaces (const std::vector< std::string > &resourceInterfaces)
 
void addResourceInterface (const std::string &str)
 
void addDataModelVersion (const std::string &str)
 
bool emptyData () const
 
size_t numberOfAttributes () const
 
bool erase (const std::string &str)
 
template<typename T >
void setValue (const std::string &str, const T &val)
 
template<typename T >
void setValue (const std::string &str, T &&val)
 
const std::map< std::string,
AttributeValue > & 
getValues () const
 
template<typename T >
bool getValue (const std::string &str, T &val) const
 Retrieve the attribute value associated with the supplied name. More...
 
template<typename T >
getValue (const std::string &str) const
 Return the attribute value associated with the supplied name. More...
 
bool getAttributeValue (const std::string &str, AttributeValue &attrValue) const
 Retrieve the attributevalue structure associated with the supplied name. More...
 
std::string getValueToString (const std::string &key) const
 
bool hasAttribute (const std::string &str) const
 
void setNULL (const std::string &str)
 
bool isNULL (const std::string &str) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
size_t size () const
 
bool empty () const
 
AttributeItem operator[] (const std::string &key)
 
const AttributeItem operator[] (const std::string &key) const
 

Friends

class OCResourceResponse
 
class MessageContainer
 
bool operator== (const OC::OCRepresentation &, const OC::OCRepresentation &)
 

Constructor & Destructor Documentation

OC::OCRepresentation::OCRepresentation ( )
inline
virtual OC::OCRepresentation::~OCRepresentation ( )
inlinevirtual

Member Function Documentation

void OC::OCRepresentation::addChild ( const OCRepresentation )
void OC::OCRepresentation::addDataModelVersion ( const std::string &  str)
void OC::OCRepresentation::addResourceInterface ( const std::string &  str)
void OC::OCRepresentation::addResourceType ( const std::string &  str)
iterator OC::OCRepresentation::begin ( )
const_iterator OC::OCRepresentation::begin ( ) const
const_iterator OC::OCRepresentation::cbegin ( ) const
const_iterator OC::OCRepresentation::cend ( ) const
void OC::OCRepresentation::clearChildren ( )
bool OC::OCRepresentation::empty ( ) const
bool OC::OCRepresentation::emptyData ( ) const
iterator OC::OCRepresentation::end ( )
const_iterator OC::OCRepresentation::end ( ) const
bool OC::OCRepresentation::erase ( const std::string &  str)
bool OC::OCRepresentation::getAttributeValue ( const std::string &  str,
AttributeValue &  attrValue 
) const
inline

Retrieve the attributevalue structure associated with the supplied name.

Parameters
strName of the attribute
attrValueAttribute Value structure
Returns
The getAttributeValue method returns true if the attribute was found in the representation. Otherwise it returns false.
const std::vector<OCRepresentation>& OC::OCRepresentation::getChildren ( ) const
const std::vector<std::string>& OC::OCRepresentation::getDataModelVersions ( ) const
const std::string OC::OCRepresentation::getHost ( ) const
OCRepPayload* OC::OCRepresentation::getPayload ( ) const
const std::vector<std::string>& OC::OCRepresentation::getResourceInterfaces ( ) const
const std::vector<std::string>& OC::OCRepresentation::getResourceTypes ( ) const
std::string OC::OCRepresentation::getUri ( ) const
template<typename T >
bool OC::OCRepresentation::getValue ( const std::string &  str,
T &  val 
) const
inline

Retrieve the attribute value associated with the supplied name.

Parameters
strName of the attribute
valValue of the attribute
Returns
The getValue method returns true if the attribute was found in the representation. Otherwise it returns false.
template<typename T >
T OC::OCRepresentation::getValue ( const std::string &  str) const
inline

Return the attribute value associated with the supplied name.

Parameters
strName of the attribute
Returns
When the representation contains the attribute, the the associated value is returned. Otherwise, getValue returns the default contructed value for the type.
const std::map<std::string, AttributeValue>& OC::OCRepresentation::getValues ( ) const
inline
std::string OC::OCRepresentation::getValueToString ( const std::string &  key) const
bool OC::OCRepresentation::hasAttribute ( const std::string &  str) const
bool OC::OCRepresentation::isNULL ( const std::string &  str) const
size_t OC::OCRepresentation::numberOfAttributes ( ) const
AttributeItem OC::OCRepresentation::operator[] ( const std::string &  key)
const AttributeItem OC::OCRepresentation::operator[] ( const std::string &  key) const
void OC::OCRepresentation::setChildren ( const std::vector< OCRepresentation > &  children)
void OC::OCRepresentation::setDevAddr ( const OCDevAddr )
void OC::OCRepresentation::setNULL ( const std::string &  str)
void OC::OCRepresentation::setResourceInterfaces ( const std::vector< std::string > &  resourceInterfaces)
void OC::OCRepresentation::setResourceTypes ( const std::vector< std::string > &  resourceTypes)
void OC::OCRepresentation::setUri ( const char *  uri)
void OC::OCRepresentation::setUri ( const std::string &  uri)
template<typename T >
void OC::OCRepresentation::setValue ( const std::string &  str,
const T &  val 
)
inline
template<typename T >
void OC::OCRepresentation::setValue ( const std::string &  str,
T &&  val 
)
inline
size_t OC::OCRepresentation::size ( ) const

Friends And Related Function Documentation

friend class MessageContainer
friend
friend class OCResourceResponse
friend
bool operator== ( const OC::OCRepresentation ,
const OC::OCRepresentation  
)
friend

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