Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / math / vector4.h
index 0fc8d85..a42c55a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_VECTOR_4_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.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -41,7 +42,7 @@ struct Vector3;
  * Components can be used as position or offset (x,y,z,w); color (r,g,b,a) or texture coords(s,t,p,q).
  * @SINCE_1_0.0
  */
-struct DALI_IMPORT_API Vector4
+struct DALI_CORE_API Vector4
 {
 // NOTE
 // xrs, ygt, zbp and waq must be consecutive in memory.
@@ -388,7 +389,7 @@ struct DALI_IMPORT_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
@@ -403,7 +404,7 @@ struct DALI_IMPORT_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
@@ -569,7 +570,7 @@ struct DALI_IMPORT_API Vector4
  * @param[in] vector The vector to print
  * @return The output stream operator
  */
-DALI_IMPORT_API std::ostream& operator<<(std::ostream& o, const Vector4& vector);
+DALI_CORE_API std::ostream& operator<<(std::ostream& o, const Vector4& vector);
 
 /**
  * @brief Returns a vector with components set to the minimum of the corresponding component in a and b.
@@ -614,7 +615,7 @@ inline Vector4 Max( const Vector4& a, const Vector4& b )
  * @param[in] max The maximum value
  * @return A vector containing the clamped components of v
  */
-DALI_IMPORT_API Vector4 Clamp( const Vector4& v, const float& min, const float& max );
+DALI_CORE_API Vector4 Clamp( const Vector4& v, const float& min, const float& max );
 
 // Allow Vector4 to be treated as a POD type
 template <> struct TypeTraits< Vector4 > : public BasicTypes< Vector4 > { enum { IS_TRIVIAL_TYPE = true }; };