X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fobject%2Fany.h;h=e3fac2a388b49e568644bc8e680d1fe20daee8af;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hp=121d26668449b6be7efaa7e3e4cda3d61552c9ae;hpb=6264fca88e12b3f64730f1ab7a50f25b95b06b27;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/object/any.h b/dali/public-api/object/any.h index 121d266..e3fac2a 100644 --- a/dali/public-api/object/any.h +++ b/dali/public-api/object/any.h @@ -2,7 +2,7 @@ #define __DALI_ANY_TYPE_H__ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ namespace Dali * Any floatVariable( 4.5f ); * Any strVariable( std::string( "Hello world" ) ); * uintVariable = 1u; - * unsigned int variable = AnyCast< unsigned int >( uintVariable ); + * uint32_t variable = AnyCast< uint32_t >( uintVariable ); * if ( typeid( int ) == uintVariable.GetType() ) * \endcode * @SINCE_1_0.0 @@ -53,13 +53,13 @@ public: * @brief Default constructor. * @SINCE_1_0.0 */ - DALI_IMPORT_API Any(); + DALI_CORE_API Any(); /** * @brief Destructor. Free resources. * @SINCE_1_0.0 */ - DALI_IMPORT_API ~Any(); + DALI_CORE_API ~Any(); /** * @brief Passes Assert message. @@ -67,7 +67,7 @@ public: * @SINCE_1_0.0 * @param[in] assertMessage Assert message to report */ - DALI_IMPORT_API static void AssertAlways( const char* assertMessage ); + DALI_CORE_API static void AssertAlways( const char* assertMessage ); /** * @brief Constructs a Any type with the given value. @@ -144,7 +144,7 @@ public: * @exception DaliException If parameter any is of a different type. * */ - DALI_IMPORT_API Any& operator=( const Any& any ); + DALI_CORE_API Any& operator=( const Any& any ); /** * @brief Gets a value of type Type from container. @@ -165,7 +165,7 @@ public: * @return The std::type_info of the stored value or the type info of the void * type if there is no value stored */ - DALI_IMPORT_API const std::type_info& GetType() const; + DALI_CORE_API const std::type_info& GetType() const; /** * @brief Retrieves the stored value in the Any type. @@ -176,14 +176,11 @@ public: template const Type& Get() const { - if ( NULL == mContainer ) { AssertAlways( "Any::Get(). mContainer is NULL" ); } - - // Check if the value has the same value than the Any type. - if( mContainer->GetType() != typeid( Type ) ) + else if( mContainer->GetType() != typeid( Type ) ) // Check if the value has the same value than the Any type. { AssertAlways( "Any::Get(). Trying to retrieve a value of a different type than the template one." ); }