Resolve the "Klocwork" detected defect and add debug feature.
[platform/framework/native/appfw.git] / inc / FBaseColMultiHashMapT.h
index b0d26ab..037a2bb 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -34,7 +33,6 @@
 #include <FBaseComparerT.h>
 #include <FBaseFloat.h>
 
-
 namespace Tizen { namespace Base { namespace Collection
 {
 
@@ -70,7 +68,7 @@ template< class ValueType > class __ValueNodeT;
  *     void
  *     MyClass::MultiHashMapTSample(void)
  *     {
- *             MultiHashMapT<int, int> map;
+ *             MultiHashMapT< int, int > map;
  *
  *             // Constructs a MultiHashMap instance with default capacity, load factor, hash code provider, and comparer
  *             map.Construct();
@@ -85,7 +83,7 @@ template< class ValueType > class __ValueNodeT;
  *
  *             // Gets values with the specified key
  *             key = 1;
- *             IEnumeratorT<int>*      pValueEnum = map.GetValuesN(key);
+ *             IEnumeratorT< int >*    pValueEnum = map.GetValuesN(key);
  *             while (pValueEnum->MoveNext() == E_SUCCESS)
  *             {
  *                     pValueEnum->GetCurrent(value);
@@ -98,7 +96,7 @@ template< class ValueType > class __ValueNodeT;
  *             map.Remove(key);                // 30, 3000 removed
  *
  *             // Uses an enumerator to access elements in the map
- *             IMapEnumeratorT<int, int>*      pMapEnum = map.GetMapEnumeratorN();
+ *             IMapEnumeratorT< int, int >*    pMapEnum = map.GetMapEnumeratorN();
  *             while (pMapEnum->MoveNext() == E_SUCCESS)
  *             {
  *                     pMapEnum->GetKey(key);
@@ -166,7 +164,7 @@ public:
         * @param[in]   loadFactor      The maximum ratio of elements to buckets
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_INVALID_ARG   A specified input parameter is invalid, or
-        *                                                                the specified @c capacity or the @c loadFactor is negative.
+        *                                                              the specified @c capacity or the @c loadFactor is negative.
         * @remarks             The key type must be a primitive data type.
         * @see                 MultiHashMapT()
         */
@@ -294,10 +292,10 @@ CATCH:
         *                                                      If it is @c 0, the default load factor(0.75) is used.
         * @param[in]   provider        An instance of the IHashCodeProvider derived class that supplies the hash codes
         *                                                      for all keys in this map
-        * @param[in]   comparer        An instance of the IComparer derived class to use when comparing keys
+        * @param[in]   comparer                An instance of the IComparer derived class to use when comparing keys
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_INVALID_ARG   A specified input parameter is invalid, or
-        *                                                                the specified @c capacity or the @c loadFactor is negative.
+        *                                                              the specified @c capacity or the @c loadFactor is negative.
         * @remarks             The instances of hash code provider and comparer will not be deallocated later from this map.
         * @see                 MultiHashMapT()
         */
@@ -553,7 +551,7 @@ CATCH:
         *
         * @return              An enumerator (an instance of the IEnumeratorT derived class) of the values associated with the specified key, @n
         *                              else @c null if an exception occurs
-        * @param[in]   key     A key to locate
+        * @param[in]   key                                     A key to locate
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_ARG           A specified input parameter is invalid, or
         *                                                                      the comparer has failed to compare the keys.
@@ -598,16 +596,15 @@ CATCH:
        }
 
        /**
-        * Gets a list of all the keys in this map.
+        * Gets a list of all unique keys in this map.
         *
         * @since 2.0
         *
-        * @return              A list of all the keys in this map, @n
+        * @return              A list of all unique keys in this map, @n
         *                              else @c null if an exception occurs
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_OUT_OF_MEMORY The memory is insufficient.
-        * @remarks             The order of the keys is the same as the corresponding values in the IListT interface returned by the GetValuesN() method.
-        *                      The specific error code can be accessed using the GetLastResult() method.
+        * @remarks             The specific error code can be accessed using the GetLastResult() method.
         * @see                 GetValuesN()
         */
        virtual IListT< KeyType >* GetKeysN(void) const
@@ -689,7 +686,7 @@ CATCH:
         * @since 2.0
         *
         * @return              An error code
-        * @param[in]   key The key to remove
+        * @param[in]   key                             The key to remove
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_ARG           The specified input parameter is invalid, or
         *                                                                      the comparer has failed to compare the keys.
@@ -751,7 +748,7 @@ CATCH:
         * @since 2.0
         *
         * @return              An error code
-        * @param[in]   key The key whose mapping is to remove from the map
+        * @param[in]   key     The key whose mapping is to remove from the map
         * @param[in]   value   The value to remove
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_ARG           A specified input parameter is invalid, or
@@ -850,10 +847,10 @@ CATCH:
         * @param[in]   key                     A key
         * @param[in]   value           A value to replace
         * @param[in]   newValue        A new value to replace the existing value
-        * @exception   E_SUCCESS               The method is successful.
+        * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_ARG           A specified input parameter is invalid, or
         *                                                                      the comparer has failed to compare the keys.
-        * @exception   E_OBJ_NOT_FOUND   The specified @c key and @c value pair is not found in the map.
+        * @exception   E_OBJ_NOT_FOUND         The specified @c key and @c value pair is not found in the map.
         * @remarks             To add a new key-value pair, use the Add() method.
         * @see                 Add()
         * @see                 GetValuesN()
@@ -928,9 +925,9 @@ CATCH:
         * @since 2.0
         *
         * @return              An error code
-        * @param[in]   key     A key to locate
+        * @param[in]   key             A key to locate
         * @param[out]  count   The number of values whose key is @c key
-        * @exception   E_SUCCESS                       The method is successful.
+        * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_ARG           A specified input parameter is invalid, or
         *                                                                      the comparer has failed to compare the keys.
         * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found in the map.
@@ -974,8 +971,8 @@ CATCH:
         * @since 2.0
         *
         * @return              An error code
-        * @param[in]   key     The key to locate
-        * @param[in]   value   The value to locate
+        * @param[in]   key     The key to locate
+        * @param[in]   value   The value to locate
         * @param[out]  out             Set to @c true if the map contains the specified key and value pair, @n
         *                                              else @c false
         * @exception   E_SUCCESS                       The method is successful.
@@ -1030,7 +1027,7 @@ CATCH:
         * @since 2.0
         *
         * @return              An error code
-        * @param[in]   key     The key to locate
+        * @param[in]   key     The key to locate
         * @param[out]  out             Set to @c true if the map contains the specified key, @n
         *                                              else @c false
         * @exception   E_SUCCESS                       The method is successful.
@@ -1207,7 +1204,7 @@ private:
         * Copies all the pairs from the specified map to this map.
         *
         * @return              An error code
-        * @param[in]   map The map to copy
+        * @param[in]   map                             The map to copy
         * @exception   E_SUCCESS                       The method is successful.
         * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation. @n
         *                                                                      The @c map is modified during the operation of this method.
@@ -1427,10 +1424,10 @@ public:
         * @since 2.0
         *
         * @param[in]   keyType         A key to include in this entry
-        * @param[in]   list    A list of values whose key is specified @n
-        *                                              It cannot be @c null.
-        * @param[in]   next    A pointer to the next entry
-        * @param[in]   h               An hash value of the key
+        * @param[in]   list            A list of values whose key is specified @n
+        *                                                      It cannot be @c null.
+        * @param[in]   next            A pointer to the next entry
+        * @param[in]   h                       An hash value of the key
         */
        __MultiHashMapEntryT(const KeyType& keyType, __ValueNodeT< ValueType >* list, __MultiHashMapEntryT< KeyType, ValueType >* next, int h)
                : key(keyType)
@@ -1532,13 +1529,13 @@ public:
         * @since 2.0
         *
         * @return              An error code
-        * @param[out]  obj The current object
-        * @exception   E_INVALID_OPERATION       Either of the following conditions has occurred: @n
-        *                                                                      - The current state of the instance prohibits the execution of the specified operation. @n
-        *                                                                      - This enumerator is currently positioned before the first element or
-        *                                                                      past the last element. @n
-        *                                   - The map is modified after this enumerator is created.
-        * @exception   E_SUCCESS                       The method is successful.
+        * @param[out]  obj                                             The current object
+        * @exception   E_INVALID_OPERATION             Either of the following conditions has occurred: @n
+        *                                                                              - The current state of the instance prohibits the execution of the specified operation. @n
+        *                                                                              - This enumerator is currently positioned before the first element or
+        *                                                                              past the last element. @n
+        *                                                                              - The map is modified after this enumerator is created.
+        * @exception   E_SUCCESS                               The method is successful.
         */
        result GetCurrent(MapEntryT< KeyType, ValueType >& obj) const
        {
@@ -1629,13 +1626,13 @@ public:
         * @since 2.0
         *
         * @return              An error code
-        * @param[out]  key The current key
-        * @exception   E_INVALID_OPERATION       Either of the following conditions has occurred: @n
-        *                                                                      - The current state of the instance prohibits the execution of the specified operation. @n
-        *                                                                      - This enumerator is currently positioned before the first element or
-        *                                                                      past the last element. @n
-        *                                                                      -  The map is modified after this enumerator is created.
-        * @exception   E_SUCCESS                       The method is successful.
+        * @param[out]  key                                             The current key
+        * @exception   E_INVALID_OPERATION             Either of the following conditions has occurred: @n
+        *                                                                              - The current state of the instance prohibits the execution of the specified operation. @n
+        *                                                                              - This enumerator is currently positioned before the first element or
+        *                                                                              past the last element. @n
+        *                                                                              -  The map is modified after this enumerator is created.
+        * @exception   E_SUCCESS                               The method is successful.
         */
        result GetKey(KeyType& key) const
        {
@@ -1654,13 +1651,13 @@ public:
         * @since 2.0
         *
         * @return              An error code
-        * @param[out]  value The current value
-        * @exception   E_INVALID_OPERATION       Either of the following conditions has occurred: @n
-        *                                                                      - The current state of the instance prohibits the execution of the specified operation. @n
-        *                                                                      - This enumerator is currently positioned before the first element or
-        *                                                                      past the last element. @n
-        *                                                                      - The map is modified after the enumerator is created.
-        * @exception   E_SUCCESS                       The method is successful.
+        * @param[out]  value                                   The current value
+        * @exception   E_INVALID_OPERATION             Either of the following conditions has occurred: @n
+        *                                                                              - The current state of the instance prohibits the execution of the specified operation. @n
+        *                                                                              - This enumerator is currently positioned before the first element or
+        *                                                                              past the last element. @n
+        *                                                                              - The map is modified after the enumerator is created.
+        * @exception   E_SUCCESS                               The method is successful.
         */
        result GetValue(ValueType& value) const
        {
@@ -1724,7 +1721,7 @@ public:
         * @since 2.0
         *
         * @return              An error code
-        * @param[out]  obj The current value
+        * @param[out]  obj                                     The current value
         * @exception   E_INVALID_OPERATION     Either of the following conditions has occurred: @n
         *                                                                      - The current state of the instance prohibits the execution of the specified operation. @n
         *                                                                      - This enumerator is currently positioned before the first element or