You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2012/08/02 17:25:39 UTC

svn commit: r1368536 - in /incubator/etch/trunk/binding-cpp/runtime: include/serialization/EtchStructValue.h src/main/serialization/EtchStructValue.cpp

Author: fitzner
Date: Thu Aug  2 15:25:39 2012
New Revision: 1368536

URL: http://svn.apache.org/viewvc?rev=1368536&view=rev
Log:
ETCH-147 EtchStructValue Changes

=> added const EtchField to get method
=> getFirstField()
=> isEmpty()

Change-Id: I0ea91264b113ab0bde952092f71689f3aef5d16b

Modified:
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h?rev=1368536&r1=1368535&r2=1368536&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h Thu Aug  2 15:25:39 2012
@@ -52,7 +52,7 @@ public:
    * @param type the type of the struct.
    * @param vf the value factory.
    */
-  EtchStructValue(EtchType *type, EtchValueFactory *vf);
+  EtchStructValue(EtchType* type, EtchValueFactory* vf);
 
   /**
    * Constructs the StructValue.
@@ -62,7 +62,7 @@ public:
    * @param length the number of name / value pairs expected. 0 means use
    * default.
    */
-  EtchStructValue(EtchType *type, EtchValueFactory *vf, capu::uint32_t length);
+  EtchStructValue(EtchType* type, EtchValueFactory* vf, capu::uint32_t length);
 
   /**
    * Default Destructor
@@ -96,7 +96,7 @@ public:
    *         ETCH_ENOT_EXIST if there is no existing pair with specified key
    *
    */
-  status_t get(EtchField &key, capu::SmartPointer<EtchObject> *value);
+  status_t get(const EtchField &key, capu::SmartPointer<EtchObject> *value);
 
   /**
    * Remove value associated with key in the EtchStructValue.
@@ -135,16 +135,20 @@ public:
    * @return EtchLevel
    */
   EtchLevel getLevel();
-  
+
   typedef EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::Iterator Iterator;
   typedef EtchHashTable<EtchField, capu::SmartPointer<EtchObject> >::Pair Pair;
 
   /**
-   * 
-   * @return an iterator which is pointing the beginning of collection 
+   * @return an iterator which is pointing the beginning of collection
    */
   Iterator begin();
-  
+
+  /**
+   * @return true if the struct value is empty, otherwise false
+   */
+  capu::bool_t isEmpty();
+
 private:
 
   EtchType* mType;
@@ -154,9 +158,11 @@ private:
    * A bogus serial version uid.
    */
   static const capu::int64_t serialVersionUID = 1L;
+
   //Default size of mTable
   static const capu::int32_t DEFAULT_SIZE = 8;
 
 };
 
+
 #endif /* ETCHSTRUCTVALUE_H */

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp?rev=1368536&r1=1368535&r2=1368536&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp Thu Aug  2 15:25:39 2012
@@ -89,11 +89,20 @@ status_t EtchStructValue::clear() {
   return ETCH_OK;
 }
 
-status_t EtchStructValue::get(EtchField &key, capu::SmartPointer<EtchObject>  *value) {
+status_t EtchStructValue::get(const EtchField &key, capu::SmartPointer<EtchObject>  *value) {
   return mTable.get(key, value);
 }
 
 EtchStructValue::Iterator EtchStructValue::begin()
 {
   return mTable.begin();
-}
\ No newline at end of file
+}
+
+
+capu::bool_t EtchStructValue::isEmpty()
+{
+  if(mTable.count() == 0) {
+    return true;
+  }
+  return false;
+}