etch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vei...@apache.org
Subject svn commit: r1679578 - in /etch/trunk/binding-cpp/runtime: include/serialization/EtchClass2TypeMap.h include/serialization/EtchTypeMap.h src/main/serialization/EtchClass2TypeMap.cpp src/main/serialization/EtchTypeMap.cpp
Date Fri, 15 May 2015 14:56:58 GMT
Author: veithm
Date: Fri May 15 14:56:58 2015
New Revision: 1679578

URL: http://svn.apache.org/r1679578
Log:
Add functionality to reset the Class2Type and TypeMap

The EtchClass2Type and EtchType maps are initialized by
the value factory at the begin of a life cycle.
In order to allow a second life  cycle this map must
be resetted again. This is triggered by the value factory.

Change-Id: I0064992869def776cbcbbf3166f4d8931a619dd9

Modified:
    etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h
    etch/trunk/binding-cpp/runtime/include/serialization/EtchTypeMap.h
    etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp
    etch/trunk/binding-cpp/runtime/src/main/serialization/EtchTypeMap.cpp

Modified: etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h?rev=1679578&r1=1679577&r2=1679578&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h (original)
+++ etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h Fri May 15 14:56:58
2015
@@ -66,6 +66,11 @@ public:
   void lock();
 
   /**
+   * Resets the map. This removes all entries and unlocks to map.
+   */
+  void reset();
+
+  /**
    * Hashing Functions for the EtchClass2TypeMap
    */
   class Hash {

Modified: etch/trunk/binding-cpp/runtime/include/serialization/EtchTypeMap.h
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/include/serialization/EtchTypeMap.h?rev=1679578&r1=1679577&r2=1679578&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/include/serialization/EtchTypeMap.h (original)
+++ etch/trunk/binding-cpp/runtime/include/serialization/EtchTypeMap.h Fri May 15 14:56:58
2015
@@ -80,6 +80,11 @@ public:
   void lock();
 
   /**
+   * Resets the map. This removes all entries and unlocks to map.
+   */
+  void reset();
+
+  /**
    * @return the number of values in the map.
    */
   capu::int32_t size();

Modified: etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp?rev=1679578&r1=1679577&r2=1679578&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp (original)
+++ etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp Fri May 15
14:56:58 2015
@@ -49,3 +49,8 @@ status_t EtchClass2TypeMap::put(const Et
 void EtchClass2TypeMap::lock() {
   mLocked = true;
 }
+
+void EtchClass2TypeMap::reset() {
+    mLocked = false;
+    mC2T.clear();
+}
\ No newline at end of file

Modified: etch/trunk/binding-cpp/runtime/src/main/serialization/EtchTypeMap.cpp
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchTypeMap.cpp?rev=1679578&r1=1679577&r2=1679578&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/src/main/serialization/EtchTypeMap.cpp (original)
+++ etch/trunk/binding-cpp/runtime/src/main/serialization/EtchTypeMap.cpp Fri May 15 14:56:58
2015
@@ -26,16 +26,7 @@ EtchTypeMap::EtchTypeMap()
 }
 
 EtchTypeMap::~EtchTypeMap() {
-  EtchHashTable<capu::int32_t, EtchType*, EtchComparatorNative, EtchHashNative>::Iterator
it = mById.begin();
-  while (it.hasNext()) {
-    EtchHashTable<capu::int32_t, EtchType*, EtchComparatorNative, EtchHashNative>::HashTableEntry
entry;
-    it.next(&entry);
-    if (entry.value != NULL) {
-      delete entry.value;
-    }
-  }
-  mById.clear();
-  mByName.clear();
+  reset();
 }
 
 status_t EtchTypeMap::add(EtchType *type) {
@@ -61,6 +52,21 @@ void EtchTypeMap::lock() {
   mLocked = true;
 };
 
+void EtchTypeMap::reset() {
+    EtchHashTable<capu::int32_t, EtchType*, EtchComparatorNative, EtchHashNative>::Iterator
it = mById.begin();
+    while (it.hasNext()) {
+        EtchHashTable<capu::int32_t, EtchType*, EtchComparatorNative, EtchHashNative>::HashTableEntry
entry;
+        it.next(&entry);
+        if (entry.value != NULL) {
+            delete entry.value;
+        }
+    }
+    mById.clear();
+    mByName.clear();
+
+    mLocked = false;
+}
+
 capu::int32_t EtchTypeMap::size() {
   return mById.count();
 }



Mime
View raw message