You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by ve...@apache.org on 2012/03/01 18:45:37 UTC

svn commit: r1295701 - in /incubator/etch/trunk/binding-cpp/runtime: include/common/ include/util/ lib/capu/modules/capu/include/capu/container/ lib/capu/modules/capu/include/capu/util/ lib/capu/modules/capu/test/container/ src/main/ src/main/common/ s...

Author: veithm
Date: Thu Mar  1 17:45:35 2012
New Revision: 1295701

URL: http://svn.apache.org/viewvc?rev=1295701&view=rev
Log:
ETCH-174 EtchResources Implementation

Updated container interfaces to references

Change-Id: Iade864c2d860febbe9142d8efb8861f026cd7f9b

Added:
    incubator/etch/trunk/binding-cpp/runtime/include/util/EtchResources.h
    incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchResources.cpp
      - copied, changed from r1295697, incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/util/EtchResourcesTest.cpp
Modified:
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparator.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparatorNative.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHash.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Comparator.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Hash.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashSet.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashTable.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Pair.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Traits.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/container/HashTableTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchURL.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt
    incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h Thu Mar  1 17:45:35 2012
@@ -56,12 +56,12 @@ public:
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h Thu Mar  1 17:45:35 2012
@@ -56,12 +56,12 @@ public:
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparator.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparator.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparator.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparator.h Thu Mar  1 17:45:35 2012
@@ -26,7 +26,7 @@ template <class T>
 class EtchComparator {
 public:
 
-  inline capu::bool_t operator() (EtchObject &first, const EtchObject &second) {
+  inline capu::bool_t operator() (const EtchObject &first, const EtchObject &second) {
     return first.equals(&second);
   }
 };
@@ -35,7 +35,7 @@ template <class T>
 class EtchComparator <T*> {
 public:
 
-  inline capu::bool_t operator() (EtchObject* first, EtchObject* second) {
+  inline capu::bool_t operator() (const EtchObject* first, const EtchObject* second) {
     return first->equals(second);
   }
 };

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparatorNative.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparatorNative.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparatorNative.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchComparatorNative.h Thu Mar  1 17:45:35 2012
@@ -21,19 +21,16 @@
 #ifndef __ETCHCOMPARATORNATIVE_H__
 #define __ETCHCOMPARATORNATIVE_H__
 #include "capu/container/Comparator.h"
-#include "capu/util/Traits.h"
 
-template <class T>
 class EtchComparatorNative {
-private:
-  typedef typename capu::ReferenceType<T>::Type Reference;
-
 public:
-  
-  inline capu::bool_t operator() (const Reference first, const Reference second) {
-    capu::Comparator<T> c;
+ 
+  template <class T>
+  inline capu::bool_t operator() (const T &first, const T &second) {
+    capu::Comparator c;
     return c(first, second);
-  }
+  } 
+
 };
 
 #endif

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h Thu Mar  1 17:45:35 2012
@@ -56,12 +56,12 @@ public:
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h Thu Mar  1 17:45:35 2012
@@ -56,12 +56,12 @@ public:
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHash.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHash.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHash.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHash.h Thu Mar  1 17:45:35 2012
@@ -24,12 +24,12 @@
 class EtchHash {
 public:
 
-  static capu::uint64_t Digest(EtchObject &key) {
+  static capu::uint64_t Digest(const EtchObject &key) {
     return key.getHashCode();
   }
 
-  static capu::uint64_t Digest(EtchObject* key) {
-    return key->getHashCode();
+  static capu::uint64_t Digest(const EtchObject* key) {
+   return key->getHashCode();
   }
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h Thu Mar  1 17:45:35 2012
@@ -20,23 +20,27 @@
 #define __ETCHHASHNATIVE_H__
 #include "common/EtchConfig.h"
 #include "capu/container/HashTable.h"
+#include "capu/util/Traits.h"
+
 
-template<class T>
 class EtchHashNative {
 public:
 
+  template<class T>
   static capu::uint64_t Digest(T &key) {
-    return capu::Hash<T>::Digest(key);
+    return capu::Hash::Digest<T>(key);
   }
-};
 
-template<class T>
-class EtchHashNative <T*> {
-public:
+  static capu::uint64_t Digest(char* key) {
+    return capu::Hash::Digest(key);
+  }
 
-  static capu::uint64_t Digest(T* key) {
-    return capu::Hash<T>::Digest(key);
+  static capu::uint64_t Digest(const char* key) {
+    return capu::Hash::Digest(key);
   }
+
+ 
+
 };
 
 #endif

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h Thu Mar  1 17:45:35 2012
@@ -22,7 +22,6 @@
 #include "common/EtchHash.h"
 #include "common/EtchComparator.h"
 #include "capu/container/HashSet.h"
-#include "capu/util/Traits.h"
 #include "common/EtchObject.h"
 
 
@@ -34,7 +33,6 @@ public:
   typedef typename capu::HashSet<T, C, H>::Iterator Iterator;
   static const capu::int32_t TYPE_ID = EOTID_SET;
 
-  typedef typename capu::ReferenceType<T>::Type Reference;
 
   /**
    * Default Constructor
@@ -61,7 +59,7 @@ public:
    *         ETCH_ERROR if value already exists in the set
    *
    */
-  inline status_t put(Reference value);
+  inline status_t put(const T &value);
 
   /**
    * Remove value associated with key in the hashset.
@@ -72,7 +70,7 @@ public:
    *         ETCH_ERANGE if specified value does not exist in hashset
    *
    */
-  inline status_t remove(Reference value);
+  inline status_t remove(const T &value);
 
   /**
    * Returns count of the hashset.
@@ -127,12 +125,12 @@ inline capu::uint64_t EtchHashSet<T, H, 
 }
 
 template <class T, class H, class C>
-inline status_t EtchHashSet<T, H, C>::put(Reference value) {
+inline status_t EtchHashSet<T, H, C>::put(const T &value) {
   return mHashSet.put(value);
 }
 
 template <class T, class H, class C>
-inline status_t EtchHashSet<T, H, C>::remove(Reference value) {
+inline status_t EtchHashSet<T, H, C>::remove(const T &value) {
   return mHashSet.remove(value);
 }
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h Thu Mar  1 17:45:35 2012
@@ -24,15 +24,11 @@
 #include "common/EtchHash.h"
 #include "common/EtchComparator.h"
 #include "capu/container/HashTable.h"
-#include "capu/util/Traits.h"
 
 template <class Key, class T, class H = EtchHash, class C = EtchComparator<Key> >
 class EtchHashTable : public EtchObject {
 
 private:
-  typedef typename capu::ReferenceType<T>::Type ReferenceValue;
-  typedef typename capu::ReferenceType<Key>::Type ReferenceKey;
-
   capu::HashTable<Key, T, C, H> mHashTable;
 
 public:
@@ -65,7 +61,7 @@ public:
    *         ETCH_EINVAL if value_old is null
    *
    */
-  inline status_t put(ReferenceKey key, ReferenceValue value, T* value_old = NULL);
+  inline status_t put(const Key &key, T value, T* value_old = NULL);
 
   /**
    * Get value associated with key in the EtchHashTable.
@@ -77,7 +73,7 @@ public:
    *         ETCH_ENOT_EXIST if there is no existing pair with specified key
    *
    */
-  inline status_t get(ReferenceKey key, T* value);
+  inline status_t get(const Key &key, T* value);
 
   /**
    * Remove value associated with key in the EtchHashTable.
@@ -90,7 +86,7 @@ public:
    *         ETCH_ERANGE if the pair with specified key does not exist in hash table
    *
    */
-  inline status_t remove(ReferenceKey key, T* value_old);
+  inline status_t remove(const Key &key, T* value_old);
 
   /**
    * Returns count of the EtchHashTable.
@@ -131,17 +127,17 @@ inline EtchHashTable<Key, T, H, C>::~Etc
 }
 
 template <class Key, class T, class H, class C>
-inline status_t EtchHashTable<Key, T, H, C>::put(ReferenceKey key, ReferenceValue value, T* value_old) {
+inline status_t EtchHashTable<Key, T, H, C>::put(const Key &key, T value, T* value_old) {
   return mHashTable.put(key, value, value_old);
 }
 
 template <class Key, class T, class H, class C>
-inline status_t EtchHashTable<Key, T, H, C>::get(ReferenceKey key, T* value) {
+inline status_t EtchHashTable<Key, T, H, C>::get(const Key &key, T* value) {
   return mHashTable.get(key, value);
 }
 
 template <class Key, class T, class H, class C>
-inline status_t EtchHashTable<Key, T, H, C>::remove(ReferenceKey key, T* value_old) {
+inline status_t EtchHashTable<Key, T, H, C>::remove(const Key &key, T* value_old) {
   return mHashTable.remove(key, value_old);
 }
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h Thu Mar  1 17:45:35 2012
@@ -55,13 +55,13 @@ public:
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
   /**
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h Thu Mar  1 17:45:35 2012
@@ -22,13 +22,10 @@
 #include "common/EtchObject.h"
 #include "common/EtchComparator.h"
 #include "capu/container/List.h"
-#include "capu/util/Traits.h"
 
 template <class T, class C = EtchComparator<T> >
 class EtchList : public EtchObject {
 private:
-  typedef typename capu::ReferenceType<T>::Type Reference;
-
   capu::List<T, C> mList;
 
 public:
@@ -52,7 +49,7 @@ public:
    * @return ETCH_ENO_MEMORY if allocation of element is failed
    *         ETCH_OK if the element is successfully added
    */
-  status_t add(const Reference element);
+  status_t add(const T &element);
 
   /**
    * It will insert new element to specified position only the element at specified index with given element
@@ -65,7 +62,7 @@ public:
    *         ETCH_OK if the element is successfully added
    *         ETCH_ERROR otherwise
    */
-  status_t add(capu::int32_t index, const Reference element);
+  status_t add(capu::int32_t index, const T &element);
 
   /**
    * remove the element in the specified index and if the element_old
@@ -113,7 +110,7 @@ public:
    * @return -1 if the value either does not exist or given value is NULL
    *          otherwise index of value on linked list
    */
-  capu::int32_t find(const Reference element);
+  capu::int32_t find(const T &element);
 
   /**
    *
@@ -123,7 +120,7 @@ public:
    * @return ETCH_EINVAL if the index is not valid
    *         ETCH_OK otherwise
    */
-  status_t set(capu::int32_t index, const Reference element, T* elementOld = NULL);
+  status_t set(capu::int32_t index, const T &element, T* elementOld = NULL);
 
   /**
    * check that if the list contains the given parameter or not
@@ -132,7 +129,7 @@ public:
    * @return true list contains it
    *         false otherwise
    */
-  capu::bool_t contains(const Reference element);
+  capu::bool_t contains(const T &element);
 
   /**
    * removes all elements from linked list
@@ -156,12 +153,12 @@ EtchList<T, C>::~EtchList() {
 }
 
 template<class T, class C>
-status_t EtchList<T, C>::add(const Reference element) {
+status_t EtchList<T, C>::add(const T &element) {
   return mList.add(element);
 }
 
 template<class T, class C>
-status_t EtchList<T, C>::add(capu::int32_t index, const Reference element) {
+status_t EtchList<T, C>::add(capu::int32_t index, const T &element) {
   return mList.add(index, element);
 }
 
@@ -176,12 +173,12 @@ status_t EtchList<T, C>::clear() {
 }
 
 template<class T, class C>
-capu::bool_t EtchList<T, C>::contains(const Reference element) {
+capu::bool_t EtchList<T, C>::contains(const T &element) {
   return mList.contains(element);
 }
 
 template<class T, class C>
-capu::int32_t EtchList<T, C>::find(const Reference element) {
+capu::int32_t EtchList<T, C>::find(const T &element) {
   return mList.find(element);
 }
 
@@ -206,7 +203,7 @@ capu::int32_t EtchList<T, C>::size() {
 }
 
 template<class T, class C>
-capu::int32_t EtchList<T, C>::set(capu::int32_t index, const Reference element, T* elementOld) {
+capu::int32_t EtchList<T, C>::set(capu::int32_t index, const T &element, T* elementOld) {
   return mList.set(index, element, elementOld);
 }
 #endif /* ETCHDOUBLELINKEDLIST_H */

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h Thu Mar  1 17:45:35 2012
@@ -55,13 +55,13 @@ public:
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
   /**
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h Thu Mar  1 17:45:35 2012
@@ -73,13 +73,13 @@ public:
   /**
    * Returns hash code
    */
-  virtual capu::uint64_t getHashCode();
+  virtual capu::uint64_t getHashCode() const;
 
   /**
    * @return true if two object is equal
    *         false otherwise
    */
-  virtual capu::bool_t equals(const EtchObject * other);
+  virtual capu::bool_t equals(const EtchObject * other) const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h Thu Mar  1 17:45:35 2012
@@ -55,13 +55,13 @@ public:
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
   /**
    * @return true if two object is equal
    *         false otherwise
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
 
 private:
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h Thu Mar  1 17:45:35 2012
@@ -74,7 +74,7 @@ public:
    * Returns the amount of characters in the string.
    * @return amount of characters
    */
-  capu::int32_t length();
+  capu::int32_t length() const;
 
   /**
    * the substring is generated.
@@ -108,7 +108,12 @@ public:
    * @param other
    * @return true if this equals b, false otherwise. takes into account nulls.
    */
-  capu::bool_t equals(const EtchObject * other);
+  capu::bool_t equals(const EtchObject * other) const;
+
+  /**
+   * Returns c styled string.
+   */
+  const char* c_str() const;
 
   /**
    * Returns c styled string.
@@ -133,7 +138,7 @@ public:
   /**
    * Returns hash code
    */
-  capu::uint64_t getHashCode();
+  capu::uint64_t getHashCode() const;
 
 private:
 

Added: incubator/etch/trunk/binding-cpp/runtime/include/util/EtchResources.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/util/EtchResources.h?rev=1295701&view=auto
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/util/EtchResources.h (added)
+++ incubator/etch/trunk/binding-cpp/runtime/include/util/EtchResources.h Thu Mar  1 17:45:35 2012
@@ -0,0 +1,81 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __ETCHRESOURCES_H__
+#define __ETCHRESOURCES_H__
+#include "common/EtchHashTable.h"
+#include "common/EtchObject.h"
+#include "capu/util/SmartPointer.h"
+#include "common/EtchString.h"
+
+
+class EtchResources {
+public:
+
+  /**
+   * Constructs the Resources.
+   */
+  EtchResources();
+
+  /**
+   * Destructor
+   */
+  ~EtchResources();
+
+  /**
+   * Returns true if this Resources has the key.
+   * @param key the string name of a resource.
+   * @return true if this Resources has the key
+   *         false otherwise.
+   */
+  capu::bool_t containsKey(const EtchString& key);
+
+  /**
+   * Returns the named resource from this Resources
+   * @param key the string name of a resource.
+   *
+   * @return a pointer to the object with given key
+   *         if there is no element with given key return a NULL pointer
+   */
+  status_t get(const EtchString& key, EtchObject** result);
+
+  /**
+   * Puts the named resource into this Resources.
+   * @param key the string name of a resource.
+   * @param value the value of the resource.
+   * @return a pointer to the overwritten element
+   *         if there is no existing element with same key returns a NULL pointer
+   */
+  status_t put(const EtchString& key, EtchObject *value, EtchObject** result);
+
+  /**
+   * Removes the named resource from this Resources only.
+   * @param key the string name of a resource.
+   * @return a pointer to the removed element
+   *         if there is no element with given key return a NULL pointer
+   */
+  status_t remove(const EtchString& key, EtchObject** result);
+
+private:
+
+  EtchHashTable <EtchString, EtchObject*> res;
+
+};
+
+#endif /* ETCHRESOURCES_H */
+

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Comparator.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Comparator.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Comparator.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Comparator.h Thu Mar  1 17:45:35 2012
@@ -20,24 +20,21 @@
 #define __COMPARATOR_H__
 
 #include "capu/Config.h"
-#include "capu/util/Traits.h"
 
 namespace capu {
 
-    template <class T>
     class Comparator {
-    private:
-      typedef typename ReferenceType<T>::Type Reference;
-
+  
     public:
-
-        bool_t operator () (const Reference x, const Reference y) const {
+        template <class T>
+        bool_t operator () (const T &x, const T &y) const {
             return x == y;
         }
 
         bool_t operator () (const char* x, const char* y) const {
             return (strcmp(x,y) == 0);
         }
+
     };
 }
 

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Hash.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Hash.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Hash.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Hash.h Thu Mar  1 17:45:35 2012
@@ -24,11 +24,11 @@
 
 namespace capu {
 
-  template <class T>
   class Hash {
   public:
 
-    static uint64_t Digest(T &key) {
+    template <typename T>
+    static uint64_t Digest(const T &key) {
       uint64_t result = 0;
       for (uint64_t i = 0; i < 10; ++i) {
         result = (result + static_cast<uint64_t> (key) * 13);
@@ -47,6 +47,19 @@ namespace capu {
       return result;
     }
 
+    static uint64_t Digest(const char* key) {
+      uint64_t result = 0;
+      const char * keyStart = key;
+      const char * keyEnd = key + strlen(key);
+      while (keyStart != keyEnd) {
+        result = (result + static_cast<uint64_t> (*keyStart) * 13);
+        ++keyStart;
+      }
+      return result;
+    }
+
+    
+
   };
 }
 #endif /* HASH_H */

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashSet.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashSet.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashSet.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashSet.h Thu Mar  1 17:45:35 2012
@@ -22,18 +22,16 @@
 #include "capu/container/Comparator.h"
 #include "capu/container/Hash.h"
 #include "capu/container/List.h"
-#include "capu/util/Traits.h"
 
 #define DEFAULT_HASH_SET_SIZE 1000
 
 
 namespace capu {
 
-  template <class T, class C = Comparator<T>, class H = Hash<T> >
+  template <class T, class C = Comparator, class H = Hash >
   class HashSet {
-  private:
-    typedef typename ReferenceType<T>::Type Reference;
 
+  private:
     class HashSetIterator {
     public:
 
@@ -102,7 +100,7 @@ namespace capu {
      *         CAPU_ERROR if value already exists in the set
      *
      */
-    status_t put(Reference value);
+    status_t put(const T &value);
 
     /**
      * Remove value associated with key in the hash set.
@@ -113,7 +111,7 @@ namespace capu {
      *         CAPU_ERANGE if specified value does not exist in hash set
      *
      */
-    status_t remove(Reference value);
+    status_t remove(const T &value);
 
     /**
      * Returns count of the hash set.
@@ -185,7 +183,7 @@ namespace capu {
   }
 
   template <class T, class C, class H>
-  status_t HashSet< T, C, H>::put(Reference value) {
+  status_t HashSet< T, C, H>::put(const T &value) {
     status_t result;
     uint64_t index = H::Digest(value) % mSize;
     if (mLists[index].isEmpty()) {
@@ -213,7 +211,7 @@ namespace capu {
   }
 
   template <class T, class C, class H>
-  status_t HashSet< T, C, H>::remove(Reference value) {
+  status_t HashSet< T, C, H>::remove(const T &value) {
     status_t result;
     uint64_t index = H::Digest(value) % mSize;
 

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashTable.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashTable.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashTable.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/HashTable.h Thu Mar  1 17:45:35 2012
@@ -24,17 +24,13 @@
 #include "capu/container/List.h"
 #include "capu/container/Pair.h"
 #include "capu/container/Hash.h"
-#include "capu/util/Traits.h"
 
 namespace capu {
 
-  template <class Key, class T, class C = Comparator<Key>, class Hash = Hash<Key> >
+  template <class Key, class T, class C = Comparator, class Hash = Hash >
   class HashTable {
   private:
 
-    typedef typename ReferenceType<T>::Type ReferenceValue;
-    typedef typename ReferenceType<Key>::Type ReferenceKey;
-
     class HashTableIterator {
     public:
 
@@ -104,7 +100,7 @@ namespace capu {
      *         CAPU_EINVAL if value_old is null
      *
      */
-    status_t put(ReferenceKey key, ReferenceValue value, T* value_old = NULL);
+    status_t put(const Key &key, T &value, T* value_old = NULL);
 
     /**
      * Get value associated with key in the hashtable.
@@ -115,7 +111,7 @@ namespace capu {
      *         CAPU_EINVAL if value is null
      *         CAPU_ENOT_EXIST if there is no pair with specified key
      */
-    status_t get(ReferenceKey key, T* value);
+    status_t get(const Key &key, T* value);
 
     /**
      * Remove value associated with key in the hashtable.
@@ -128,7 +124,7 @@ namespace capu {
      *         CAPU_ERANGE if the pair with specified key does not exist in hash table
      *
      */
-    status_t remove(ReferenceKey key, T* value_old);
+    status_t remove(const Key &key, T* value_old);
 
     /**
      * Returns count of the hashtable.
@@ -159,7 +155,7 @@ namespace capu {
      * @return -1 if the key is unique
      *          otherwise the index in the linked list
      */
-    int32_t getKeyIndexFromBucket(uint64_t index, Key &k) {
+    int32_t getKeyIndexFromBucket(uint64_t index, const Key &k) {
       int32_t count = 0;
       typename List<Pair<Key, T> >::Iterator it = mLists[index].begin();
       Pair<Key, T> pair;
@@ -175,7 +171,7 @@ namespace capu {
       return -1;
     }
 
-    List<Pair<Key, T>, Comparator<Pair<Key, T> > > *mLists;
+    List<Pair<Key, T>, Comparator > *mLists;
     uint64_t mSize;
     uint64_t mCount;
 
@@ -185,7 +181,7 @@ namespace capu {
   HashTable<Key, T, C, Hash>::HashTable()
   : mSize(DEFAULT_HASH_TABLE_SIZE)
   , mCount(0) {
-    mLists = new List<Pair<Key, T>, Comparator<Pair<Key, T> > >[(uint32_t) mSize];
+    mLists = new List<Pair<Key, T>, Comparator >[(uint32_t) mSize];
   }
 
   template <class Key, class T, class C, class Hash>
@@ -196,7 +192,7 @@ namespace capu {
     } else {
       mSize = size;
     }
-    mLists = new List<Pair<Key, T>, Comparator<Pair<Key, T> > >[(uint32_t) mSize];
+    mLists = new List<Pair<Key, T>, Comparator >[(uint32_t) mSize];
   }
 
   template <class Key, class T, class C, class Hash>
@@ -205,7 +201,7 @@ namespace capu {
   }
 
   template <class Key, class T, class C, class Hash>
-  status_t HashTable<Key, T, C, Hash>::put(ReferenceKey key, ReferenceValue value, T* value_old) {
+  status_t HashTable<Key, T, C, Hash>::put(const Key &key, T &value, T* value_old) {
     status_t result;
     uint64_t index = Hash::Digest(key) % mSize;
     if (mLists[index].isEmpty()) {
@@ -249,7 +245,7 @@ namespace capu {
   }
 
   template <class Key, class T, class C, class Hash>
-  status_t HashTable<Key, T, C, Hash>::get(ReferenceKey key, T* value) {
+  status_t HashTable<Key, T, C, Hash>::get(const Key &key, T* value) {
     if (value == NULL)
       return CAPU_EINVAL;
 
@@ -272,7 +268,7 @@ namespace capu {
   }
 
   template <class Key, class T, class C, class Hash>
-  status_t HashTable<Key, T, C, Hash>::remove(ReferenceKey key, T* value_old) {
+  status_t HashTable<Key, T, C, Hash>::remove(const Key &key, T* value_old) {
     if (value_old == NULL) {
       return CAPU_EINVAL;
     }

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h Thu Mar  1 17:45:35 2012
@@ -21,15 +21,12 @@
 #include "capu/Error.h"
 #include "capu/Config.h"
 #include "capu/container/Comparator.h"
-#include "capu/util/Traits.h"
 
 namespace capu {
 
-  template <class T, class C = Comparator<T> >
+  template <class T, class C = Comparator >
   class List {
-  private:
-    typedef typename ReferenceType<T>::Type Reference;
-
+  
     class ListNode {
     public:
 
@@ -122,7 +119,7 @@ namespace capu {
      * @return CAPU_ENO_MEMORY if allocation of element is failed
      *         CAPU_OK if the element is successfully added
      */
-    status_t add(const Reference element);
+    status_t add(const T &element);
 
     /**
      * Add element to specified position
@@ -135,7 +132,7 @@ namespace capu {
      *         CAPU_OK if the element is successfully added
      *         CAPU_ERROR otherwise
      */
-    status_t add(int32_t index, const Reference element);
+    status_t add(int32_t index, const T &element);
 
     /**
      * Add element to specified position
@@ -146,7 +143,7 @@ namespace capu {
      * @return CAPU_ENO_MEMORY memory allocation failed.
      *         CAPU_OK otherwise
      */
-    status_t add(Iterator& iter, const Reference element);
+    status_t add(Iterator& iter, const T &element);
 
     /**
      * remove the element in the specified index and if the element_old
@@ -205,7 +202,7 @@ namespace capu {
      * @return -1 if the value either does not exist or given value is NULL
      *          otherwise index of value on linked list
      */
-    int32_t find(const Reference element);
+    int32_t find(const T &element);
 
     /**
      *
@@ -215,7 +212,7 @@ namespace capu {
      * @return CAPU_EINVAL if the index is not valid
      *         CAPU_OK otherwise
      */
-    status_t set(int32_t index, const Reference element, T* elementOld = NULL);
+    status_t set(int32_t index, const T &element, T* elementOld = NULL);
 
     /**
      * check that if the list contains the given parameter or not
@@ -224,7 +221,7 @@ namespace capu {
      * @return true list contains it
      *         false otherwise
      */
-    bool_t contains(const Reference element);
+    bool_t contains(const T &element);
 
     /**
      * removes all elements from linked list
@@ -266,7 +263,7 @@ namespace capu {
   }
 
   template <class T, class C>
-  int32_t List<T, C>::find(const Reference element) {
+  int32_t List<T, C>::find(const T &element) {
     int32_t counter = 0;
     ListNode * cursor = mHead;
     C comparator;
@@ -281,14 +278,14 @@ namespace capu {
   }
 
   template <class T, class C>
-  bool_t List<T, C>::contains(const Reference element) {
+  bool_t List<T, C>::contains(const T &element) {
     return (find(element) != -1);
   }
 
   //add elements to the end of list
 
   template <class T, class C>
-  status_t List<T, C>::add(const Reference element) {
+  status_t List<T, C>::add(const T &element) {
     ListNode *listElem = NULL;
     listElem = new ListNode(element);
     //NOT ALLOCATED
@@ -311,7 +308,7 @@ namespace capu {
   }
 
   template <class T, class C>
-  status_t List<T, C>::add(int32_t index, const Reference element) {
+  status_t List<T, C>::add(int32_t index, const T &element) {
     if ((index > mSize) || (index < 0)) {
       return CAPU_EINVAL;
     }
@@ -368,7 +365,7 @@ namespace capu {
   }
 
   template <class T, class C>
-  status_t List<T, C>::add(Iterator& iter, const Reference element) {
+  status_t List<T, C>::add(Iterator& iter, const T &element) {
     ListNode *listElem = new ListNode(element);
 
     //NOT ALLOCATED
@@ -501,7 +498,7 @@ namespace capu {
   }
 
   template <class T, class C>
-  status_t List<T, C>::set(int32_t index, const Reference element, T* elementOld) {
+  status_t List<T, C>::set(int32_t index, const T &element, T* elementOld) {
     if ((index < 0) || (index >= mSize))
       return CAPU_EINVAL;
 

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Pair.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Pair.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Pair.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/Pair.h Thu Mar  1 17:45:35 2012
@@ -37,7 +37,7 @@ namespace capu {
 
         }
 
-        Pair(T1 _first, T2 _second)
+        Pair(const T1 _first, const T2 _second)
         : first(_first), second(_second) {
 
         }

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Traits.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Traits.h?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Traits.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Traits.h Thu Mar  1 17:45:35 2012
@@ -25,44 +25,45 @@
 
 namespace capu {
 
-  template<typename T>
-  struct ReferenceType { typedef T &Type; };
-
-  template<typename T>
-  struct ReferenceType<T*> { typedef T *Type; };
+#define CAPU_PRIMITIVE 1
+#define CAPU_CLASS     0
 
-  template<>
-  struct ReferenceType<int8_t> { typedef int8_t Type; };
+  //is CAPU_PRIMITIVE
+  template<typename T> struct is_CAPU_PRIMITIVE { enum { Value = CAPU_CLASS }; };
+  template<> struct is_CAPU_PRIMITIVE<int8_t  > { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<int16_t > { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<int32_t > { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<int64_t > { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<uint32_t> { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<uint64_t> { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<float_t > { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<double_t> { enum { Value = CAPU_PRIMITIVE }; };
+  template<> struct is_CAPU_PRIMITIVE<bool_t  > { enum { Value = CAPU_PRIMITIVE }; };
+
+  //References Helper (T &)
+  template<typename T, int TYPE> struct _ReferenceType {};
+  template<typename T> struct _ReferenceType<T, CAPU_CLASS     > { typedef T &Type; };
+  template<typename T> struct _ReferenceType<T, CAPU_PRIMITIVE > { typedef T Type;  };
+  
+  //ConstReferences Helper (const T &)
+  template<typename T, int TYPE> struct _ConstReferenceType {};
+  template<typename T> struct _ConstReferenceType<T, CAPU_CLASS      > { typedef const T &Type; };
+  template<typename T> struct _ConstReferenceType<T, CAPU_PRIMITIVE  > { typedef const T Type;  };
 
-  template<>
-  struct ReferenceType<int16_t> { typedef int16_t Type; };
-  
-  template<>
-  struct ReferenceType<int32_t> { typedef int32_t Type; };
-  
-  template<>
-  struct ReferenceType<int64_t> { typedef int64_t Type; };
-  
-  template<>
-  struct ReferenceType<uint32_t> { typedef uint32_t Type; };
-  
-  template<>
-  struct ReferenceType<uint64_t> { typedef uint64_t Type; };
-  
-  template<>
-  struct ReferenceType<float_t> { typedef float_t Type; };
-  
-  template<>
-  struct ReferenceType<double_t> { typedef double_t Type; };
-  
-  template<>
-  struct ReferenceType<bool_t> { typedef bool_t Type; };
-
-  template<>
-  struct ReferenceType<char*> { typedef char* Type; };
+  //References (T &)
+  template<typename T>
+  struct ReferenceType
+  {
+   typedef typename _ReferenceType<T, is_CAPU_PRIMITIVE<T>::Value >::Type Type;
+  };
+    
+  //ConstReferences (const T &)
+  template<typename T>
+  struct ConstReferenceType
+  {
+   typedef typename _ConstReferenceType<T, is_CAPU_PRIMITIVE<T>::Value >::Type Type;
+  };
 
-  template<>
-  struct ReferenceType<const char*> { typedef const char* Type; };
 }
 
 #endif /* __TRAITS_H__ */
\ No newline at end of file

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/container/HashTableTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/container/HashTableTest.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/container/HashTableTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/container/HashTableTest.cpp Thu Mar  1 17:45:35 2012
@@ -24,6 +24,8 @@ TEST(HashTable, Constructor_Default) {
   //create an empty linked list
   capu::HashTable<capu::int32_t, capu::int32_t>* list = new capu::HashTable<capu::int32_t, capu::int32_t > ();
   delete list;
+  capu::HashTable<char*, capu::int32_t>* list2 = new capu::HashTable<char*, capu::int32_t > ();
+  delete list2;
 }
 
 TEST(HashTable, put) {

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt Thu Mar  1 17:45:35 2012
@@ -43,6 +43,7 @@ SET(MAIN_INCLUDES
     ${PROJECT_SOURCE_DIR}/include/common/EtchSocket.h
     ${PROJECT_SOURCE_DIR}/include/common/EtchServerSocket.h
     ${PROJECT_SOURCE_DIR}/include/util/EtchURL.h
+    ${PROJECT_SOURCE_DIR}/include/util/EtchResources.h
     ${PROJECT_SOURCE_DIR}/include/util/EtchUtil.h
     )
 
@@ -60,6 +61,7 @@ SET(MAIN_SOURCES
     common/EtchSocket.cpp
     common/EtchServerSocket.cpp
     util/EtchURL.cpp
+    util/EtchResources.cpp
     util/EtchUtil.cpp
     )
 
@@ -81,4 +83,4 @@ ENDIF (UNIX)
 
 set_target_properties (etch-cpp PROPERTIES OUTPUT_NAME "etch")
 
-add_dependencies (etch-cpp Capu)
\ No newline at end of file
+add_dependencies (etch-cpp Capu)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp Thu Mar  1 17:45:35 2012
@@ -36,7 +36,7 @@ capu::bool_t EtchBool::get(){
   return mValue;
 }
 
-capu::bool_t EtchBool::equals(const EtchObject * other){
+capu::bool_t EtchBool::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchBool::TYPE_ID)
@@ -45,7 +45,7 @@ capu::bool_t EtchBool::equals(const Etch
   return (a->mValue == this->mValue);
 }
 
-capu::uint64_t EtchBool::getHashCode(){
+capu::uint64_t EtchBool::getHashCode() const{
   if (mValue)
     return 0;
   return 1;

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchByte.cpp Thu Mar  1 17:45:35 2012
@@ -36,7 +36,7 @@ capu::int8_t EtchByte::get(){
   return mValue;
 }
 
-capu::bool_t EtchByte::equals(const EtchObject * other){
+capu::bool_t EtchByte::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchByte::TYPE_ID)
@@ -45,7 +45,7 @@ capu::bool_t EtchByte::equals(const Etch
   return (a->mValue == this->mValue);
 }
 
-capu::uint64_t EtchByte::getHashCode(){
+capu::uint64_t EtchByte::getHashCode() const{
   //For better distribution
   capu::uint64_t result = (capu::uint64_t) ((capu::int64_t) mValue + 128); 
   return result;

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchDouble.cpp Thu Mar  1 17:45:35 2012
@@ -36,13 +36,13 @@ capu::double_t EtchDouble::get(){
   return mValue;
 }
 
-capu::uint64_t EtchDouble::getHashCode(){
+capu::uint64_t EtchDouble::getHashCode() const{
    capu::uint64_t result = 0;
   memcpy(&result, &mValue, sizeof(capu::double_t));
   return result;
 }
 
-capu::bool_t EtchDouble::equals(const EtchObject * other){
+capu::bool_t EtchDouble::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchDouble::TYPE_ID)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchFloat.cpp Thu Mar  1 17:45:35 2012
@@ -36,13 +36,13 @@ capu::float_t EtchFloat::get(){
   return mValue;
 }
 
-capu::uint64_t EtchFloat::getHashCode(){
+capu::uint64_t EtchFloat::getHashCode() const{
   capu::uint64_t result = 0;
   memcpy(&result, &mValue, sizeof(capu::float_t));
   return result;
 }
 
-capu::bool_t EtchFloat::equals(const EtchObject * other){
+capu::bool_t EtchFloat::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchFloat::TYPE_ID)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchInt32.cpp Thu Mar  1 17:45:35 2012
@@ -36,11 +36,11 @@ capu::int32_t EtchInt32::get(){
   return mValue;
 }
 
-capu::uint64_t EtchInt32::getHashCode(){
+capu::uint64_t EtchInt32::getHashCode() const{
   return static_cast <capu::uint64_t> (mValue);
 }
 
-capu::bool_t EtchInt32::equals(const EtchObject * other){
+capu::bool_t EtchInt32::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchInt32::TYPE_ID)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchLong.cpp Thu Mar  1 17:45:35 2012
@@ -36,11 +36,11 @@ capu::int64_t EtchLong::get(){
   return mValue;
 }
 
-capu::uint64_t EtchLong::getHashCode(){
+capu::uint64_t EtchLong::getHashCode() const{
   return static_cast <capu::uint64_t> (mValue);
 }
 
-capu::bool_t EtchLong::equals(const EtchObject * other){
+capu::bool_t EtchLong::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchLong::TYPE_ID)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp Thu Mar  1 17:45:35 2012
@@ -29,11 +29,11 @@ capu::int32_t EtchObject::getObjectTypeI
 EtchObject::~EtchObject(){
 }
 
-capu::uint64_t EtchObject::getHashCode(){
+capu::uint64_t EtchObject::getHashCode() const{
   return (capu::uint64_t) this;
 }
 
-capu::bool_t EtchObject::equals(const EtchObject* other){
+capu::bool_t EtchObject::equals(const EtchObject* other) const{
   return (other == this);
 }
 

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp Thu Mar  1 17:45:35 2012
@@ -36,13 +36,13 @@ capu::int16_t EtchShort::get(){
   return mValue;
 }
 
-capu::uint64_t EtchShort::getHashCode(){
+capu::uint64_t EtchShort::getHashCode() const{
   //for better distribution
   capu::uint64_t result = (capu::uint64_t) ((capu::int64_t) mValue + 32768);
   return result;
 }
 
-capu::bool_t EtchShort::equals(const EtchObject * other){
+capu::bool_t EtchShort::equals(const EtchObject * other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchShort::TYPE_ID)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp Thu Mar  1 17:45:35 2012
@@ -91,15 +91,22 @@ void EtchString::set(const char* string)
   }
 }
 
-capu::int32_t EtchString::length() {
+capu::int32_t EtchString::length() const {
   return strlen(mData);
 }
 
+const char* EtchString::c_str() const{
+  capu::int32_t len = strlen(mData);
+  char* tmp = new char[len + 1];
+  etch_strcpy_s(tmp, len + 1, mData);
+  return tmp;
+}
+
 const char* EtchString::c_str() {
   return mData;
 }
 
-capu::bool_t EtchString::equals(const EtchObject* other) {
+capu::bool_t EtchString::equals(const EtchObject* other) const{
   if (other == NULL)
     return false;
   else if (other->getObjectTypeId() != EtchString::TYPE_ID)
@@ -141,7 +148,7 @@ status_t EtchString::substring(capu::uin
   }
 }
 
-capu::uint64_t EtchString::getHashCode() {
+capu::uint64_t EtchString::getHashCode() const{
   capu::uint64_t result = 0;
   capu::uint32_t len = strlen(mData);
   for (capu::uint32_t i = 0; i < len; i++) {

Copied: incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchResources.cpp (from r1295697, incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp)
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchResources.cpp?p2=incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchResources.cpp&p1=incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp&r1=1295697&r2=1295701&rev=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchBool.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchResources.cpp Thu Mar  1 17:45:35 2012
@@ -16,37 +16,33 @@
  * limitations under the License.
  */
 
-#include "common/EtchBool.h"
+#include "util/EtchResources.h"
 
-EtchBool::EtchBool()
-: EtchObject(EtchBool::TYPE_ID)
-, mValue(false){
-}
+EtchResources::EtchResources() {
 
-EtchBool::EtchBool(capu::bool_t value)
-: EtchObject(EtchBool::TYPE_ID)
-, mValue(value){
 }
 
-void EtchBool::set(capu::bool_t value){
-  mValue = value;
-}
+EtchResources::~EtchResources() {
 
-capu::bool_t EtchBool::get(){
-  return mValue;
 }
 
-capu::bool_t EtchBool::equals(const EtchObject * other){
-  if (other == NULL)
+capu::bool_t EtchResources::containsKey(const EtchString& key) {
+  EtchObject* ptr = NULL;
+  if (res.get(key, &ptr) == ETCH_OK)
+    return true;
+  else
     return false;
-  else if (other->getObjectTypeId() != EtchBool::TYPE_ID)
-    return false;
-  EtchBool* a = (EtchBool *) other;
-  return (a->mValue == this->mValue);
 }
 
-capu::uint64_t EtchBool::getHashCode(){
-  if (mValue)
-    return 0;
-  return 1;
+status_t EtchResources::get(const EtchString& key, EtchObject** result) {
+  return res.get(key, result);
 }
+
+status_t EtchResources::put(const EtchString& key, EtchObject* value, EtchObject** result) {
+  return res.put(key, value, result);
+}
+
+status_t EtchResources::remove(const EtchString& key, EtchObject** result) {
+
+  return res.remove(key, result);
+}
\ No newline at end of file

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchURL.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchURL.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchURL.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/util/EtchURL.cpp Thu Mar  1 17:45:35 2012
@@ -315,9 +315,9 @@ void EtchURL::setScheme(EtchString& sche
 status_t EtchURL::setScheme(EtchString* scheme) {
   if (scheme != NULL) {
     this->scheme.set(scheme->c_str());
-  } else {
-    return ETCH_EINVAL;
+    return ETCH_OK;
   }
+  return ETCH_EINVAL;
 }
 
 EtchString& EtchURL::getUser() {

Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt Thu Mar  1 17:45:35 2012
@@ -42,6 +42,7 @@ add_executable (etch-cpp-test
     common/EtchHashTableTest.cpp
     common/EtchHashSetTest.cpp
     util/EtchURLTest.cpp
+    util/EtchResourcesTest.cpp
     util/EtchUtilTest.cpp
     ${GTEST}/src/gtest-all.cc
     main.cpp

Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashSetTest.cpp Thu Mar  1 17:45:35 2012
@@ -28,7 +28,7 @@ TEST(EtchHashSet, Constructor_Default){
   EtchHashSet<EtchString>* set = new EtchHashSet<EtchString > ();
   delete set;
 
-  EtchHashSet<char*, EtchHashNative<char*>, EtchComparatorNative<char*> >* set2 = new EtchHashSet<char*, EtchHashNative<char*>, EtchComparatorNative<char*> > ();
+  EtchHashSet<char*, EtchHashNative, EtchComparatorNative >* set2 = new EtchHashSet<char*, EtchHashNative, EtchComparatorNative > ();
   delete set2;
 }
 
@@ -51,7 +51,7 @@ TEST(EtchHashSet, put){
   status = h1->put(value2);
   EXPECT_TRUE(status == ETCH_ERROR);
 
-  EtchHashSet<char*, EtchHashNative<char*>, EtchComparatorNative<char*> >* h2 = new EtchHashSet<char*, EtchHashNative<char*>, EtchComparatorNative<char*> > ();
+  EtchHashSet<char*, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashSet<char*, EtchHashNative, EtchComparatorNative > ();
 
   // add new key
   char* value3 = "val1";

Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp?rev=1295701&r1=1295700&r2=1295701&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchHashTableTest.cpp Thu Mar  1 17:45:35 2012
@@ -27,7 +27,7 @@ TEST(EtchHashTableTest, Constructor_Defa
   EtchHashTable<EtchString, EtchInt32>* h1 = new EtchHashTable<EtchString, EtchInt32 > ();
   delete h1;
 
-  EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> >* h2 = new EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> > ();
+  EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative > ();
   delete h2;
 }
 
@@ -45,7 +45,7 @@ TEST(EtchHashTableTest, put){
   count = h1->count();
   EXPECT_TRUE(count == 1);
 
-  EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> >* h2 = new EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> > ();
+  EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative > ();
   // add new key
   char* key1 = "key1";
   int value1 = 5;
@@ -111,7 +111,7 @@ TEST(EtchHashTableTest, get){
   status = h1->get(key2, &return_value);
   EXPECT_TRUE(status == ETCH_ENOT_EXIST);
 
-  EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> >* h2 = new EtchHashTable<char*, int, EtchHashNative<char*>, EtchComparatorNative<char*> > ();
+  EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative >* h2 = new EtchHashTable<char*, int, EtchHashNative, EtchComparatorNative > ();
   // add new key
   char* key1 = "key1";
   int value1 = 5;

Added: incubator/etch/trunk/binding-cpp/runtime/src/test/util/EtchResourcesTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/util/EtchResourcesTest.cpp?rev=1295701&view=auto
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/util/EtchResourcesTest.cpp (added)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/util/EtchResourcesTest.cpp Thu Mar  1 17:45:35 2012
@@ -0,0 +1,112 @@
+/* $Id$
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <gtest/gtest.h>
+#include "util/EtchResources.h"
+#include "common/EtchInt32.h"
+#include "common/EtchFloat.h"
+
+TEST(EtchResources, constructorTest) {
+  EtchResources * res = new EtchResources();
+  EXPECT_TRUE(res != NULL);
+  delete res;
+}
+
+TEST(EtchResources, putTest) {
+  EtchResources * res = new EtchResources();
+  EtchObject* result;
+  EXPECT_TRUE(res != NULL);
+  EtchInt32 value1(12);
+  EtchFloat value2(12.1f);
+  EtchString key1("key1");
+  EtchString key2("key2");
+
+  EXPECT_TRUE(res->put(key1, &value1, &result) == ETCH_OK);
+  EXPECT_TRUE(res->put(key2, &value2, &result) == ETCH_OK);
+
+  res->put(key2, &value1, &result);
+  EXPECT_TRUE(((EtchFloat*) result)->get() == 12.1f);
+  delete res;
+}
+
+TEST(EtchResources, getTest) {
+  EtchResources * res = new EtchResources();
+  EXPECT_TRUE(res != NULL);
+  EtchInt32 value1(12);
+  EtchFloat value2(12.1f);
+  EtchObject* result;
+  EtchString key1("key1");
+  EtchString key2("key2");
+
+  EXPECT_TRUE(res->put(key1, &value1, &result) == ETCH_OK);
+  EXPECT_TRUE(res->put(key2, &value2, &result) == ETCH_OK);
+
+  EtchObject* ptr1;
+  EXPECT_TRUE(res->get(key1, &ptr1) == ETCH_OK);
+  EtchObject* ptr2;
+  EXPECT_TRUE(res->get(key2, &ptr2) == ETCH_OK);
+
+  EXPECT_TRUE(((EtchInt32*) ptr1)->get() == 12);
+  EXPECT_TRUE(((EtchFloat*) ptr2)->get() == 12.1f);
+
+  EXPECT_TRUE(res->put(key2, &value1, &result) == ETCH_OK);
+  EXPECT_TRUE(((EtchFloat*) result)->get() == 12.1f);
+  delete res;
+}
+
+TEST(EtchResources, containsKeyTest) {
+  EtchResources * res = new EtchResources();
+  EXPECT_TRUE(res != NULL);
+  EtchInt32 value1(12);
+  EtchFloat value2(12.1f);
+  EtchObject* result;
+  EtchString key1("key1");
+  EtchString key2("key2");
+  EtchString key3("key3");
+
+  EXPECT_TRUE(res->put(key1, &value1, &result) == ETCH_OK);
+  EXPECT_TRUE(res->put(key2, &value2, &result) == ETCH_OK);
+
+  EXPECT_TRUE(res->containsKey(key1) == true);
+  EXPECT_TRUE(res->containsKey(key2) == true);
+  EXPECT_TRUE(res->containsKey(key3) == false);
+
+  delete res;
+}
+
+TEST(EtchResources, removeTest) {
+  EtchResources * res = new EtchResources();
+  EXPECT_TRUE(res != NULL);
+  EtchInt32 value1(12);
+  EtchFloat value2(12.1f);
+  EtchObject* result;
+  EtchString key1("key1");
+  EtchString key2("key2");
+
+  EXPECT_TRUE(res->put(key1, &value1, &result) == ETCH_OK);
+  EXPECT_TRUE(res->put(key2, &value2, &result) == ETCH_OK);
+  EtchObject* ptr1;
+  EtchObject* ptr2;
+  EXPECT_TRUE(res->remove(key1, &ptr1) == ETCH_OK);
+  EXPECT_TRUE(res->remove(key2, &ptr2) == ETCH_OK);
+  
+  EXPECT_TRUE(((EtchInt32*) ptr1)->get() == 12);
+  EXPECT_TRUE(((EtchFloat*) ptr2)->get() == 12.1f);
+
+  EXPECT_TRUE(res->containsKey(key1) == false);
+  delete res;
+}
\ No newline at end of file