Tizen Native API
5.5
|
Stores a value of any type. More...
Classes | |
struct | AnyContainerBase |
Base container to hold type for match verification and instance cloning function. More... | |
class | AnyContainerImpl |
Templated class to hold value for type. More... | |
struct | AnyContainerImplCloner |
Templated Clone function from container base. More... | |
struct | AnyContainerImplDelete |
Templated Delete function from container base. More... | |
Public Member Functions | |
DALI_CORE_API | Any () |
Default constructor. | |
DALI_CORE_API | ~Any () |
Destructor. Free resources. | |
template<typename Type > | |
Any (const Type &value) | |
Constructs a Any type with the given value. | |
Any (const Any &any) | |
Copy Constructor. | |
template<typename Type > | |
Any & | operator= (const Type &value) |
Assigns a given value to the Any type. | |
DALI_CORE_API Any & | operator= (const Any &any) |
Assignment operator. | |
template<typename Type > | |
void | Get (Type &type) const |
Gets a value of type Type from container. | |
DALI_CORE_API const std::type_info & | GetType () const |
Returns the type info of the stored value. | |
template<typename Type > | |
const Type & | Get () const |
Retrieves the stored value in the Any type. | |
template<typename Type > | |
Type * | GetPointer () |
Returns pointer of Type to the value stored. | |
template<typename Type > | |
const Type * | GetPointer () const |
Returns pointer of Type to the value stored. | |
bool | Empty () const |
Returns whether container holds a value. | |
Static Public Member Functions | |
static DALI_CORE_API void | AssertAlways (const char *assertMessage) |
Passes Assert message. |
Stores a value of any type.
Examples of use:
{.cpp} Any uintVariable = 5u; Any floatVariable( 4.5f ); Any strVariable( std::string( "Hello world" ) ); uintVariable = 1u; uint32_t variable = AnyCast< uint32_t >( uintVariable ); if ( typeid( int ) == uintVariable.GetType() )
DALI_CORE_API Dali::Any::Any | ( | ) |
Default constructor.
DALI_CORE_API Dali::Any::~Any | ( | ) |
Destructor. Free resources.
Dali::Any::Any | ( | const Type & | value | ) |
Constructs a Any type with the given value.
[in] | value | The given value |
Dali::Any::Any | ( | const Any & | any | ) |
static DALI_CORE_API void Dali::Any::AssertAlways | ( | const char * | assertMessage | ) | [static] |
Passes Assert message.
[in] | assertMessage | Assert message to report |
bool Dali::Any::Empty | ( | ) | const |
Returns whether container holds a value.
true
if the container is empty, else false
void Dali::Any::Get | ( | Type & | type | ) | const |
Gets a value of type Type from container.
[in] | type | destination of type Type to write to |
const Type& Dali::Any::Get | ( | ) | const |
Type* Dali::Any::GetPointer | ( | ) |
Returns pointer of Type to the value stored.
const Type* Dali::Any::GetPointer | ( | ) | const |
Returns pointer of Type to the value stored.
DALI_CORE_API const std::type_info& Dali::Any::GetType | ( | ) | const |
Returns the type info of the stored value.
Any& Dali::Any::operator= | ( | const Type & | value | ) |
Assigns a given value to the Any type.
[in] | value | The given value |
Assignment operator.
[in] | any | Any to be assigned which contains a value of identical type to current contents. |
DaliException | If parameter any is of a different type. |