Updating to CAPU v0.14.0

This patch updates the dependency CAPU to version 0.14.0.
Some changes in the Etch container wrapper classes like EtchList are
needed in order to deal with the new const iterators from CAPU containers.

Change-Id: I81c8055d0628ef645a02d27d2a7c4246d779cb24

git-svn-id: https://svn.apache.org/repos/asf/etch/trunk@1578862 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
index 3de452d..fbe056e 100644
--- a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
+++ b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/vf_cpp.vm
@@ -137,7 +137,7 @@
        return ETCH_EINVAL;
 
      // there should only be a single key, so take the first one
-     EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::Iterator it = value->begin();
+     EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::ConstIterator it = value->begin();
      EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::HashTableEntry entry;
      it.next(&entry);
      EtchField key = entry.key;
diff --git a/binding-cpp/runtime/CMakeLists.txt b/binding-cpp/runtime/CMakeLists.txt
index b4f3df5..0a94792 100644
--- a/binding-cpp/runtime/CMakeLists.txt
+++ b/binding-cpp/runtime/CMakeLists.txt
@@ -50,6 +50,8 @@
 #Build external CAPU project (OS Abstraction)
 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
 find_package(Capu)
+

+include (${CMAKE_TOOLCHAIN_FILE})

 
 # Set definitions

 IF (TARGET_OS STREQUAL "Linux")
diff --git a/binding-cpp/runtime/FindCapu.cmake b/binding-cpp/runtime/FindCapu.cmake
index 92ed1f4..8f83107 100644
--- a/binding-cpp/runtime/FindCapu.cmake
+++ b/binding-cpp/runtime/FindCapu.cmake
@@ -38,7 +38,7 @@
         
         ExternalProject_Add(
             Capu
-            URL https://github.com/bmwcarit/capu/archive/v0.13.0.zip
+            URL https://github.com/bmwcarit/capu/zipball/master/bmwcarit-capu-v0.13.0-34-g0ca0967.zip
             SOURCE_DIR "${CAPU_PROJECT_DIR}"
             BINARY_DIR "${CAPU_CMAKE_BUILD_DIR}"
             INSTALL_DIR "${CAPU_PROJECT_DIR}/deliverable"
diff --git a/binding-cpp/runtime/include/common/EtchHashSet.h b/binding-cpp/runtime/include/common/EtchHashSet.h
index 0b31f5a..cc01d16 100644
--- a/binding-cpp/runtime/include/common/EtchHashSet.h
+++ b/binding-cpp/runtime/include/common/EtchHashSet.h
@@ -56,13 +56,49 @@
     /**
       * Constructor
       */
-    EtchHashSetIterator(typename capu::HashSet<T, C, H>::Iterator mBeginCapuIterator, typename capu::HashSet<T, C, H>::Iterator mEndCapuIterator);
+    EtchHashSetIterator(typename capu::HashSet<T, C, H>::Iterator beginCapuIterator, typename capu::HashSet<T, C, H>::Iterator endCapuIterator);
     typename capu::HashSet<T, C, H>::Iterator mBeginCapuIterator;
     typename capu::HashSet<T, C, H>::Iterator mEndCapuIterator;
       
 
   };
+
+  class EtchHashSetConstIterator {
+  public:
+      friend class EtchHashSet;
+
+      /**
+      * destructor
+      */
+      ~EtchHashSetConstIterator();
+
+      /**
+      * Check if iterator has next element.
+      * @return false if the next of current node that is pointed, is null otherwise true
+      */
+      capu::bool_t hasNext();
+
+      /**
+      * Shifts the iterator to the next position and returns the element if next != NULL
+      * @param element
+      * @return CAPU_OK if the next element has been gotten
+      *
+      */
+      status_t next(T *element = 0);
+
+
+  private:
+    /**
+      * Constructor
+      */
+    EtchHashSetConstIterator(typename capu::HashSet<T, C, H>::Iterator beginCapuIterator, typename capu::HashSet<T, C, H>::Iterator endCapuIterator);
+    typename capu::HashSet<T, C, H>::ConstIterator mBeginCapuConstIterator;
+    typename capu::HashSet<T, C, H>::ConstIterator mEndCapuConstIterator;
+      
+
+  };
   typedef typename EtchHashSet<T, C, H>::EtchHashSetIterator Iterator;
+  typedef typename EtchHashSet<T, C, H>::EtchHashSetConstIterator ConstIterator;
 
   /**
    * EtchObjectType for EtchHashSet.
@@ -127,10 +163,16 @@
   inline status_t clear();
 
   /**
+   * Return const iterator for iterating key value tuples.
+   * @return Iterator
+   */
+  inline ConstIterator begin() const;
+
+  /**
    * Return iterator for iterating key value tuples.
    * @return Iterator
    */
-  inline Iterator begin() const;
+  inline Iterator begin();
 
 private:
 
@@ -187,11 +229,17 @@
 }
 
 template <class T, class C, class H>
-inline typename EtchHashSet<T, C, H>::Iterator EtchHashSet<T, C, H>::begin() const{
-  EtchHashSetIterator it(mHashSet.begin(),mHashSet.end());
+inline typename EtchHashSet<T, C, H>::ConstIterator EtchHashSet<T, C, H>::begin() const{
+  EtchHashSetConstIterator it(mHashSet.begin(),mHashSet.end());
   return it;
 }
 
+template <class T, class C, class H>
+inline typename EtchHashSet<T, C, H>::Iterator EtchHashSet<T, C, H>::begin(){
+	EtchHashSetIterator it(mHashSet.begin(),mHashSet.end());
+	return it;
+}
+
 template<class T, class C, class H>
 EtchHashSet<T, C, H>::EtchHashSetIterator::EtchHashSetIterator(typename capu::HashSet<T, C, H>::Iterator beginCapuIterator, typename capu::HashSet<T, C, H>::Iterator endCapuIterator) :
   mBeginCapuIterator(beginCapuIterator), mEndCapuIterator(endCapuIterator) { 
@@ -199,16 +247,33 @@
 }
 
 template<class T, class C, class H>
+EtchHashSet<T, C, H>::EtchHashSetConstIterator::EtchHashSetConstIterator(typename capu::HashSet<T, C, H>::Iterator beginCapuConstIterator, typename capu::HashSet<T, C, H>::Iterator endCapuConstIterator) :
+	mBeginCapuConstIterator(beginCapuConstIterator), mEndCapuConstIterator(endCapuConstIterator) { 
+
+}
+
+template<class T, class C, class H>
 EtchHashSet<T, C, H>::EtchHashSetIterator::~EtchHashSetIterator() { 
 
 }
 
 template<class T, class C, class H>
+EtchHashSet<T, C, H>::EtchHashSetConstIterator::~EtchHashSetConstIterator() { 
+
+}
+
+template<class T, class C, class H>
 capu::bool_t EtchHashSet<T, C, H>::EtchHashSetIterator::hasNext() { 
   return mBeginCapuIterator != mEndCapuIterator;
 }
 
 template<class T, class C, class H>
+capu::bool_t EtchHashSet<T, C, H>::EtchHashSetConstIterator::hasNext() { 
+	return mBeginCapuConstIterator != mEndCapuConstIterator;
+}
+
+
+template<class T, class C, class H>
 status_t EtchHashSet<T, C, H>::EtchHashSetIterator::next(T *element) { 
   if (!hasNext()) {
     return ETCH_ERANGE;
@@ -222,6 +287,20 @@
   return ETCH_OK;
 }
 
+template<class T, class C, class H>
+status_t EtchHashSet<T, C, H>::EtchHashSetConstIterator::next(T *element) { 
+	if (!hasNext()) {
+		return ETCH_ERANGE;
+	}
+
+	if (element != NULL) {
+		*element = *mBeginCapuConstIterator;
+	}
+	mBeginCapuConstIterator++;
+
+	return ETCH_OK;
+}
+
 typedef capu::SmartPointer<EtchHashSet<EtchObjectPtr> > EtchHashSetPtr;
 
 #endif /* ETCHSET_H */
diff --git a/binding-cpp/runtime/include/common/EtchHashTable.h b/binding-cpp/runtime/include/common/EtchHashTable.h
index 05f7446..63ba27c 100644
--- a/binding-cpp/runtime/include/common/EtchHashTable.h
+++ b/binding-cpp/runtime/include/common/EtchHashTable.h
@@ -57,13 +57,49 @@
     /**
       * Constructor
       */
-    EtchHashTableIterator(typename capu::HashTable<Key, T, C, H>::Iterator mBeginCapuIterator, typename capu::HashTable<Key, T, C, H>::Iterator mEndCapuIterator);
+    EtchHashTableIterator(typename capu::HashTable<Key, T, C, H>::Iterator mBeginCapuIterator, typename capu::HashTable<Key, T, C, H>::Iterator endCapuIterator);
     typename capu::HashTable<Key, T, C, H>::Iterator mBeginCapuIterator;
     typename capu::HashTable<Key, T, C, H>::Iterator mEndCapuIterator;
       
 
   };
+
+  class EtchHashTableConstIterator {
+  public:
+      friend class EtchHashTable;
+
+      /**
+      * destructor
+      */
+      ~EtchHashTableConstIterator();
+
+      /**
+      * Check if iterator has next element.
+      * @return false if the next of current node that is pointed, is null otherwise true
+      */
+      capu::bool_t hasNext();
+
+      /**
+      * Shifts the iterator to the next position and returns the element if next != NULL
+      * @param element
+      * @return CAPU_OK if the next element has been gotten
+      *
+      */
+      status_t next(HashTableEntry *element = 0);
+
+  private:
+    /**
+      * Constructor
+      */
+    EtchHashTableConstIterator(typename capu::HashTable<Key, T, C, H>::ConstIterator mBeginCapuConstIterator, typename capu::HashTable<Key, T, C, H>::ConstIterator endCapuConstIterator);
+    typename capu::HashTable<Key, T, C, H>::ConstIterator mBeginCapuConstIterator;
+    typename capu::HashTable<Key, T, C, H>::ConstIterator mEndCapuConstIterator;
+      
+
+  };
+
   typedef typename EtchHashTable<Key, T, C, H>::EtchHashTableIterator Iterator;
+  typedef typename EtchHashTable<Key, T, C, H>::EtchHashTableConstIterator ConstIterator;
   
 
   /**
@@ -143,9 +179,16 @@
 
   /**
    * Return iterator for iterating key value tuples.
+   * @return Const Iterator
+   */
+  inline ConstIterator begin() const;
+
+
+  /**
+   * Return iterator for iterating key value tuples.
    * @return Iterator
    */
-  inline Iterator begin() const;
+  inline Iterator begin();
 
 
 };
@@ -209,11 +252,17 @@
 }
 
 template <class Key, class T, class C, class H>
-inline typename EtchHashTable<Key, T, C, H>::Iterator EtchHashTable<Key, T, C, H>::begin() const {
-  EtchHashTableIterator it(mHashTable.begin(),mHashTable.end());
+inline typename EtchHashTable<Key, T, C, H>::ConstIterator EtchHashTable<Key, T, C, H>::begin() const {
+  EtchHashTableConstIterator it(mHashTable.begin(),mHashTable.end());
   return it;
 }
 
+template <class Key, class T, class C, class H>
+inline typename EtchHashTable<Key, T, C, H>::Iterator EtchHashTable<Key, T, C, H>::begin() {
+	EtchHashTableIterator it(mHashTable.begin(),mHashTable.end());
+	return it;
+}
+
 template<class Key, class T, class C, class H>
 EtchHashTable<Key, T, C, H>::EtchHashTableIterator::EtchHashTableIterator(typename capu::HashTable<Key, T, C, H>::Iterator beginCapuIterator, typename capu::HashTable<Key, T, C, H>::Iterator endCapuIterator) :
   mBeginCapuIterator(beginCapuIterator), mEndCapuIterator(endCapuIterator) { 
@@ -221,16 +270,32 @@
 }
 
 template<class Key, class T, class C, class H>
+EtchHashTable<Key, T, C, H>::EtchHashTableConstIterator::EtchHashTableConstIterator(typename capu::HashTable<Key, T, C, H>::ConstIterator beginCapuConstIterator, typename capu::HashTable<Key, T, C, H>::ConstIterator endCapuConstIterator) :
+	mBeginCapuConstIterator(beginCapuConstIterator), mEndCapuConstIterator(endCapuConstIterator) { 
+
+}
+
+template<class Key, class T, class C, class H>
 EtchHashTable<Key, T, C, H>::EtchHashTableIterator::~EtchHashTableIterator() { 
 
 }
 
 template<class Key, class T, class C, class H>
+EtchHashTable<Key, T, C, H>::EtchHashTableConstIterator::~EtchHashTableConstIterator() { 
+
+}
+
+template<class Key, class T, class C, class H>
 capu::bool_t EtchHashTable<Key, T, C, H>::EtchHashTableIterator::hasNext() { 
   return mBeginCapuIterator != mEndCapuIterator;
 }
 
 template<class Key, class T, class C, class H>
+capu::bool_t EtchHashTable<Key, T, C, H>::EtchHashTableConstIterator::hasNext() { 
+	return mBeginCapuConstIterator != mEndCapuConstIterator;
+}
+
+template<class Key, class T, class C, class H>
 status_t EtchHashTable<Key, T, C, H>::EtchHashTableIterator::next(HashTableEntry *element) { 
   if (!hasNext()) {
     return ETCH_ERANGE;
@@ -244,6 +309,20 @@
   return ETCH_OK;
 }
 
+template<class Key, class T, class C, class H>
+status_t EtchHashTable<Key, T, C, H>::EtchHashTableConstIterator::next(HashTableEntry *element) { 
+	if (!hasNext()) {
+		return ETCH_ERANGE;
+	}
+
+	if (element != NULL) {
+		*element = *mBeginCapuConstIterator;
+	}
+	mBeginCapuConstIterator++;
+
+	return ETCH_OK;
+}
+
 typedef capu::SmartPointer<EtchHashTable<EtchObjectPtr, EtchObjectPtr> > EtchHashTablePtr;
 
 #endif
diff --git a/binding-cpp/runtime/include/common/EtchList.h b/binding-cpp/runtime/include/common/EtchList.h
index eba6faa..b0679ec 100644
--- a/binding-cpp/runtime/include/common/EtchList.h
+++ b/binding-cpp/runtime/include/common/EtchList.h
@@ -69,13 +69,61 @@
     /**
       * Constructor
       */
-    EtchListIterator(typename capu::List<T, A, C>::Iterator mBeginCapuListIterator, typename capu::List<T, A, C>::Iterator mEndCapuListIterator);
+    EtchListIterator(typename capu::List<T, A, C>::Iterator beginCapuListIterator, typename capu::List<T, A, C>::Iterator endCapuListIterator);
     typename capu::List<T, A, C>::Iterator mBeginCapuListIterator;
-    typename capu::List<T, A, C>::Iterator mEndCapuListIterator;
-      
+    typename capu::List<T, A, C>::Iterator mEndCapuListIterator;      
 
   };
+
+  class EtchListConstIterator {
+  public:
+      friend class EtchList;
+
+      /**
+      * destructor
+      */
+      ~EtchListConstIterator();
+
+      /**
+      * Check if iterator has next element.
+      * @return false if the next of current node that is pointed, is null otherwise true
+      */
+      capu::bool_t hasNext();
+
+      /**
+      * Shifts the iterator to the next position and returns the element if next != NULL
+      * @param element
+      * @return CAPU_OK if the next element has been gotten
+      *
+      */
+      status_t next(T* element = 0);
+
+      /**
+        * Get current iterator element.
+        * @param element
+        * @return ETCH_OK if the current element has been gotten
+        */
+        status_t current(T& element);
+
+      /**
+      * Returns the index of the current element.
+      * @return The index of the current element. If there is no current element, the return value is undefined.
+      */
+      capu::uint32_t currentIndex();
+
+  private:
+    /**
+      * Constructor
+      */
+    EtchListConstIterator(typename capu::List<T, A, C>::ConstIterator beginCapuListConstIterator, typename capu::List<T, A, C>::ConstIterator endCapuListConstIterator);
+    typename capu::List<T, A, C>::ConstIterator mBeginCapuListConstIterator;
+    typename capu::List<T, A, C>::ConstIterator mEndCapuListConstIterator;      
+
+  };
+
+public:
   typedef typename EtchList<T, A, C>::EtchListIterator Iterator;
+  typedef typename EtchList<T, A, C>::EtchListConstIterator ConstIterator;
 
   /**
    * EtchObjectType for EtchList.
@@ -154,7 +202,13 @@
    * returns an iterator pointing to the beginning of list
    * @return iterator
    */
-  Iterator begin() const;
+  Iterator begin();
+
+    /**
+   * returns a const iterator pointing to the beginning of list
+   * @return const iterator
+   */
+  ConstIterator begin() const;
 
   /**
    * finds the index of given element in the link list
@@ -164,7 +218,18 @@
    * @return Iterator to the searched element if the element is found
    *         otherwise Iterator to the end of the list
    */
-  Iterator find(const T &element) const;
+  Iterator find(const T &element);
+
+
+  /**
+   * finds the index of given element in the link list
+   * if you are using an object you need to overload == operator
+   *
+   * @param element the value that will be searched
+   * @return Const Iterator to the searched element if the element is found
+   *         otherwise Iterator to the end of the list
+   */
+  ConstIterator find(const T &element) const;
 
   /**
    *
@@ -228,11 +293,16 @@
 }
 
 template<class T, class A, class C>
-typename EtchList<T, A, C>::Iterator EtchList<T, A, C>::begin() const {
+typename EtchList<T, A, C>::Iterator EtchList<T, A, C>::begin() {
   return EtchListIterator(mList.begin(), mList.end());
 }
 
 template<class T, class A, class C>
+typename EtchList<T, A, C>::ConstIterator EtchList<T, A, C>::begin() const {
+  return EtchListConstIterator(mList.begin(), mList.end());
+}
+
+template<class T, class A, class C>
 status_t EtchList<T, A, C>::clear() {
   mList.clear();
   return ETCH_OK;
@@ -244,11 +314,16 @@
 }
 
 template<class T, class A, class C>
-typename EtchList<T, A, C>::Iterator EtchList<T, A, C>::find(const T &element) const {
+typename EtchList<T, A, C>::Iterator EtchList<T, A, C>::find(const T &element) {
   return EtchListIterator(mList.find(element), mList.end());
 }
 
 template<class T, class A, class C>
+typename EtchList<T, A, C>::ConstIterator EtchList<T, A, C>::find(const T &element) const {
+	return EtchListConstIterator(mList.find(element), mList.end());
+}
+
+template<class T, class A, class C>
 status_t EtchList<T, A, C>::get(capu::int32_t index, T* result) {
   status_t status = ETCH_EINVAL;
   if (result != NULL) {
@@ -280,8 +355,14 @@
 
 
 template<class T, class A, class C>
-EtchList<T, A, C>::EtchListIterator::EtchListIterator(typename capu::List<T, A, C>::Iterator beginCapuListIterator, typename capu::List<T, A, C>::Iterator mEndCapuListIterator) :
-  mBeginCapuListIterator(beginCapuListIterator), mEndCapuListIterator(mEndCapuListIterator) { 
+EtchList<T, A, C>::EtchListIterator::EtchListIterator(typename capu::List<T, A, C>::Iterator beginCapuListIterator, typename capu::List<T, A, C>::Iterator endCapuListIterator) :
+  mBeginCapuListIterator(beginCapuListIterator), mEndCapuListIterator(endCapuListIterator) { 
+
+}
+
+template<class T, class A, class C>
+EtchList<T, A, C>::EtchListConstIterator::EtchListConstIterator(typename capu::List<T, A, C>::ConstIterator beginCapuListConstIterator, typename capu::List<T, A, C>::ConstIterator endCapuListConstIterator) :
+	mBeginCapuListConstIterator(beginCapuListConstIterator), mEndCapuListConstIterator(endCapuListConstIterator) { 
 
 }
 
@@ -291,13 +372,23 @@
 }
 
 template<class T, class A, class C>
+EtchList<T, A, C>::EtchListConstIterator::~EtchListConstIterator() { 
+
+}
+
+template<class T, class A, class C>
 capu::bool_t EtchList<T, A, C>::EtchListIterator::hasNext() { 
   return mBeginCapuListIterator != mEndCapuListIterator;
 }
 
 template<class T, class A, class C>
+capu::bool_t EtchList<T, A, C>::EtchListConstIterator::hasNext() { 
+	return mBeginCapuListConstIterator != mEndCapuListConstIterator;
+}
+
+template<class T, class A, class C>
 status_t EtchList<T, A, C>::EtchListIterator::next(T *element) { 
-  if (mBeginCapuListIterator == mEndCapuListIterator) {
+  if (!hasNext()) {
     return ETCH_ERROR;
   }
   if (element != NULL) {
@@ -308,8 +399,20 @@
 }
 
 template<class T, class A, class C>
+status_t EtchList<T, A, C>::EtchListConstIterator::next(T *element) { 
+	if (!hasNext()) {
+		return ETCH_ERROR;
+	}
+	if (element != NULL) {
+		*element = *mBeginCapuListConstIterator;
+	}
+	mBeginCapuListConstIterator++;
+	return ETCH_OK;
+}
+
+template<class T, class A, class C>
 status_t EtchList<T, A, C>::EtchListIterator::current(T& element) { 
-  if (mBeginCapuListIterator != mEndCapuListIterator) {
+  if (hasNext()) {
     element = *mBeginCapuListIterator;
     return ETCH_OK;
   }
@@ -317,10 +420,24 @@
 }
 
 template<class T, class A, class C>
+status_t EtchList<T, A, C>::EtchListConstIterator::current(T& element) { 
+	if (hasNext()) {
+		element = *mBeginCapuListConstIterator;
+		return ETCH_OK;
+	}
+	return ETCH_ERROR;
+}
+
+template<class T, class A, class C>
 capu::uint32_t EtchList<T, A, C>::EtchListIterator::currentIndex() { 
   return mBeginCapuListIterator.currentIndex();
 }
 
+template<class T, class A, class C>
+capu::uint32_t EtchList<T, A, C>::EtchListConstIterator::currentIndex() { 
+	return mBeginCapuListConstIterator.currentIndex();
+}
+
 typedef capu::SmartPointer<EtchList<EtchObjectPtr> > EtchListPtr;
 
 #endif /* ETCHDOUBLELINKEDLIST_H */
diff --git a/binding-cpp/runtime/include/serialization/EtchStructValue.h b/binding-cpp/runtime/include/serialization/EtchStructValue.h
index 5777750..274a92b 100644
--- a/binding-cpp/runtime/include/serialization/EtchStructValue.h
+++ b/binding-cpp/runtime/include/serialization/EtchStructValue.h
@@ -141,7 +141,7 @@
    */
   EtchLevel getLevel();
 
-  typedef EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::Iterator Iterator;
+  typedef EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::ConstIterator Iterator;
   typedef EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::HashTableEntry HashTableEntry;
 
   /**
diff --git a/binding-cpp/runtime/include/util/EtchLogger.h b/binding-cpp/runtime/include/util/EtchLogger.h
index b093c79..df528e4 100644
--- a/binding-cpp/runtime/include/util/EtchLogger.h
+++ b/binding-cpp/runtime/include/util/EtchLogger.h
@@ -46,16 +46,16 @@
 class EtchLogger: public capu::Logger {
 public:
   EtchLogger(IEtchLogAppender& logAppender) : capu::Logger(logAppender)
-    , mSerializerContext("etch.runtime.messagizer.serializer")
-    , mDeliveryServiceContext("etch.runtime.deliveryservice")
-    , mTransportContext("etch.runtime.transport")
-    , mPacketizerContext("etch.runtime.packetizer")
-    , mMessagizerContext("etch.runtime.messagizer")
-    , mValidatorContext("etch.runtime.messagizer.validator")
-    , mMailboxContext("etch.runtime.mailbox")
-    , mRuntimeContext("etch.runtime")
+    , mSerializerContext(createContext("etch.runtime.messagizer.serializer"))
+    , mDeliveryServiceContext(createContext("etch.runtime.deliveryservice"))
+    , mTransportContext(createContext("etch.runtime.transport"))
+    , mPacketizerContext(createContext("etch.runtime.packetizer"))
+    , mMessagizerContext(createContext("etch.runtime.messagizer"))
+    , mValidatorContext(createContext("etch.runtime.messagizer.validator"))
+    , mMailboxContext(createContext("etch.runtime.mailbox"))
+    , mRuntimeContext(createContext("etch.runtime"))
   {
-
+	  
   }
   EtchLogContext& getSerializerContext() {
     return mSerializerContext;
diff --git a/binding-cpp/runtime/src/main/common/EtchObject.cpp b/binding-cpp/runtime/src/main/common/EtchObject.cpp
index e2002af..451bc00 100644
--- a/binding-cpp/runtime/src/main/common/EtchObject.cpp
+++ b/binding-cpp/runtime/src/main/common/EtchObject.cpp
@@ -41,7 +41,7 @@
 }

 

 capu::bool_t EtchObject::isInstanceOf(const EtchObjectType* type) const {

-  capu::List<const EtchObjectType*>::Iterator iter = mTypes.begin();

+  capu::List<const EtchObjectType*>::ConstIterator iter = mTypes.begin();

   while(iter != mTypes.end()) {
     const EtchObjectType* t = *iter;
     iter++;
diff --git a/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp b/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp
index fd16d45..9af63fd 100644
--- a/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp
+++ b/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp
@@ -260,7 +260,34 @@
   delete h1;
 }
 
-TEST(EtchHashTableIterator, NEXT){
+TEST(EtchHashTableConstIterator, hasNext){
+	EtchString key("key");
+	EtchString key2("key2");
+	EtchInt32 value(5);
+	status_t status = ETCH_OK;
+
+	EtchHashTable<EtchString, EtchInt32>* h1 = new EtchHashTable<EtchString, EtchInt32 > ();
+
+	//create iterator
+	EtchHashTable<EtchString, EtchInt32>::Iterator it = h1->begin();
+	//check hasNext
+	EXPECT_TRUE(it.hasNext() == false);
+
+	// add new keys
+	status = h1->put(key, value);
+	EXPECT_TRUE(status == ETCH_OK);
+
+	//add new value
+	status = h1->put(key2, value);
+	EXPECT_TRUE(status == ETCH_OK);
+
+	it = h1->begin();
+	EXPECT_TRUE(it.hasNext() == true);
+
+	delete h1;
+}
+
+TEST(EtchHashTableIterator, next){
   EtchString key("key");
   EtchString key2("key2");
   EtchInt32 value(5);
diff --git a/binding-cpp/runtime/src/test/common/EtchListTest.cpp b/binding-cpp/runtime/src/test/common/EtchListTest.cpp
index 1aa8a49..25348e6 100644
--- a/binding-cpp/runtime/src/test/common/EtchListTest.cpp
+++ b/binding-cpp/runtime/src/test/common/EtchListTest.cpp
@@ -370,6 +370,57 @@
   delete list;

 }

 

+TEST(EtchListConstIterator, hasNext) {

+

+	EtchList<EtchInt32>* normalList = new EtchList<EtchInt32 > ();

+	

+	EtchInt32 data1;

+	EtchInt32 data2;

+	data1.set(32);

+	data2.set(43);

+

+	const EtchList<EtchInt32>* constList = normalList;

+	EtchList<EtchInt32>::ConstIterator it = constList->begin();

+	EXPECT_FALSE(it.hasNext());

+

+	normalList->add(data1);

+

+	it = constList->begin();

+

+	EXPECT_TRUE(it.hasNext());

+	

+	delete normalList;

+}

+

+TEST(EtchListConstIterator, next) {

+	EtchList<EtchInt32>* normalList = new EtchList<EtchInt32 > ();

+	

+	EtchInt32 data1;

+	EtchInt32 data2;

+	EtchInt32 data3;

+

+	data1.set(32);

+	data2.set(43);

+	normalList->add(data1);

+	normalList->add(data2);

+

+	const EtchList<EtchInt32>* constList = normalList;

+	

+	EtchList<EtchInt32>::ConstIterator it = constList->begin();

+	capu::int32_t cnt = 0;

+

+	while (it.hasNext()) {

+		it.next(&data3);

+		if (cnt == 0)

+			EXPECT_TRUE(data3.get() == data1.get());

+		else

+			EXPECT_TRUE(data3.get() == data2.get());

+		cnt++;

+	}

+

+	delete normalList;

+}

+

 

 TEST(EtchList, copyTest) {
   EtchList<EtchInt32> o1;
diff --git a/binding-cpp/runtime/toolchains/QNX_X86_32.toolchain b/binding-cpp/runtime/toolchains/QNX_X86_32.toolchain
index 112caf0..8ed8b58 100644
--- a/binding-cpp/runtime/toolchains/QNX_X86_32.toolchain
+++ b/binding-cpp/runtime/toolchains/QNX_X86_32.toolchain
@@ -65,13 +65,15 @@
 
 #set c compiler and flags
 SET(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-gcc${HOST_EXECUTABLE_SUFFIX})
-SET(CMAKE_C_FLAGS_DEBUG "-g -march=i486 -D_DEBUG")
-SET(CMAKE_C_FLAGS_RELEASE "-O3 -march=i486 -DNDEBUG")
+SET(CMAKE_C_FLAGS "-march=i486")
+SET(CMAKE_C_FLAGS_DEBUG "{CMAKE_C_FLAGS} -g -D_DEBUG")
+SET(CMAKE_C_FLAGS_RELEASE "{CMAKE_C_FLAGS} -O3 -DNDEBUG")
 
 #set c++ compiler and flags
 SET(CMAKE_CXX_COMPILER "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-g++${HOST_EXECUTABLE_SUFFIX}")
-SET(CMAKE_CXX_FLAGS_DEBUG "-g -march=i486 -D_DEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=i486 -DNDEBUG")
+SET(CMAKE_CXX_FLAGS "-march=i486")
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -D_DEBUG")
+SET(CMAKE_CXX_FLAGS_RELEASE "{CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
 
 #set linker
 SET(CMAKE_LINKER       "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ld${HOST_EXECUTABLE_SUFFIX}"     CACHE PATH "QNX Linker Program")
diff --git a/examples/helloworld/cpp/CMakeLists.txt b/examples/helloworld/cpp/CMakeLists.txt
index 741515a..fa069cf 100644
--- a/examples/helloworld/cpp/CMakeLists.txt
+++ b/examples/helloworld/cpp/CMakeLists.txt
@@ -22,6 +22,8 @@
   INCLUDE ("${CMAKE_SOURCE_DIR}/CMakeLists_local.txt" OPTIONAL)
 ENDIF()
 
+include (${CMAKE_TOOLCHAIN_FILE})
+
 #====================================================================================#
 
 #Etch Home