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

Value holds a value among various types at a time. More...

Classes

class  ComparisonHelper
 A helper class to avoid obscure comparisons of values which are supported by RCSResourceAttributes::Value caused by implicitly converting a value to a RCSResourceAttributes::Value. More...
 

Public Member Functions

 Value ()
 
 Value (const Value &)
 
 Value (Value &&) BOOST_NOEXCEPT
 
template<typename T , typename = typename enable_if_supported< T >::type>
 Value (T &&value)
 Constructs a Value if T is a supported type. More...
 
 Value (const char *)
 
Valueoperator= (const Value &)
 
Valueoperator= (Value &&)
 
template<typename T , typename = typename enable_if_supported< T >::type>
Valueoperator= (T &&rhs)
 
Valueoperator= (const char *)
 
Valueoperator= (std::nullptr_t)
 
template<typename T >
std::add_lvalue_reference
< const T >::type 
get () const
 Returns the underlying value as T. More...
 
template<typename T >
std::add_lvalue_reference< T >
::type 
get ()
 Returns the underlying value as T. More...
 
Type getType () const
 Returns Type information. More...
 
std::string toString () const
 Returns a string representation. More...
 
void swap (Value &) BOOST_NOEXCEPT
 Exchanges the content of the object by the content of the parameter. More...
 

Related Functions

(Note that these are not member functions.)

bool operator== (const RCSResourceAttributes::Value::ComparisonHelper &, const RCSResourceAttributes::Value::ComparisonHelper &)
 
bool operator!= (const RCSResourceAttributes::Value::ComparisonHelper &, const RCSResourceAttributes::Value::ComparisonHelper &)
 

Detailed Description

Value holds a value among various types at a time.

Type helps identify type information of Value.

Supported types are below

int
double
bool
std::string
RCSByteString
std::vector< int >
std::vector< double >
std::vector< bool >
std::vector< std::string >
std::vector< RCSByteString >
std::vector< RCSResourceAttributes >
std::vector< std::vector< int > >
std::vector< std::vector< std::vector< int > > >
std::vector< std::vector< double > >
std::vector< std::vector< std::vector< double > > >
std::vector< std::vector< bool > >
std::vector< std::vector< std::vector< bool > > >
std::vector< std::vector< std::string > >
std::vector< std::vector< std::vector< std::string > > >
std::vector< std::vector< RCSByteString > >
std::vector< std::vector< std::vector< RCSByteString > > >
std::vector< std::vector< RCSResourceAttributes > >
std::vector< std::vector< std::vector< RCSResourceAttributes > > >
See Also
RCSResourceAttributes
Type
is_supported_type

Constructor & Destructor Documentation

OIC::Service::RCSResourceAttributes::Value::Value ( )
OIC::Service::RCSResourceAttributes::Value::Value ( const Value )
OIC::Service::RCSResourceAttributes::Value::Value ( Value &&  )
template<typename T , typename = typename enable_if_supported< T >::type>
OIC::Service::RCSResourceAttributes::Value::Value ( T &&  value)
inline

Constructs a Value if T is a supported type.


Otherwise it won't compile.

OIC::Service::RCSResourceAttributes::Value::Value ( const char *  )

Member Function Documentation

template<typename T >
std::add_lvalue_reference< const T >::type OIC::Service::RCSResourceAttributes::Value::get ( ) const
inline

Returns the underlying value as T.

Returns
const reference to the underlying value.
Exceptions
BadGetExceptionIf type of the underlying value is not T.
template<typename T >
std::add_lvalue_reference< T >::type OIC::Service::RCSResourceAttributes::Value::get ( )
inline

Returns the underlying value as T.

Returns
reference to the underlying value.
Exceptions
BadGetExceptionIf type of the underlying value is not T.
Type OIC::Service::RCSResourceAttributes::Value::getType ( ) const

Returns Type information.

See Also
Type
Value& OIC::Service::RCSResourceAttributes::Value::operator= ( const Value )
Value& OIC::Service::RCSResourceAttributes::Value::operator= ( Value &&  )
template<typename T , typename = typename enable_if_supported< T >::type>
Value& OIC::Service::RCSResourceAttributes::Value::operator= ( T &&  rhs)
inline
Value& OIC::Service::RCSResourceAttributes::Value::operator= ( const char *  )
Value& OIC::Service::RCSResourceAttributes::Value::operator= ( std::nullptr_t  )
void OIC::Service::RCSResourceAttributes::Value::swap ( Value )

Exchanges the content of the object by the content of the parameter.

std::string OIC::Service::RCSResourceAttributes::Value::toString ( ) const

Returns a string representation.

Friends And Related Function Documentation

Checks if the contents are not equal, that is, whether types are not matched or underlying values are not equal.

Returns
true if the contents are not equal, false otherwise.

Checks if the contents are equal, that is, whether types are matched and underlying values are equal.

Returns
true if the contents are equal, false otherwise.

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