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/06/01 13:48:00 UTC
svn commit: r1345087 [1/2] - in /incubator/etch/trunk/binding-cpp/runtime:
include/common/ include/serialization/ include/transport/ src/main/
src/main/common/ src/main/serialization/ src/test/ src/test/common/
src/test/serialization/
Author: fitzner
Date: Fri Jun 1 11:47:57 2012
New Revision: 1345087
URL: http://svn.apache.org/viewvc?rev=1345087&view=rev
Log:
ETCH-184 EtchClass2TypeMap has been implemented
- EtchClass2TypeMap has been implemented
- Etch type handling was changed
Change-Id: I2b133c216a77f63ef7baa4eabb7fa3d085dd0911
Added:
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp
- copied, changed from r1345079, incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchClass2TypeMapTest.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/EtchDouble.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.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/EtchNativeArray.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObjectType.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchServerSocket.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h
incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchComboValidator.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchField.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchType.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h
incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValueFactory.h
incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchSession.h
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/EtchObjectType.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchServerSocket.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchShort.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchSocket.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchString.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchComboValidator.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchStructValue.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchType.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValueFactory.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchBoolTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchByteTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchDoubleTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchFloatTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchInt32Test.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchLongTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchNativeArrayTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchShortTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/common/EtchStringTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp
incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchBool.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHBOOL_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchBool :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchBool.
+ * EtchObjectType for EtchBool.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchBool object.
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchByte.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHBYTE_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchByte :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchByte.
+ * EtchObjectType for EtchByte.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchByte object.
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchDouble.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHDOUBLE_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchDouble :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchDouble.
+ * EtchObjectType for EtchDouble.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchDouble object.
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchFloat.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHFLOAT_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchFloat :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchFloat.
+ * EtchObjectType for EtchFloat.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchFloat object.
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h Fri Jun 1 11:47:57 2012
@@ -22,7 +22,6 @@
#include "capu/container/HashTable.h"
#include "capu/util/Traits.h"
-
class EtchHashNative {
public:
@@ -39,8 +38,6 @@ public:
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashSet.h Fri Jun 1 11:47:57 2012
@@ -18,11 +18,13 @@
#ifndef __ETCHSET_H__
#define __ETCHSET_H__
+#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
#include "common/EtchObjectHash.h"
#include "common/EtchComparator.h"
#include "capu/container/HashSet.h"
-#include "common/EtchObject.h"
+
template <class T, class H = EtchObjectHash, class C = EtchComparator<T> >
@@ -31,8 +33,11 @@ class EtchHashSet : public EtchObject {
public:
typedef typename capu::HashSet<T, C, H>::Iterator Iterator;
- static const EtchObjectType TYPE;
+ /**
+ * EtchObjectType for EtchHashSet.
+ */
+ static const EtchObjectType* TYPE();
/**
* Default Constructor
@@ -99,7 +104,7 @@ private:
template <class T, class H, class C>
inline EtchHashSet<T, H, C>::EtchHashSet()
-: EtchObject(&EtchHashSet<T, H, C>::TYPE) {
+: EtchObject(EtchHashSet<T, H, C>::TYPE()) {
}
@@ -110,7 +115,10 @@ inline EtchHashSet<T, H, C>::EtchHashSet
}
template <class T, class H, class C>
-const EtchObjectType EtchHashSet<T, H, C>::TYPE(EOTID_SET, NULL);
+const EtchObjectType* EtchHashSet<T, H, C>::TYPE() {
+ const static EtchObjectType TYPE(EOTID_SET, NULL);
+ return &TYPE;
+}
template <class T, class H, class C>
inline EtchHashSet<T, H, C>::~EtchHashSet() {
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashTable.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHHASHTABLE_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
#include "common/EtchObjectHash.h"
#include "common/EtchComparator.h"
@@ -33,7 +34,11 @@ private:
public:
typedef typename capu::Pair<Key, T> Pair;
typedef typename capu::HashTable<Key, T, C, H >::Iterator Iterator;
- static const EtchObjectType TYPE;
+
+ /**
+ * EtchObjectType for EtchHashTable.
+ */
+ static const EtchObjectType* TYPE();
/**
* Constructs EtchHashTable.
@@ -109,17 +114,20 @@ public:
};
template <class Key, class T, class H, class C>
-const EtchObjectType EtchHashTable<Key, T, H, C>::TYPE(EOTID_HASHTABLE, NULL);
+const EtchObjectType* EtchHashTable<Key, T, H, C>::TYPE() {
+ const static EtchObjectType TYPE(EOTID_HASHTABLE, NULL);
+ return &TYPE;
+}
template <class Key, class T, class H, class C>
inline EtchHashTable<Key, T, H, C>::EtchHashTable()
-: EtchObject(&EtchHashTable<Key, T, H, C>::TYPE), mHashTable(ETCH_DEFAULT_HASH_TABLE_SIZE) {
+: EtchObject(EtchHashTable<Key, T, H, C>::TYPE()), mHashTable(ETCH_DEFAULT_HASH_TABLE_SIZE) {
}
template <class Key, class T, class H, class C>
inline EtchHashTable<Key, T, H, C>::EtchHashTable(capu::uint64_t size)
-: EtchObject(&EtchHashTable<Key, T, H, C>::TYPE), mHashTable(size) {
+: EtchObject(EtchHashTable<Key, T, H, C>::TYPE()), mHashTable(size) {
}
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchInt32.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHINT32_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchInt32 :
@@ -27,10 +28,11 @@ public EtchObject {
public:
- /**
- * TypeId for EtchString.
- */
- static const EtchObjectType TYPE;
+ /**
+ * EtchObjectType for EtchString.
+ */
+ static const EtchObjectType* TYPE();
+
/**
* Constructs a EtchInt32 object.
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchList.h Fri Jun 1 11:47:57 2012
@@ -31,7 +31,11 @@ private:
public:
typedef typename capu::List<T, C>::Iterator Iterator;
- static const EtchObjectType TYPE;
+
+ /**
+ * EtchObjectType for EtchList.
+ */
+ static const EtchObjectType* TYPE();
/**
* Default Constructor
@@ -142,11 +146,14 @@ public:
};
template<class T, class C>
-const EtchObjectType EtchList<T, C>::TYPE(EOTID_LIST, NULL);
+const EtchObjectType* EtchList<T, C>::TYPE() {
+ const static EtchObjectType TYPE(EOTID_LIST, NULL);
+ return &TYPE;
+}
template<class T, class C>
EtchList<T, C>::EtchList()
-: EtchObject(&EtchList<T, C>::TYPE) {
+: EtchObject(EtchList<T, C>::TYPE()) {
}
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchLong.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHLONG_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchLong :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchLong.
+ * EtchObjectType for EtchLong.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchLong object.
Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchNativeArray.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchNativeArray.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchNativeArray.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchNativeArray.h Fri Jun 1 11:47:57 2012
@@ -28,9 +28,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchNativeArray.
+ * EtchObjectType for EtchNativeArray.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchNativeArray object.
@@ -118,11 +118,14 @@ private:
};
template<class T>
-const EtchObjectType EtchNativeArray<T>::TYPE(EOTID_NATIVE_ARRAY, EtchObjectType::getType<T>());
+const EtchObjectType* EtchNativeArray<T>::TYPE() {
+ const static EtchObjectType TYPE(EOTID_NATIVE_ARRAY, EtchObjectType::getType<T>());
+ return &TYPE;
+}
template<class T>
EtchNativeArray<T>::EtchNativeArray(capu::int32_t length, const EtchObjectType* content_type_id)
-: EtchObject(&EtchNativeArray::TYPE), mIsDeleteContentType(false),
+: EtchObject(EtchNativeArray::TYPE()), mIsDeleteContentType(false),
mLength(length) {
mArray = new T[length];
mContentType = content_type_id;
@@ -130,7 +133,7 @@ mLength(length) {
template<class T>
EtchNativeArray<T>::EtchNativeArray(capu::int32_t length, T* array, const EtchObjectType* content_type_id)
-: EtchObject(&EtchNativeArray::TYPE), mArray(array), mIsDeleteContentType(false),
+: EtchObject(EtchNativeArray::TYPE()), mArray(array), mIsDeleteContentType(false),
mLength(length) {
mContentType = content_type_id;
}
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h Fri Jun 1 11:47:57 2012
@@ -20,12 +20,23 @@
#define __ETCHOBJECT_H__
#include "EtchConfig.h"
-#include "EtchObjectType.h"
+
+class EtchObjectType;
class EtchObject {
public:
/**
+ * EtchObjectType for EtchObject.
+ */
+ static const EtchObjectType* TYPE();
+
+ /**
+ * Constructor.
+ */
+ EtchObject();
+
+ /**
* Constructor.
*/
EtchObject(const EtchObjectType* type);
@@ -35,8 +46,13 @@ public:
*/
virtual ~EtchObject();
+/**
+ * Returns object type id of this type.
+ */
+ const EtchObjectType* GetObjectType() const;
+
/**
- * Returns object type id.
+ * Returns object type id of this object.
*/
const EtchObjectType* getObjectType() const;
@@ -51,8 +67,6 @@ public:
*/
virtual capu::bool_t equals(const EtchObject * other) const;
- static const EtchObjectType TYPE;
-
private:
const EtchObjectType* mType;
Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObjectType.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObjectType.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObjectType.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObjectType.h Fri Jun 1 11:47:57 2012
@@ -20,7 +20,9 @@
#ifndef __ETCHOBJECTTYPE_H__
#define __ETCHOBJECTTYPE_H__
+
#include "EtchConfig.h"
+#include "common/EtchObject.h"
enum EtchObjectTypeIds {
@@ -51,6 +53,7 @@ enum EtchObjectTypeIds {
EOTID_VALIDATOR_OBJECT,
EOTID_FIELD,
EOTID_OBJECT,
+ EOTID_OBJECT_TYPE,
EOTID_VALUE_FACTORY,
EOTID_TYPE,
EOTID_STRUCT_VALUE,
@@ -67,7 +70,7 @@ enum EtchObjectTypeIds {
EOTID_NATIVE_BYTE,
};
-class EtchObjectType {
+class EtchObjectType : public EtchObject {
public:
/**
* TypeIds for native types
@@ -81,6 +84,11 @@ public:
static const EtchObjectType NATIVE_BOOL;
/**
+ * EtchObjectType for EtchString.
+ */
+ static const EtchObjectType* TYPE();
+
+ /**
* Constructor
*/
EtchObjectType(capu::int32_t typeId, const EtchObjectType* componentTypes);
@@ -135,7 +143,7 @@ private:
struct __Wrapper__<T*> {
static const EtchObjectType * getType() {
- return &T::TYPE;
+ return T::TYPE();
}
};
Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchServerSocket.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchServerSocket.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchServerSocket.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchServerSocket.h Fri Jun 1 11:47:57 2012
@@ -18,6 +18,8 @@
#ifndef __ETCHSERVERSOCKET_H__
#define __ETCHSERVERSOCKET_H__
+
+
#include "capu/os/ServerSocket.h"
#include "capu/os/Socket.h"
#include "capu/util/SmartPointer.h"
@@ -27,9 +29,9 @@ class EtchServerSocket : public EtchObje
public:
/**
- * TypeID
+ * EtchObjectType for EtchServerSocket.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Default Constructor
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchShort.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHSHORT_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchShort :
@@ -28,9 +29,9 @@ public EtchObject {
public:
/**
- * TypeId for EtchShort.
+ * EtchObjectType for EtchShort.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Constructs a EtchShort object.
Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h Fri Jun 1 11:47:57 2012
@@ -19,16 +19,17 @@
#ifndef __ETCHSOCKET_H__
#define __ETCHSOCKET_H__
#include "capu/os/Socket.h"
-#include "common/EtchError.h"
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
+#include "common/EtchError.h"
class EtchSocket : public EtchObject {
public:
/**
- * TypeID
+ * EtchObjectType for EtchSocket.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();;
/**
* Default Constructor
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchString.h Fri Jun 1 11:47:57 2012
@@ -20,6 +20,7 @@
#define __ETCHSTRING_H__
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "util/EtchUtil.h"
/**
@@ -30,10 +31,10 @@ public EtchObject {
public:
- /**
- * TypeId for EtchString.
- */
- static const EtchObjectType TYPE;
+ /**
+ * EtchObjectType for EtchString.
+ */
+ static const EtchObjectType* TYPE();
/**
* Constructs the String.
Added: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h?rev=1345087&view=auto
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h (added)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchClass2TypeMap.h Fri Jun 1 11:47:57 2012
@@ -0,0 +1,76 @@
+/* $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 __ETCHCLASS2TYPEMAP_H__
+#define __ETCHCLASS2TYPEMAP_H__
+
+#include "capu/util/SmartPointer.h"
+#include "common/EtchInt32.h"
+#include "serialization/EtchType.h"
+
+/**
+ * Mapping between Class and Type.
+ */
+class EtchClass2TypeMap {
+public:
+
+ /**
+ * Constructor
+ */
+ EtchClass2TypeMap();
+
+ /**
+ * Destructor
+ */
+ virtual ~EtchClass2TypeMap();
+
+ /**
+ * @param classType
+ * @param result
+ * @return ETCH_OK if get is successful performed
+ * ETCH_EINVAL if field is null
+ * ETCH_ENOT_EXIST if there is no pair with specified id
+ */
+ status_t get(const EtchObjectType* classType, EtchType **result);
+
+ /**
+ * Adds a map entry from classType to type.
+ * @param classType
+ * @param type
+ * @return ETCH_EINVAL if it is locked
+ * ETCH_ERANGE if there is duplicate element on the collection
+ * ETCH_OK if successfully added
+ * ETCH_ERROR otherwise
+ */
+ status_t put(const EtchObjectType* classType, EtchType *type);
+
+ /**
+ * Locks the map, disallowing any more changes.
+ */
+ void lock();
+
+private:
+ EtchHashTable<const EtchObjectType*, EtchType* > mC2T;
+
+ capu::bool_t mLocked;
+
+};
+
+#endif /* __ETCHCLASS2TYPEMAP_H__ */
+
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchComboValidator.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchComboValidator.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchComboValidator.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchComboValidator.h Fri Jun 1 11:47:57 2012
@@ -18,12 +18,17 @@
#ifndef __ETCHCOMBOVALIDATOR_H__
#define __ETCHCOMBOVALIDATOR_H__
+
#include "serialization/EtchValidator.h"
-#include "common/EtchError.h"
class EtchComboValidator : public EtchValidator {
public:
+ /**
+ * EtchObjectType for EtchBool.
+ */
+ static const EtchObjectType* TYPE();
+
/**
* Constructs the ComboValidator.
*
@@ -63,7 +68,6 @@ public:
* @return second child validator
*/
capu::SmartPointer<EtchValidator> getSecond();
- static const EtchObjectType TYPE;
private:
capu::SmartPointer<EtchValidator> mFirst;
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchField.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchField.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchField.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchField.h Fri Jun 1 11:47:57 2012
@@ -26,9 +26,9 @@ class EtchField : public EtchObject {
public:
/**
- * TypeId for EtchField.
+ * EtchObjectType for EtchField.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Default Constructor
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchStructValue.h Fri Jun 1 11:47:57 2012
@@ -41,7 +41,10 @@ class EtchValueFactory;
class EtchStructValue : public EtchObject {
public:
- static const EtchObjectType TYPE;
+ /**
+ * EtchObjectType for EtchStructValue.
+ */
+ static const EtchObjectType* TYPE();
/**
* Constructs the StructValue with default length.
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchType.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchType.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchType.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchType.h Fri Jun 1 11:47:57 2012
@@ -33,7 +33,10 @@
class EtchType : public EtchObject {
public:
- static const EtchObjectType TYPE;
+ /**
+ * EtchObjectType for EtchNativeArray.
+ */
+ static const EtchObjectType* TYPE();
/**
* Constructor
@@ -44,14 +47,14 @@ public:
* Constructor
* @param name name of the type
*/
- EtchType(EtchString &name);
+ EtchType(EtchString name);
/**
* Constructor
* @param id identifier of the type
* @param name name of the type
*/
- EtchType(capu::uint32_t id, EtchString &name);
+ EtchType(capu::uint32_t id, EtchString name);
/**
* Default Destructor
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h Fri Jun 1 11:47:57 2012
@@ -18,8 +18,10 @@
#ifndef __ETCHVALIDATOR_H__
#define __ETCHVALIDATOR_H__
+
#include "capu/util/SmartPointer.h"
#include "common/EtchObject.h"
+#include "common/EtchObjectType.h"
#include "common/EtchError.h"
class EtchValidator : public EtchObject {
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h Fri Jun 1 11:47:57 2012
@@ -25,6 +25,11 @@
class EtchValidatorBoolean : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorBoolean.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorBoolean();
/**
@@ -47,8 +52,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorBoolean(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h Fri Jun 1 11:47:57 2012
@@ -30,6 +30,11 @@
class EtchValidatorByte : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorByte.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorByte();
/**
@@ -52,8 +57,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorByte(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h Fri Jun 1 11:47:57 2012
@@ -28,6 +28,11 @@
class EtchValidatorDouble : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorDouble.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorDouble();
/**
@@ -50,8 +55,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorDouble(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h Fri Jun 1 11:47:57 2012
@@ -27,6 +27,11 @@
class EtchValidatorFloat : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorFloat.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorFloat();
/**
@@ -49,8 +54,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorFloat(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h Fri Jun 1 11:47:57 2012
@@ -32,6 +32,11 @@ class EtchValidatorInt : public EtchType
public:
/**
+ * EtchObjectType for EtchValidatorInt.
+ */
+ static const EtchObjectType* TYPE();
+
+ /**
* @see EtchValidator
*/
virtual status_t getElementValidator(capu::SmartPointer<EtchValidator> &val);
@@ -53,8 +58,6 @@ public:
virtual ~EtchValidatorInt();
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorInt(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h Fri Jun 1 11:47:57 2012
@@ -30,6 +30,12 @@
class EtchValidatorLong : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorLong.
+ */
+ static const EtchObjectType* TYPE();
+
+
virtual ~EtchValidatorLong();
/**
@@ -52,8 +58,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorLong(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h Fri Jun 1 11:47:57 2012
@@ -25,6 +25,11 @@
class EtchValidatorObject : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorObject.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorObject();
/**
@@ -47,8 +52,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorObject(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h Fri Jun 1 11:47:57 2012
@@ -31,6 +31,11 @@
class EtchValidatorShort : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorShort.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorShort();
/**
@@ -53,8 +58,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorShort(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h Fri Jun 1 11:47:57 2012
@@ -26,6 +26,11 @@
class EtchValidatorString : public EtchTypeValidator {
public:
+ /**
+ * EtchObjectType for EtchValidatorString.
+ */
+ static const EtchObjectType* TYPE();
+
virtual ~EtchValidatorString();
/**
@@ -48,8 +53,6 @@ public:
*/
static status_t Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val);
- static const EtchObjectType TYPE;
-
protected:
EtchValidatorString(capu::uint32_t ndim);
Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValueFactory.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValueFactory.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValueFactory.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValueFactory.h Fri Jun 1 11:47:57 2012
@@ -41,9 +41,9 @@ class EtchValueFactory : public EtchObje
public:
/**
- * TypeID
+ * EtchObjectType for EtchValueFactory.
*/
- static const EtchObjectType TYPE;
+ static const EtchObjectType* TYPE();
/**
* Default Constructor
Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchSession.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchSession.h?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchSession.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchSession.h Fri Jun 1 11:47:57 2012
@@ -27,7 +27,6 @@ class EtchSession {
public:
virtual ~EtchSession() {
-
}
/**
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/CMakeLists.txt Fri Jun 1 11:47:57 2012
@@ -82,6 +82,7 @@ SET(MAIN_INCLUDES
${PROJECT_SOURCE_DIR}/include/serialization/EtchType.h
${PROJECT_SOURCE_DIR}/include/serialization/EtchStructValue.h
${PROJECT_SOURCE_DIR}/include/serialization/EtchTypeMap.h
+ ${PROJECT_SOURCE_DIR}/include/serialization/EtchClass2TypeMap.h
${PROJECT_SOURCE_DIR}/include/util/EtchUtil.h
)
@@ -124,6 +125,7 @@ SET(MAIN_SOURCES
serialization/EtchType.cpp
serialization/EtchStructValue.cpp
serialization/EtchTypeMap.cpp
+ serialization/EtchClass2TypeMap.cpp
util/EtchUtil.cpp
)
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,16 +18,19 @@
#include "common/EtchBool.h"
-const EtchObjectType EtchBool::TYPE(EOTID_BOOL, NULL);
+const EtchObjectType* EtchBool::TYPE() {
+ const static EtchObjectType TYPE(EOTID_BOOL, NULL);
+ return &TYPE;
+}
EtchBool::EtchBool()
-: EtchObject(&EtchBool::TYPE)
+: EtchObject(EtchBool::TYPE())
, mValue(false){
}
EtchBool::EtchBool(capu::bool_t value)
-: EtchObject(&EtchBool::TYPE)
+: EtchObject(EtchBool::TYPE())
, mValue(value){
}
@@ -42,7 +45,7 @@ capu::bool_t EtchBool::get(){
capu::bool_t EtchBool::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchBool::TYPE))
+ else if (!other->getObjectType()->equals(EtchBool::TYPE()))
return false;
EtchBool* a = (EtchBool *) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchByte.h"
-const EtchObjectType EtchByte::TYPE(EOTID_BYTE, NULL);
+const EtchObjectType* EtchByte::TYPE() {
+ const static EtchObjectType TYPE(EOTID_BYTE, NULL);
+ return &TYPE;
+}
EtchByte::EtchByte()
-: EtchObject(&EtchByte::TYPE)
+: EtchObject(EtchByte::TYPE())
, mValue(0){
}
EtchByte::EtchByte(capu::int8_t value)
-: EtchObject(&EtchByte::TYPE)
+: EtchObject(EtchByte::TYPE())
, mValue(value){
}
@@ -41,7 +44,7 @@ capu::int8_t EtchByte::get(){
capu::bool_t EtchByte::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchByte::TYPE))
+ else if (!other->getObjectType()->equals(EtchByte::TYPE()))
return false;
EtchByte * a = (EtchByte*) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchDouble.h"
-const EtchObjectType EtchDouble::TYPE(EOTID_DOUBLE, NULL);
+const EtchObjectType* EtchDouble::TYPE() {
+ const static EtchObjectType TYPE(EOTID_DOUBLE, NULL);
+ return &TYPE;
+}
EtchDouble::EtchDouble()
-: EtchObject(&EtchDouble::TYPE)
+: EtchObject(EtchDouble::TYPE())
, mValue(0.0L){
}
EtchDouble::EtchDouble(capu::double_t value)
-: EtchObject(&EtchDouble::TYPE)
+: EtchObject(EtchDouble::TYPE())
, mValue(value){
}
@@ -47,7 +50,7 @@ capu::uint64_t EtchDouble::getHashCode()
capu::bool_t EtchDouble::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchDouble::TYPE))
+ else if (!other->getObjectType()->equals(EtchDouble::TYPE()))
return false;
EtchDouble * a = (EtchDouble *) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,16 +18,18 @@
#include "common/EtchFloat.h"
-
-const EtchObjectType EtchFloat::TYPE(EOTID_FLOAT, NULL);
+const EtchObjectType* EtchFloat::TYPE() {
+ const static EtchObjectType TYPE(EOTID_FLOAT, NULL);
+ return &TYPE;
+}
EtchFloat::EtchFloat()
-: EtchObject(&EtchFloat::TYPE)
+: EtchObject(EtchFloat::TYPE())
, mValue(0.0f){
}
EtchFloat::EtchFloat(capu::float_t value)
-: EtchObject(&EtchFloat::TYPE)
+: EtchObject(EtchFloat::TYPE())
, mValue(value){
}
@@ -48,7 +50,7 @@ capu::uint64_t EtchFloat::getHashCode()
capu::bool_t EtchFloat::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchFloat::TYPE))
+ else if (!other->getObjectType()->equals(EtchFloat::TYPE()))
return false;
EtchFloat * a = (EtchFloat*) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchInt32.h"
-const EtchObjectType EtchInt32::TYPE(EOTID_INT32, NULL);
+const EtchObjectType* EtchInt32::TYPE() {
+ const static EtchObjectType TYPE(EOTID_INT32, NULL);
+ return &TYPE;
+}
EtchInt32::EtchInt32()
-: EtchObject(&EtchInt32::TYPE)
+: EtchObject(EtchInt32::TYPE())
, mValue(0){
}
EtchInt32::EtchInt32(capu::int32_t value)
-: EtchObject(&EtchInt32::TYPE)
+: EtchObject(EtchInt32::TYPE())
, mValue(value){
}
@@ -45,7 +48,7 @@ capu::uint64_t EtchInt32::getHashCode()
capu::bool_t EtchInt32::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchInt32::TYPE))
+ else if (!other->getObjectType()->equals(EtchInt32::TYPE()))
return false;
EtchInt32 *a = (EtchInt32*) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchLong.h"
-const EtchObjectType EtchLong::TYPE(EOTID_LONG, NULL);
+const EtchObjectType* EtchLong::TYPE() {
+ const static EtchObjectType TYPE(EOTID_LONG, NULL);
+ return &TYPE;
+}
EtchLong::EtchLong()
-: EtchObject(&EtchLong::TYPE)
+: EtchObject(EtchLong::TYPE())
, mValue(0){
}
EtchLong::EtchLong(capu::int64_t value)
-: EtchObject(&EtchLong::TYPE)
+: EtchObject(EtchLong::TYPE())
, mValue(value){
}
@@ -45,7 +48,7 @@ capu::uint64_t EtchLong::getHashCode() c
capu::bool_t EtchLong::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchLong::TYPE))
+ else if (!other->getObjectType()->equals(EtchLong::TYPE()))
return false;
EtchLong * a = (EtchLong*) other;
return (a->mValue == this->mValue);
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -17,7 +17,15 @@
*/
#include "common/EtchObject.h"
-const EtchObjectType EtchObject::TYPE(EOTID_OBJECT, NULL);
+#include "common/EtchObjectType.h"
+
+const EtchObjectType* EtchObject::TYPE() {
+ const static EtchObjectType TYPE(EOTID_OBJECT, NULL);
+ return &TYPE;
+}
+
+EtchObject::EtchObject() {
+}
EtchObject::EtchObject(const EtchObjectType* type){
mType = type;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObjectType.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObjectType.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObjectType.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObjectType.cpp Fri Jun 1 11:47:57 2012
@@ -28,6 +28,11 @@ const EtchObjectType EtchObjectType::NAT
const EtchObjectType EtchObjectType::NATIVE_FLOAT(EOTID_FLOAT, NULL);
const EtchObjectType EtchObjectType::NATIVE_BOOL(EOTID_BOOL, NULL);
+const EtchObjectType* EtchObjectType::TYPE() {
+ const static EtchObjectType TYPE(EOTID_OBJECT_TYPE, NULL);
+ return &TYPE;
+}
+
EtchObjectType::EtchObjectType(capu::int32_t typeId, const EtchObjectType* componentType)
: mTypeId(typeId), mComponentType(componentType) {
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchServerSocket.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchServerSocket.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchServerSocket.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchServerSocket.cpp Fri Jun 1 11:47:57 2012
@@ -16,14 +16,16 @@
* limitations under the License.
*/
#include "common/EtchServerSocket.h"
-#include "common/EtchObject.h"
#include "capu/util/SmartPointer.h"
#include "common/EtchSocket.h"
-const EtchObjectType EtchServerSocket::TYPE(EOTID_SERVER_SOCKET, NULL);
+const EtchObjectType* EtchServerSocket::TYPE() {
+ const static EtchObjectType TYPE(EOTID_SERVER_SOCKET, NULL);
+ return &TYPE;
+}
EtchServerSocket::EtchServerSocket()
-: EtchObject(&EtchServerSocket::TYPE) {
+: EtchObject(EtchServerSocket::TYPE()) {
}
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchShort.h"
-const EtchObjectType EtchShort::TYPE(EOTID_SHORT, NULL);
+const EtchObjectType* EtchShort::TYPE() {
+ const static EtchObjectType TYPE(EOTID_SHORT, NULL);
+ return &TYPE;
+}
EtchShort::EtchShort()
-: EtchObject(&EtchShort::TYPE)
+: EtchObject(EtchShort::TYPE())
, mValue(0){
}
EtchShort::EtchShort(capu::int16_t value)
-: EtchObject(&EtchShort::TYPE)
+: EtchObject(EtchShort::TYPE())
, mValue(value){
}
@@ -47,7 +50,7 @@ capu::uint64_t EtchShort::getHashCode()
capu::bool_t EtchShort::equals(const EtchObject * other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchShort::TYPE))
+ else if (!other->getObjectType()->equals(EtchShort::TYPE()))
return false;
EtchShort * a = (EtchShort*) other;
return (a->mValue == this->mValue);
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchSocket.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchSocket.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchSocket.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchSocket.cpp Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "common/EtchSocket.h"
-const EtchObjectType EtchSocket::TYPE(EOTID_SOCKET, NULL);
+const EtchObjectType* EtchSocket::TYPE() {
+ const static EtchObjectType TYPE(EOTID_SOCKET, NULL);
+ return &TYPE;
+}
EtchSocket::EtchSocket()
-: EtchObject(&EtchSocket::TYPE) {
+: EtchObject(EtchSocket::TYPE()) {
mSocket = new capu::Socket();
}
EtchSocket::EtchSocket(capu::Socket* soc)
-: EtchObject(&EtchSocket::TYPE) {
+: EtchObject(EtchSocket::TYPE()) {
if (soc == NULL)
mSocket = new capu::Socket();
else
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -17,16 +17,20 @@
*/
#include "common/EtchString.h"
-const EtchObjectType EtchString::TYPE(EOTID_STRING, NULL);
+
+const EtchObjectType* EtchString::TYPE() {
+ const static EtchObjectType TYPE(EOTID_STRING, NULL);
+ return &TYPE;
+}
EtchString::EtchString()
-: EtchObject(&EtchString::TYPE)
+: EtchObject(EtchString::TYPE())
, mData(NULL) {
//ETCH_LOG("EtchString: ", EtchLogLevel::Error, "dies ist ein Test");
}
EtchString::EtchString(const char* string)
-: EtchObject(&EtchString::TYPE)
+: EtchObject(EtchString::TYPE())
, mData(NULL) {
if (string != NULL) {
capu::int32_t len = strlen(string);
@@ -36,7 +40,7 @@ EtchString::EtchString(const char* strin
}
EtchString::EtchString(const EtchString ©)
-: EtchObject(&EtchString::TYPE) {
+: EtchObject(EtchString::TYPE()) {
if (copy.mData == NULL)
return;
capu::int32_t len = strlen(copy.mData);
@@ -103,7 +107,7 @@ const char* EtchString::c_str() const{
capu::bool_t EtchString::equals(const EtchObject* other) const{
if (other == NULL)
return false;
- else if (!other->getObjectType()->equals(&EtchString::TYPE))
+ else if (!other->getObjectType()->equals(EtchString::TYPE()))
return false;
if (strcmp(((EtchString*) other)->mData, this->mData) == 0)
return true;
Copied: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp (from r1345079, incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h)
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp?p2=incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp&p1=incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h&r1=1345079&r2=1345087&rev=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchHashNative.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchClass2TypeMap.cpp Fri Jun 1 11:47:57 2012
@@ -16,32 +16,38 @@
* limitations under the License.
*/
-#ifndef __ETCHHASHNATIVE_H__
-#define __ETCHHASHNATIVE_H__
-#include "common/EtchConfig.h"
-#include "capu/container/HashTable.h"
-#include "capu/util/Traits.h"
+#include "common/EtchHashTable.h"
+#include "serialization/EtchType.h"
+#include "serialization/EtchClass2TypeMap.h"
+EtchClass2TypeMap::EtchClass2TypeMap()
+: mLocked(false) {
+}
-class EtchHashNative {
-public:
-
- template<class T>
- static capu::uint64_t Digest(T &key) {
- return capu::Hash::Digest<T>(key);
- }
+EtchClass2TypeMap::~EtchClass2TypeMap() {
+}
- static capu::uint64_t Digest(char* key) {
- return capu::Hash::Digest(key);
- }
+status_t EtchClass2TypeMap::get(const EtchObjectType* classType, EtchType **result) {
+ return mC2T.get(classType, result);
+}
- static capu::uint64_t Digest(const char* key) {
- return capu::Hash::Digest(key);
- }
+status_t EtchClass2TypeMap::put(const EtchObjectType* classType, EtchType *type) {
-
+ if (mLocked) {
+ return ETCH_EINVAL;
+ }
-};
+ EtchType* tmp = NULL;
+ if (mC2T.get(classType, &tmp) == ETCH_OK) {
+ if (!tmp->equals(type)) {
+ return ETCH_ERANGE;
+ }
+ return ETCH_OK;
+ }
-#endif
+ return mC2T.put(classType, type);
+}
+void EtchClass2TypeMap::lock() {
+ mLocked = true;
+}
\ No newline at end of file
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchComboValidator.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchComboValidator.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchComboValidator.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchComboValidator.cpp Fri Jun 1 11:47:57 2012
@@ -18,10 +18,13 @@
#include "serialization/EtchComboValidator.h"
-const EtchObjectType EtchComboValidator::TYPE(EOTID_VALIDATOR_COMBO, NULL);
+const EtchObjectType* EtchComboValidator::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_COMBO, NULL);
+ return &TYPE;
+}
EtchComboValidator::EtchComboValidator(capu::SmartPointer<EtchValidator> a, capu::SmartPointer<EtchValidator> b)
-: EtchValidator(&EtchComboValidator::TYPE), mFirst(a), mSecond(b) {
+: EtchValidator(EtchComboValidator::TYPE()), mFirst(a), mSecond(b) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchField.cpp Fri Jun 1 11:47:57 2012
@@ -20,19 +20,22 @@
#include "util/EtchHash.h"
#include "common/EtchObjectHash.h"
-const EtchObjectType EtchField::TYPE(EOTID_FIELD, NULL);
+const EtchObjectType* EtchField::TYPE() {
+ const static EtchObjectType TYPE(EOTID_FIELD, NULL);
+ return &TYPE;
+}
EtchField::EtchField(capu::uint32_t id, EtchString& name)
-: EtchObject(&EtchField::TYPE), mId(id), mName(name) {
+: EtchObject(EtchField::TYPE()), mId(id), mName(name) {
}
EtchField::EtchField(const EtchString& name)
-: EtchObject(&EtchField::TYPE), mId(0), mName(name) {
+: EtchObject(EtchField::TYPE()), mId(0), mName(name) {
mId = EtchHashEx::Digest(name);
}
EtchField::EtchField()
-: EtchObject(&EtchField::TYPE), mId(0), mName("") {
+: EtchObject(EtchField::TYPE()), mId(0), mName("") {
}
capu::uint64_t EtchField::getHashCode() const{
@@ -42,7 +45,7 @@ capu::uint64_t EtchField::getHashCode()
capu::bool_t EtchField::equals(const EtchObject * object) const{
if (object == NULL)
return false;
- else if (object->getObjectType() != &EtchField::TYPE)
+ else if (object->getObjectType() != EtchField::TYPE())
return false;
EtchField * a = (EtchField*) object;
return ((a->mId.equals(&(this->mId))) && (a->mName.equals(&this->mName)));
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=1345087&r1=1345086&r2=1345087&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 Fri Jun 1 11:47:57 2012
@@ -18,15 +18,18 @@
#include "serialization/EtchStructValue.h"
-const EtchObjectType EtchStructValue::TYPE(EOTID_STRUCT_VALUE, NULL);
+const EtchObjectType* EtchStructValue::TYPE() {
+ const static EtchObjectType TYPE(EOTID_STRUCT_VALUE, NULL);
+ return &TYPE;
+}
EtchStructValue::EtchStructValue(EtchType* type, EtchValueFactory* vf)
-: EtchObject(&EtchStructValue::TYPE), mType(type), mLevel(vf->getLevel()), mTable(DEFAULT_SIZE) {
+: EtchObject(EtchStructValue::TYPE()), mType(type), mLevel(vf->getLevel()), mTable(DEFAULT_SIZE) {
}
EtchStructValue::EtchStructValue(EtchType* type, EtchValueFactory* vf, capu::uint32_t length)
-: EtchObject(&EtchStructValue::TYPE), mType(type), mLevel(vf->getLevel()), mTable(length > 0 ? (length * 4 + 2) / 3 : DEFAULT_SIZE) {
+: EtchObject(EtchStructValue::TYPE()), mType(type), mLevel(vf->getLevel()), mTable(length > 0 ? (length * 4 + 2) / 3 : DEFAULT_SIZE) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchType.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchType.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchType.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchType.cpp Fri Jun 1 11:47:57 2012
@@ -19,22 +19,25 @@
#include "serialization/EtchType.h"
#include "util/EtchHash.h"
-const EtchObjectType EtchType::TYPE(EOTID_TYPE, NULL);
+const EtchObjectType* EtchType::TYPE() {
+ const static EtchObjectType TYPE(EOTID_TYPE, NULL);
+ return &TYPE;
+}
EtchType::EtchType()
-: EtchObject(&EtchType::TYPE), mId(0), mTimeout(0), mName(""), mSuperType(NULL),
+: EtchObject(EtchType::TYPE()), mId(0), mTimeout(0), mName(""), mSuperType(NULL),
mResultType(NULL), mDirection(BOTH), mAsyncMode(NONE), mLocked(false), mComponentType(NULL), mHelper(NULL) {
}
-EtchType::EtchType(capu::uint32_t id, EtchString &name)
-: EtchObject(&EtchType::TYPE), mId(id), mTimeout(0), mName(name), mSuperType(NULL),
+EtchType::EtchType(EtchString name)
+: EtchObject(EtchType::TYPE()), mTimeout(0), mName(name), mSuperType(NULL),
mResultType(NULL), mDirection(BOTH), mAsyncMode(NONE), mLocked(false), mComponentType(NULL), mHelper(NULL) {
+ mId = EtchHashEx::Digest(mName);;
}
-EtchType::EtchType(EtchString &name)
-: EtchObject(&EtchType::TYPE), mTimeout(0), mName(name), mSuperType(NULL),
+EtchType::EtchType(capu::uint32_t id, EtchString name)
+: EtchObject(EtchType::TYPE()), mId(id), mTimeout(0), mName(name), mSuperType(NULL),
mResultType(NULL), mDirection(BOTH), mAsyncMode(NONE), mLocked(false), mComponentType(NULL), mHelper(NULL) {
- mId = EtchHashEx::Digest(mName);;
}
EtchType::~EtchType() {
@@ -159,7 +162,7 @@ void EtchType::lock() {
capu::bool_t EtchType::equals(EtchObject *other) {
if (other == NULL)
return false;
- if (other->getObjectType() != &EtchType::TYPE)
+ if (other->getObjectType() != EtchType::TYPE())
return false;
EtchType *type = (EtchType*) other;
return ((type->mId.equals(&(mId))) && (type->mName.equals(&mName)));
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorBoolean.h"
capu::SmartPointer<EtchValidator> EtchValidatorBoolean::mValidators[MAX_CACHED];
-const EtchObjectType EtchValidatorBoolean::TYPE(EOTID_VALIDATOR_BOOLEAN, NULL);
+
+const EtchObjectType* EtchValidatorBoolean::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_BOOLEAN, NULL);
+ return &TYPE;
+}
EtchValidatorBoolean::EtchValidatorBoolean(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorBoolean::TYPE, &EtchBool::TYPE, &EtchBool::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorBoolean::TYPE(), EtchBool::TYPE(), EtchBool::TYPE(), ndim) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorByte.h"
capu::SmartPointer<EtchValidator> EtchValidatorByte::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorByte::TYPE(EOTID_VALIDATOR_BYTE, NULL);
+
+const EtchObjectType* EtchValidatorByte::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_BYTE, NULL);
+ return &TYPE;
+}
EtchValidatorByte::EtchValidatorByte(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorByte::TYPE, &EtchByte::TYPE, &EtchByte::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorByte::TYPE(), EtchByte::TYPE(), EtchByte::TYPE(), ndim) {
}
@@ -39,17 +43,17 @@ capu::bool_t EtchValidatorByte::validate
if (value->getObjectType()->equals(mExpectedType))
return true;
- if (value->getObjectType()->equals(&EtchShort::TYPE)) {
+ if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
}
- if (value->getObjectType()->equals(&EtchInt32::TYPE)) {
+ if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
}
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
}
@@ -77,23 +81,23 @@ capu::bool_t EtchValidatorByte::validate
status_t EtchValidatorByte::validateValue(EtchObject* value, EtchObject*& result) {
if (validate(value)) {
- if ((value->getObjectType()->equals(&EtchByte::TYPE)) || (mNDims > 0)) {
+ if ((value->getObjectType()->equals(EtchByte::TYPE())) || (mNDims > 0)) {
result = value;
return ETCH_OK;
} else {
- if (value->getObjectType()->equals(&EtchShort::TYPE)) {
+ if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value;
result = (EtchObject*) (new EtchByte((capu::int8_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchByte *v = (EtchByte *) value;
result = (EtchObject*) (new EtchByte((capu::int8_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchInt32::TYPE)) {
+ if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value;
result = (EtchObject*) (new EtchByte((capu::int8_t)v->get()));
return ETCH_OK;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorDouble.h"
capu::SmartPointer<EtchValidator> EtchValidatorDouble::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorDouble::TYPE(EOTID_VALIDATOR_DOUBLE, NULL);
+
+const EtchObjectType* EtchValidatorDouble::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_DOUBLE, NULL);
+ return &TYPE;
+}
EtchValidatorDouble::EtchValidatorDouble(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorDouble::TYPE, &EtchDouble::TYPE, &EtchDouble::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorDouble::TYPE(), EtchDouble::TYPE(), EtchDouble::TYPE(), ndim) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorFloat.h"
capu::SmartPointer<EtchValidator> EtchValidatorFloat::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorFloat::TYPE(EOTID_VALIDATOR_FLOAT, NULL);
+
+const EtchObjectType* EtchValidatorFloat::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_FLOAT, NULL);
+ return &TYPE;
+}
EtchValidatorFloat::EtchValidatorFloat(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorFloat::TYPE, &EtchFloat::TYPE, &EtchFloat::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorFloat::TYPE(), EtchFloat::TYPE(), EtchFloat::TYPE(), ndim) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorInt.h"
capu::SmartPointer<EtchValidator> EtchValidatorInt::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorInt::TYPE(EOTID_VALIDATOR_INT, NULL);
+
+const EtchObjectType* EtchValidatorInt::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_INT, NULL);
+ return &TYPE;
+}
EtchValidatorInt::EtchValidatorInt(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorInt::TYPE, &EtchInt32::TYPE, &EtchInt32::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorInt::TYPE(), EtchInt32::TYPE(), EtchInt32::TYPE(), ndim) {
}
@@ -40,11 +44,11 @@ capu::bool_t EtchValidatorInt::validate(
if (value->getObjectType()->equals(mExpectedType))
return true;
- if ((value->getObjectType()->equals(&EtchShort::TYPE)) ||
- (value->getObjectType()->equals(&EtchByte::TYPE)))
+ if ((value->getObjectType()->equals(EtchShort::TYPE())) ||
+ (value->getObjectType()->equals(EtchByte::TYPE())))
return true;
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int32_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int32_t > ()));
}
@@ -72,23 +76,23 @@ capu::bool_t EtchValidatorInt::validate(
status_t EtchValidatorInt::validateValue(EtchObject* value, EtchObject*& result) {
if (validate(value)) {
- if ((value->getObjectType()->equals(&EtchInt32::TYPE)) || (mNDims > 0)) {
+ if ((value->getObjectType()->equals(EtchInt32::TYPE())) || (mNDims > 0)) {
result = value;
return ETCH_OK;
} else {
- if (value->getObjectType()->equals(&EtchShort::TYPE)) {
+ if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value;
result = (EtchObject*) (new EtchInt32((capu::int32_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchByte::TYPE)) {
+ if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value;
result = (EtchObject*) (new EtchInt32((capu::int32_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value;
result = (EtchObject*) (new EtchInt32((capu::int32_t)v->get()));
return ETCH_OK;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorLong.h"
capu::SmartPointer<EtchValidator> EtchValidatorLong::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorLong::TYPE(EOTID_VALIDATOR_LONG, NULL);
+
+const EtchObjectType* EtchValidatorLong::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_LONG, NULL);
+ return &TYPE;
+}
EtchValidatorLong::EtchValidatorLong(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorLong::TYPE, &EtchLong::TYPE, &EtchLong::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorLong::TYPE(), EtchLong::TYPE(), EtchLong::TYPE(), ndim) {
}
@@ -40,9 +44,9 @@ capu::bool_t EtchValidatorLong::validate
if (value->getObjectType()->equals(mExpectedType))
return true;
- if ((value->getObjectType()->equals(&EtchInt32::TYPE)) ||
- (value->getObjectType()->equals(&EtchShort::TYPE)) ||
- (value->getObjectType()->equals(&EtchByte::TYPE)))
+ if ((value->getObjectType()->equals(EtchInt32::TYPE())) ||
+ (value->getObjectType()->equals(EtchShort::TYPE())) ||
+ (value->getObjectType()->equals(EtchByte::TYPE())))
return true;
//handle array
@@ -66,23 +70,23 @@ capu::bool_t EtchValidatorLong::validate
status_t EtchValidatorLong::validateValue(EtchObject* value, EtchObject*& result) {
if (validate(value)) {
- if ((value->getObjectType()->equals(&EtchLong::TYPE)) || (mNDims > 0)) {
+ if ((value->getObjectType()->equals(EtchLong::TYPE())) || (mNDims > 0)) {
result = value;
return ETCH_OK;
} else {
- if (value->getObjectType()->equals(&EtchShort::TYPE)) {
+ if (value->getObjectType()->equals(EtchShort::TYPE())) {
EtchShort *v = (EtchShort *) value;
result = new EtchLong((capu::int64_t)v->get());
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchByte::TYPE)) {
+ if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value;
result = new EtchLong((capu::int64_t)v->get());
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchInt32::TYPE)) {
+ if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value;
result = new EtchLong((capu::int64_t)v->get());
return ETCH_OK;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp Fri Jun 1 11:47:57 2012
@@ -20,10 +20,14 @@
capu::SmartPointer<EtchValidator> EtchValidatorObject::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorObject::TYPE(EOTID_VALIDATOR_OBJECT, NULL);
+
+const EtchObjectType* EtchValidatorObject::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_OBJECT, NULL);
+ return &TYPE;
+}
EtchValidatorObject::EtchValidatorObject(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorObject::TYPE, &EtchObject::TYPE, &EtchObject::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorObject::TYPE(), EtchObject::TYPE(), EtchObject::TYPE(), ndim) {
mSubclass = true;
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorShort.h"
capu::SmartPointer<EtchValidator> EtchValidatorShort::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorShort::TYPE(EOTID_VALIDATOR_SHORT, NULL);
+
+const EtchObjectType* EtchValidatorShort::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_SHORT, NULL);
+ return &TYPE;
+}
EtchValidatorShort::EtchValidatorShort(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorShort::TYPE, &EtchShort::TYPE, &EtchShort::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorShort::TYPE(), EtchShort::TYPE(), EtchShort::TYPE(), ndim) {
}
@@ -40,16 +44,16 @@ capu::bool_t EtchValidatorShort::validat
if (value->getObjectType()->equals(mExpectedType))
return true;
- if ((value->getObjectType()->equals(&EtchShort::TYPE)) ||
- (value->getObjectType()->equals(&EtchByte::TYPE)))
+ if ((value->getObjectType()->equals(EtchShort::TYPE())) ||
+ (value->getObjectType()->equals(EtchByte::TYPE())))
return true;
- if (value->getObjectType()->equals(&EtchInt32::TYPE)) {
+ if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int16_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int16_t > ()));
}
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value;
return ((v->get() >= capu::NumericLimitMin<capu::int16_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int16_t > ()));
}
@@ -75,23 +79,23 @@ capu::bool_t EtchValidatorShort::validat
status_t EtchValidatorShort::validateValue(EtchObject* value, EtchObject*& result) {
if (validate(value)) {
- if ((value->getObjectType()->equals(&EtchShort::TYPE)) || (mNDims > 0)) {
+ if ((value->getObjectType()->equals(EtchShort::TYPE())) || (mNDims > 0)) {
result = value;
return ETCH_OK;
} else {
- if (value->getObjectType()->equals(&EtchInt32::TYPE)) {
+ if (value->getObjectType()->equals(EtchInt32::TYPE())) {
EtchInt32 *v = (EtchInt32 *) value;
result = (EtchObject*) (new EtchShort((capu::int16_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchByte::TYPE)) {
+ if (value->getObjectType()->equals(EtchByte::TYPE())) {
EtchByte *v = (EtchByte *) value;
result = (EtchObject*) (new EtchShort((capu::int16_t)v->get()));
return ETCH_OK;
}
- if (value->getObjectType()->equals(&EtchLong::TYPE)) {
+ if (value->getObjectType()->equals(EtchLong::TYPE())) {
EtchLong *v = (EtchLong *) value;
result = (EtchObject*) (new EtchShort((capu::int16_t)v->get()));
return ETCH_OK;
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp Fri Jun 1 11:47:57 2012
@@ -19,10 +19,14 @@
#include "serialization/EtchValidatorString.h"
capu::SmartPointer<EtchValidator> EtchValidatorString::mValidator[MAX_CACHED];
-const EtchObjectType EtchValidatorString::TYPE(EOTID_VALIDATOR_STRING, NULL);
+
+const EtchObjectType* EtchValidatorString::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALIDATOR_STRING, NULL);
+ return &TYPE;
+}
EtchValidatorString::EtchValidatorString(capu::uint32_t ndim)
-: EtchTypeValidator(&EtchValidatorString::TYPE, &EtchString::TYPE, &EtchString::TYPE, ndim) {
+: EtchTypeValidator(EtchValidatorString::TYPE(), EtchString::TYPE(), EtchString::TYPE(), ndim) {
}
Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValueFactory.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValueFactory.cpp?rev=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValueFactory.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValueFactory.cpp Fri Jun 1 11:47:57 2012
@@ -18,8 +18,11 @@
#include "serialization/EtchValueFactory.h"
-const EtchObjectType EtchValueFactory::TYPE(EOTID_VALUE_FACTORY, NULL);
+const EtchObjectType* EtchValueFactory::TYPE() {
+ const static EtchObjectType TYPE(EOTID_VALUE_FACTORY, NULL);
+ return &TYPE;
+}
EtchValueFactory::EtchValueFactory()
-: EtchObject(&EtchValueFactory::TYPE) {
+: EtchObject(EtchValueFactory::TYPE()) {
}
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=1345087&r1=1345086&r2=1345087&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt Fri Jun 1 11:47:57 2012
@@ -63,6 +63,7 @@ add_executable (etch-cpp-test
serialization/EtchTypeTest.cpp
serialization/EtchStructValueTest.cpp
serialization/EtchTypeMapTest.cpp
+ serialization/EtchClass2TypeMapTest.cpp
util/EtchUtilTest.cpp
${GTEST}/src/gtest-all.cc
${GMOCK}/src/gmock-all.cc