http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableHashSet.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableHashSet.hpp b/src/clicache/src/CacheableHashSet.hpp index b07b2d2..813bfa0 100644 --- a/src/clicache/src/CacheableHashSet.hpp +++ b/src/clicache/src/CacheableHashSet.hpp @@ -48,88 +48,88 @@ namespace Apache { public: - virtual void ToData(DataOutput^ output) override - { - output->WriteArrayLen(this->Count); + virtual void ToData(DataOutput^ output) override + { + output->WriteArrayLen(this->Count); - Internal::ManagedPtrWrap< apache::geode::client::Serializable, + Internal::ManagedPtrWrap< apache::geode::client::Serializable, Internal::SBWrap<apache::geode::client::Serializable> > nptr = NativePtr; - HSTYPE* set = static_cast<HSTYPE*>(nptr()); - for (typename HSTYPE::Iterator iter = set->begin(); - iter != set->end(); ++iter) { - //Generic::ICacheableKey^ key = SafeGenericUMKeyConvert<ICacheableKey^>((*iter).ptr()); - Object^ key = Serializable::GetManagedValueGeneric<Object^>((*iter)); - output->WriteObject(key); + HSTYPE* set = static_cast<HSTYPE*>(nptr()); + for (typename HSTYPE::Iterator iter = set->begin(); + iter != set->end(); ++iter) { + //Generic::ICacheableKey^ key = SafeGenericUMKeyConvert<ICacheableKey^>((*iter).ptr()); + Object^ key = Serializable::GetManagedValueGeneric<Object^>((*iter)); + output->WriteObject(key); + } } - } - virtual IGFSerializable^ FromData(DataInput^ input) override - { - int len = input->ReadArrayLen(); - if (len > 0) + virtual IGFSerializable^ FromData(DataInput^ input) override { - for ( int i = 0; i < len; i++) + int len = input->ReadArrayLen(); + if (len > 0) { - //Generic::ICacheableKey^ key = dynamic_cast<Client::ICacheableKey^>(input->ReadObject()); - Object^ key = (input->ReadObject()); - this->Add(key); + for (int i = 0; i < len; i++) + { + //Generic::ICacheableKey^ key = dynamic_cast<Client::ICacheableKey^>(input->ReadObject()); + Object^ key = (input->ReadObject()); + this->Add(key); + } } + return this; } - return this; - } - virtual property uint32_t ObjectSize - { - virtual uint32_t get() override + virtual property uint32_t ObjectSize { - uint32_t size = 0; - for each (Object^ key in this) { - if ( key != nullptr) - //size += key->ObjectSize; - //TODO:: how should we do this now - size += 1; + virtual uint32_t get() override + { + uint32_t size = 0; + for each (Object^ key in this) { + if (key != nullptr) + //size += key->ObjectSize; + //TODO:: how should we do this now + size += 1; + } + return size; } - return size; } - } - virtual int GetHashCode() override - { - IEnumerator<Object^>^ ie = GetEnumerator(); - - int h = 0; - while(ie->MoveNext() == true) + virtual int GetHashCode() override { - h = h + PdxInstanceImpl::deepArrayHashCode(ie->Current); - } - return h; - } + IEnumerator<Object^>^ ie = GetEnumerator(); - virtual bool Equals(Object^ other)override - { - if(other == nullptr) - return false; + int h = 0; + while (ie->MoveNext() == true) + { + h = h + PdxInstanceImpl::deepArrayHashCode(ie->Current); + } + return h; + } - CacheableHashSetType^ otherCHST = dynamic_cast<CacheableHashSetType^>(other); - - if(otherCHST == nullptr) - return false; + virtual bool Equals(Object^ other)override + { + if (other == nullptr) + return false; - if(Count != otherCHST->Count) - return false; + CacheableHashSetType^ otherCHST = dynamic_cast<CacheableHashSetType^>(other); - IEnumerator<Object^>^ ie = GetEnumerator(); + if (otherCHST == nullptr) + return false; - while(ie->MoveNext() == true) - { - if(otherCHST->Contains(ie->Current)) - return true; - else + if (Count != otherCHST->Count) return false; - } - return true; - } + IEnumerator<Object^>^ ie = GetEnumerator(); + + while (ie->MoveNext() == true) + { + if (otherCHST->Contains(ie->Current)) + return true; + else + return false; + } + + return true; + } /// <summary> /// Enumerator for <c>CacheableHashSet</c> class. @@ -211,8 +211,8 @@ namespace Apache /// </summary> /// <param name="nativeptr">The native object pointer</param> inline Enumerator(typename HSTYPE::Iterator* nativeptr, - CacheableHashSetType<TYPEID, HSTYPE>^ set) - : UMWrap(nativeptr, true), m_set(set) { } + CacheableHashSetType<TYPEID, HSTYPE>^ set) + : UMWrap(nativeptr, true), m_set(set) { } private: // Region: IEnumerator Members @@ -384,7 +384,7 @@ namespace Apache { if (array == nullptr || arrayIndex < 0) { throw gcnew IllegalArgumentException("CacheableHashSet.CopyTo():" - " array is null or array index is less than zero"); + " array is null or array index is less than zero"); } Internal::ManagedPtrWrap< apache::geode::client::Serializable, Internal::SBWrap<apache::geode::client::Serializable> > nptr = NativePtr; @@ -392,15 +392,15 @@ namespace Apache int32_t index = arrayIndex; if (arrayIndex >= array->Length || - array->Length < (arrayIndex + (int32_t)set->size())) { - throw gcnew OutOfRangeException("CacheableHashSet.CopyTo():" - " array index is beyond the HashSet or length of given " - "array is less than that required to copy all the " - "elements from HashSet"); + array->Length < (arrayIndex + (int32_t)set->size())) { + throw gcnew OutOfRangeException("CacheableHashSet.CopyTo():" + " array index is beyond the HashSet or length of given " + "array is less than that required to copy all the " + "elements from HashSet"); } for (typename HSTYPE::Iterator iter = set->begin(); - iter != set->end(); ++iter, ++index) { - array[index] = Serializable::GetManagedValueGeneric<Object^>((*iter)); + iter != set->end(); ++iter, ++index) { + array[index] = Serializable::GetManagedValueGeneric<Object^>((*iter)); } GC::KeepAlive(this); } @@ -479,7 +479,7 @@ namespace Apache static IGFSerializable^ Create(apache::geode::client::Serializable* obj) { return (obj != NULL ? - gcnew CacheableHashSetType<TYPEID,HSTYPE>(obj) : nullptr); + gcnew CacheableHashSetType<TYPEID, HSTYPE>(obj) : nullptr); } private: @@ -498,7 +498,7 @@ namespace Apache return GetEnumerator(); } - // End Region: IEnumerable Members + // End Region: IEnumerable Members protected: /// <summary> @@ -519,67 +519,67 @@ namespace Apache /// Allocates a new empty instance with given initial size. /// </summary> /// <param name="size">The initial size of the HashSet.</param> - inline CacheableHashSetType<TYPEID,HSTYPE>(int32_t size) + inline CacheableHashSetType<TYPEID, HSTYPE>(int32_t size) : Serializable(HSTYPE::create(size).ptr()) { } }; } #define _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(m, HSTYPE) \ - public ref class m : public Internal::CacheableHashSetType<Apache::Geode::Client::GemFireClassIds::m, HSTYPE> \ - { \ + public ref class m : public Internal::CacheableHashSetType<Apache::Geode::Client::GeodeClassIds::m, HSTYPE> \ + { \ public: \ /** <summary> - * Allocates a new empty instance. - * </summary> - */ \ - inline m() \ - : Internal::CacheableHashSetType<Apache::Geode::Client::GemFireClassIds::m, HSTYPE>() {} \ - \ - /** <summary> - * Allocates a new instance with the given size. - * </summary> - * <param name="size">the intial size of the new instance</param> - */ \ - inline m(int32_t size) \ - : Internal::CacheableHashSetType<Apache::Geode::Client::GemFireClassIds::m, HSTYPE>(size) {} \ - \ - /** <summary> - * Static function to create a new empty instance. - * </summary> - */ \ + * Allocates a new empty instance. + * </summary> + */ \ + inline m() \ + : Internal::CacheableHashSetType<Apache::Geode::Client::GeodeClassIds::m, HSTYPE>() {} \ + \ + /** <summary> + * Allocates a new instance with the given size. + * </summary> + * <param name="size">the intial size of the new instance</param> + */ \ + inline m(int32_t size) \ + : Internal::CacheableHashSetType<Apache::Geode::Client::GeodeClassIds::m, HSTYPE>(size) {} \ + \ + /** <summary> + * Static function to create a new empty instance. + * </summary> + */ \ inline static m^ Create() \ - { \ - return gcnew m(); \ - } \ - \ - /** <summary> - * Static function to create a new instance with the given size. - * </summary> - */ \ - inline static m^ Create(int32_t size) \ - { \ - return gcnew m(size); \ - } \ - \ - /* <summary> - * Factory function to register this class. - * </summary> - */ \ - static IGFSerializable^ CreateDeserializable() \ - { \ - return gcnew m(); \ - } \ - \ - internal: \ - static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ - { \ - return gcnew m(obj); \ - } \ - \ - private: \ - inline m(apache::geode::client::Serializable* nativeptr) \ - : Internal::CacheableHashSetType<Apache::Geode::Client::GemFireClassIds::m, HSTYPE>(nativeptr) { } \ + { \ + return gcnew m(); \ + } \ + \ + /** <summary> + * Static function to create a new instance with the given size. + * </summary> + */ \ + inline static m^ Create(int32_t size) \ + { \ + return gcnew m(size); \ + } \ + \ + /* <summary> + * Factory function to register this class. + * </summary> + */ \ + static IGFSerializable^ CreateDeserializable() \ + { \ + return gcnew m(); \ + } \ + \ + internal: \ + static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ + { \ + return gcnew m(obj); \ + } \ + \ + private: \ + inline m(apache::geode::client::Serializable* nativeptr) \ + : Internal::CacheableHashSetType<Apache::Geode::Client::GeodeClassIds::m, HSTYPE>(nativeptr) { } \ }; /// <summary> @@ -587,7 +587,7 @@ namespace Apache /// a distributable object for caching. /// </summary> _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(CacheableHashSet, - apache::geode::client::CacheableHashSet); + apache::geode::client::CacheableHashSet); /// <summary> /// A mutable <c>ICacheableKey</c> hash set wrapper that can serve as @@ -597,7 +597,7 @@ namespace Apache /// java <c>LinkedHashSet</c>. /// </summary> _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(CacheableLinkedHashSet, - apache::geode::client::CacheableLinkedHashSet); + apache::geode::client::CacheableLinkedHashSet); } // namespace Client } // namespace Geode } // namespace Apache
http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableHashTable.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableHashTable.hpp b/src/clicache/src/CacheableHashTable.hpp index e1ed025..3e66bed 100644 --- a/src/clicache/src/CacheableHashTable.hpp +++ b/src/clicache/src/CacheableHashTable.hpp @@ -82,7 +82,7 @@ namespace Apache { virtual uint32_t get() override { - return GemFireClassIds::CacheableHashTable; + return GeodeClassIds::CacheableHashTable; } } http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableIdentityHashMap.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableIdentityHashMap.hpp b/src/clicache/src/CacheableIdentityHashMap.hpp index 6c30dd4..fbcc900 100644 --- a/src/clicache/src/CacheableIdentityHashMap.hpp +++ b/src/clicache/src/CacheableIdentityHashMap.hpp @@ -108,7 +108,7 @@ namespace Apache { virtual uint32_t get() override { - return GemFireClassIds::CacheableIdentityHashMap; + return GeodeClassIds::CacheableIdentityHashMap; } } http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableLinkedList.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableLinkedList.hpp b/src/clicache/src/CacheableLinkedList.hpp index 68a1dea..d6f5cd0 100644 --- a/src/clicache/src/CacheableLinkedList.hpp +++ b/src/clicache/src/CacheableLinkedList.hpp @@ -79,47 +79,47 @@ namespace Apache { virtual uint32_t get() { - return GemFireClassIds::CacheableLinkedList; + return GeodeClassIds::CacheableLinkedList; } } // Region: IGFSerializable Members - virtual void ToData(DataOutput^ output) - { - if(m_linkedList != nullptr) + virtual void ToData(DataOutput^ output) { - output->WriteArrayLen(m_linkedList->Count); - for each (Object^ obj in m_linkedList) { - //TODO::split - output->WriteObject(obj); + if (m_linkedList != nullptr) + { + output->WriteArrayLen(m_linkedList->Count); + for each (Object^ obj in m_linkedList) { + //TODO::split + output->WriteObject(obj); + } } + else + output->WriteByte(0xFF); } - else - output->WriteByte(0xFF); - } - virtual IGFSerializable^ FromData(DataInput^ input) - { - int len = input->ReadArrayLen(); - for( int i = 0; i < len; i++) + virtual IGFSerializable^ FromData(DataInput^ input) { - m_linkedList->AddLast(input->ReadObject()); + int len = input->ReadArrayLen(); + for (int i = 0; i < len; i++) + { + m_linkedList->AddLast(input->ReadObject()); + } + return this; } - return this; - } - /*uint32_t ObjectSize::get() - { + /*uint32_t ObjectSize::get() + { //TODO:: uint32_t size = static_cast<uint32_t> (sizeof(CacheableVector^)); for each (IGFSerializable^ val in this) { - if (val != nullptr) { - size += val->ObjectSize; - } + if (val != nullptr) { + size += val->ObjectSize; + } } return m_linkedList->Count; - }*/ + }*/ virtual property uint32_t ObjectSize { http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableObject.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableObject.hpp b/src/clicache/src/CacheableObject.hpp index 719f204..3f07c3e 100644 --- a/src/clicache/src/CacheableObject.hpp +++ b/src/clicache/src/CacheableObject.hpp @@ -19,7 +19,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -63,7 +63,7 @@ namespace Apache inline static CacheableObject^ Create(Object^ value) { return (value != nullptr ? gcnew CacheableObject(value) : - nullptr); + nullptr); } /// <summary> @@ -103,7 +103,7 @@ namespace Apache { inline virtual uint32_t get() { - return GemFireClassIds::CacheableManagedObject; + return GeodeClassIds::CacheableManagedObject; } } @@ -144,7 +144,7 @@ namespace Apache inline CacheableObject(Object^ value) : m_obj(value), m_objectSize(0) { } - + private: Object^ m_obj; http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableObjectArray.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableObjectArray.hpp b/src/clicache/src/CacheableObjectArray.hpp index 948b65f..f754b6d 100644 --- a/src/clicache/src/CacheableObjectArray.hpp +++ b/src/clicache/src/CacheableObjectArray.hpp @@ -19,7 +19,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -133,7 +133,7 @@ namespace Apache { virtual uint32_t get() { - return GemFireClassIds::CacheableObjectArray; + return GeodeClassIds::CacheableObjectArray; } } http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableObjectXml.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableObjectXml.hpp b/src/clicache/src/CacheableObjectXml.hpp index 7d36ad5..3e79d01 100644 --- a/src/clicache/src/CacheableObjectXml.hpp +++ b/src/clicache/src/CacheableObjectXml.hpp @@ -19,7 +19,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -66,7 +66,7 @@ namespace Apache inline static CacheableObjectXml^ Create(Object^ value) { return (value != nullptr ? gcnew CacheableObjectXml(value) : - nullptr); + nullptr); } /// <summary> @@ -106,7 +106,7 @@ namespace Apache { inline virtual uint32_t get() { - return GemFireClassIds::CacheableManagedObjectXml; + return GeodeClassIds::CacheableManagedObjectXml; } } http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableStack.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableStack.cpp b/src/clicache/src/CacheableStack.cpp index a6525c4..6cb50b5 100644 --- a/src/clicache/src/CacheableStack.cpp +++ b/src/clicache/src/CacheableStack.cpp @@ -23,7 +23,7 @@ #include "DataInput.hpp" #include <GeodeTypeIdsImpl.hpp> #include "impl/SafeConvert.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; using namespace System::Collections::Generic; @@ -39,11 +39,11 @@ namespace Apache void CacheableStack::ToData(DataOutput^ output) { - if(m_stack != nullptr) + if (m_stack != nullptr) { output->WriteArrayLen((int32_t)m_stack->Count); for each (Object^ obj in m_stack) { - output->WriteObject(obj); + output->WriteObject(obj); } } else @@ -58,10 +58,10 @@ namespace Apache if (len > 0) { System::Collections::Generic::Stack<Object^>^ stack = safe_cast<System::Collections::Generic::Stack<Object^>^>(m_stack); - for( int i = 0; i < len; i++) + for (int i = 0; i < len; i++) { (stack)->Push(input->ReadObject()); -// Push(input->ReadObject()); + // Push(input->ReadObject()); } } return this; @@ -69,22 +69,22 @@ namespace Apache uint32_t CacheableStack::ClassId::get() { - return GemFireClassIds::CacheableStack; + return GeodeClassIds::CacheableStack; } uint32_t CacheableStack::ObjectSize::get() - { + { //TODO: /*uint32_t size = static_cast<uint32_t> (sizeof(CacheableStack^)); for each (IGFSerializable^ val in this) { - if (val != nullptr) { - size += val->ObjectSize; - } + if (val != nullptr) { + size += val->ObjectSize; + } }*/ return m_stack->Count; - } // namespace Client - } // namespace Geode -} // namespace Apache + } // namespace Client + } // namespace Geode + } // namespace Apache - } //namespace +} //namespace http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableString.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableString.cpp b/src/clicache/src/CacheableString.cpp index 181be6d..fe998e9 100644 --- a/src/clicache/src/CacheableString.cpp +++ b/src/clicache/src/CacheableString.cpp @@ -35,12 +35,12 @@ namespace Apache void CacheableString::ToData(DataOutput^ output) { - if (m_type == GemFireClassIds::CacheableASCIIString || - m_type == GemFireClassIds::CacheableString) + if (m_type == GeodeClassIds::CacheableASCIIString || + m_type == GeodeClassIds::CacheableString) { output->WriteUTF(m_value); } - else if (m_type == GemFireClassIds::CacheableASCIIStringHuge) + else if (m_type == GeodeClassIds::CacheableASCIIStringHuge) { output->WriteASCIIHuge(m_value); } @@ -50,18 +50,18 @@ namespace Apache } } - IGFSerializable^ CacheableString::FromData(DataInput^ input) + IGFSerializable^ CacheableString::FromData(DataInput^ input) { - if (m_type == GemFireClassIds::CacheableASCIIString || - m_type == GemFireClassIds::CacheableString) + if (m_type == GeodeClassIds::CacheableASCIIString || + m_type == GeodeClassIds::CacheableString) { m_value = input->ReadUTF(); } - else if (m_type == GemFireClassIds::CacheableASCIIStringHuge) + else if (m_type == GeodeClassIds::CacheableASCIIStringHuge) { m_value = input->ReadASCIIHuge(); } - else + else { m_value = input->ReadUTFHuge(); } @@ -71,7 +71,7 @@ namespace Apache inline void CacheableString::GetCacheableString(String^ value, - apache::geode::client::CacheableStringPtr& cStr) + apache::geode::client::CacheableStringPtr& cStr) { size_t len; if (value != nullptr && (len = value->Length) > 0) { @@ -85,7 +85,7 @@ namespace Apache } inline void CacheableString::GetCacheableString(array<Char>^ value, - apache::geode::client::CacheableStringPtr& cStr) + apache::geode::client::CacheableStringPtr& cStr) { size_t len; if (value != nullptr && (len = value->Length) > 0) { @@ -102,9 +102,9 @@ namespace Apache CacheableString::CacheableString(String^ value) : CacheableKey() { - if (value == nullptr ) { + if (value == nullptr) { throw gcnew IllegalArgumentException("CacheableString: null or " + - "zero-length string provided to the constructor."); + "zero-length string provided to the constructor."); } m_value = value; @@ -114,12 +114,12 @@ namespace Apache CacheableString::CacheableString(array<Char>^ value) : CacheableKey() { - if (value == nullptr ) { + if (value == nullptr) { throw gcnew IllegalArgumentException("CacheableString: null or " + - "zero-length character array provided to the constructor."); + "zero-length character array provided to the constructor."); } m_value = gcnew String(value); - + this->SetStringType(); } @@ -175,12 +175,12 @@ namespace Apache } //TODO: need to need java hashcode //return m_value->GetHashCode(); - if(m_hashcode == 0) + if (m_hashcode == 0) { int32_t prime = 31; int32_t localHash = 0; - for (int32_t i = 0; i < m_value->Length; i++) - localHash = prime*localHash + m_value[i]; + for (int32_t i = 0; i < m_value->Length; i++) + localHash = prime*localHash + m_value[i]; m_hashcode = localHash; } return m_hashcode; @@ -189,24 +189,24 @@ namespace Apache void CacheableString::SetStringType() { int len = DataOutput::getEncodedLength(m_value); - + if (len == m_value->Length)//ASCII string { if (len > 0xFFFF) - m_type = GemFireClassIds::CacheableASCIIStringHuge; + m_type = GeodeClassIds::CacheableASCIIStringHuge; else - m_type = GemFireClassIds::CacheableASCIIString; + m_type = GeodeClassIds::CacheableASCIIString; } else { if (len > 0xFFFF) - m_type = GemFireClassIds::CacheableStringHuge; + m_type = GeodeClassIds::CacheableStringHuge; else - m_type = GemFireClassIds::CacheableString; - } // namespace Client - } // namespace Geode -} // namespace Apache + m_type = GeodeClassIds::CacheableString; + } // namespace Client + } // namespace Geode + } // namespace Apache -} - } //namespace + } +} //namespace http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableString.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableString.hpp b/src/clicache/src/CacheableString.hpp index 1641e7b..3c156b4 100644 --- a/src/clicache/src/CacheableString.hpp +++ b/src/clicache/src/CacheableString.hpp @@ -23,7 +23,7 @@ #include <gfcpp/CacheableString.hpp> #include "impl/ManagedString.hpp" #include "CacheableKey.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -74,7 +74,7 @@ namespace Apache inline static CacheableString^ Create(String^ value) { return (value != nullptr ? - gcnew CacheableString(value, true) : nullptr); + gcnew CacheableString(value, true) : nullptr); } /// <summary> @@ -109,7 +109,7 @@ namespace Apache } } - + /// <summary> /// return the size of this object in bytes /// </summary> @@ -132,9 +132,9 @@ namespace Apache inline static CacheableString^ Create(array<Char>^ value) { return (value != nullptr && value->Length > 0 ? - gcnew CacheableString(value, true) : nullptr); + gcnew CacheableString(value, true) : nullptr); } - + /// <summary> /// Return a string representation of the object. /// This returns the same string as <c>Value</c> property. @@ -174,7 +174,7 @@ namespace Apache } } - /// <summary> + /// <summary> /// Static function to check whether IsNullOrEmpty. /// </summary> /// <remarks> @@ -189,7 +189,7 @@ namespace Apache /// <summary> /// Implicit conversion operator to underlying <c>System.String</c>. /// </summary> - inline static operator String^ (CacheableString^ str) + inline static operator String ^ (CacheableString^ str) { return (str != nullptr ? CacheableString::GetString(str) : nullptr); } @@ -219,22 +219,22 @@ namespace Apache internal: static IGFSerializable^ CreateDeserializable() { - return gcnew CacheableString(GemFireClassIds::CacheableASCIIString); + return gcnew CacheableString(GeodeClassIds::CacheableASCIIString); } - + static IGFSerializable^ createDeserializableHuge() { - return gcnew CacheableString(GemFireClassIds::CacheableASCIIStringHuge); + return gcnew CacheableString(GeodeClassIds::CacheableASCIIStringHuge); } static IGFSerializable^ createUTFDeserializable() { - return gcnew CacheableString(GemFireClassIds::CacheableString); + return gcnew CacheableString(GeodeClassIds::CacheableString); } static IGFSerializable^ createUTFDeserializableHuge() { - return gcnew CacheableString(GemFireClassIds::CacheableStringHuge); + return gcnew CacheableString(GeodeClassIds::CacheableStringHuge); } /// <summary> /// Factory function to register wrapper @@ -242,7 +242,7 @@ namespace Apache static IGFSerializable^ Create(apache::geode::client::Serializable* obj) { return (obj != nullptr ? - gcnew CacheableString(obj) : nullptr); + gcnew CacheableString(obj) : nullptr); } /// <summary> @@ -250,14 +250,14 @@ namespace Apache /// from the given managed string. /// </summary> static void GetCacheableString(String^ value, - apache::geode::client::CacheableStringPtr& cStr); + apache::geode::client::CacheableStringPtr& cStr); /// <summary> /// Internal function to create a <c>apache::geode::client::CacheableString</c> /// from the given managed array of characters. /// </summary> static void GetCacheableString(array<Char>^ value, - apache::geode::client::CacheableStringPtr& cStr); + apache::geode::client::CacheableStringPtr& cStr); /// <summary> /// Get the <c>System.String</c> from the given @@ -281,21 +281,21 @@ namespace Apache return cStr->Value; } - CacheableString(uint32_t type): CacheableKey() + CacheableString(uint32_t type) : CacheableKey() { m_type = type; } private: String^ m_value; - uint32_t m_type; + uint32_t m_type; int m_hashcode; - CacheableString(): CacheableKey() + CacheableString() : CacheableKey() { - m_type = GemFireClassIds::CacheableASCIIString; - } - + m_type = GeodeClassIds::CacheableASCIIString; + } + void SetStringType(); /// <summary> /// Private constructor to create a CacheableString without checking http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableStringArray.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableStringArray.hpp b/src/clicache/src/CacheableStringArray.hpp index e8fba28..60075d5 100644 --- a/src/clicache/src/CacheableStringArray.hpp +++ b/src/clicache/src/CacheableStringArray.hpp @@ -22,7 +22,7 @@ #include "gf_defs.hpp" #include <gfcpp/CacheableBuiltins.hpp> #include "Serializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" #include "CacheableString.hpp" using namespace System; @@ -58,10 +58,10 @@ namespace Apache inline static CacheableStringArray^ Create(array<String^>^ strings) { return (strings != nullptr && strings->Length > 0 ? - gcnew CacheableStringArray(strings) : nullptr); + gcnew CacheableStringArray(strings) : nullptr); } - - /// <summary> + + /// <summary> /// Serializes this managed object. /// </summary> /// <param name="output"> @@ -90,7 +90,7 @@ namespace Apache { virtual uint32_t get() override { - return GemFireClassIds::CacheableStringArray; + return GeodeClassIds::CacheableStringArray; } } @@ -101,12 +101,12 @@ namespace Apache { virtual uint32_t get() override { - int size = 0; - for( int i = 0; i < m_value->Length; i++ ) + int size = 0; + for (int i = 0; i < m_value->Length; i++) { size += m_value[i]->Length; } - return (uint32_t) (size + sizeof(this)); + return (uint32_t)(size + sizeof(this)); } } @@ -155,7 +155,7 @@ namespace Apache static IGFSerializable^ Create(apache::geode::client::Serializable* obj) { return (obj != nullptr ? - gcnew CacheableStringArray(obj) : nullptr); + gcnew CacheableStringArray(obj) : nullptr); } private: @@ -170,8 +170,8 @@ namespace Apache inline CacheableStringArray() - : Serializable() - { + : Serializable() + { //apache::geode::client::Serializable* sp = apache::geode::client::CacheableStringArray::createDeserializable(); //SetSP(sp); } http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableUndefined.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableUndefined.hpp b/src/clicache/src/CacheableUndefined.hpp index ec414be..876ee2c 100644 --- a/src/clicache/src/CacheableUndefined.hpp +++ b/src/clicache/src/CacheableUndefined.hpp @@ -19,7 +19,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" #include "Log.hpp" using namespace System; @@ -89,7 +89,7 @@ namespace Apache { inline virtual uint32_t get() { - return GemFireClassIds::CacheableUndefined; + return GeodeClassIds::CacheableUndefined; } } @@ -100,7 +100,7 @@ namespace Apache /// </summary> static IGFSerializable^ CreateDeserializable() { - return gcnew CacheableUndefined(); + return gcnew CacheableUndefined(); } }; } // namespace Client http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CacheableVector.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableVector.hpp b/src/clicache/src/CacheableVector.hpp index 666e3a8..5df0c3e 100644 --- a/src/clicache/src/CacheableVector.hpp +++ b/src/clicache/src/CacheableVector.hpp @@ -19,7 +19,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -44,12 +44,12 @@ namespace Apache /// <summary> /// Allocates a new empty instance. /// </summary> - inline CacheableVector(System::Collections::IList^ arrayList) - { + inline CacheableVector(System::Collections::IList^ arrayList) + { m_arrayList = arrayList; } - + /// <summary> /// Static function to create a new empty instance. /// </summary> @@ -66,7 +66,7 @@ namespace Apache return gcnew CacheableVector(list); } - + // Region: IGFSerializable Members /// <summary> @@ -105,7 +105,7 @@ namespace Apache { virtual uint32_t get() { - return GemFireClassIds::CacheableVector; + return GeodeClassIds::CacheableVector; } } @@ -127,8 +127,8 @@ namespace Apache return gcnew CacheableVector(gcnew System::Collections::ArrayList()); } - private: - System::Collections::IList^ m_arrayList; + private: + System::Collections::IList^ m_arrayList; }; } // namespace Client } // namespace Geode http://git-wip-us.apache.org/repos/asf/geode/blob/fc9f1f6f/src/clicache/src/CqEvent.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CqEvent.cpp b/src/clicache/src/CqEvent.cpp index dc1e2b0..26fb19f 100644 --- a/src/clicache/src/CqEvent.cpp +++ b/src/clicache/src/CqEvent.cpp @@ -68,8 +68,7 @@ namespace Apache apache::geode::client::CacheableBytesPtr deltaBytes = NativePtr->getDeltaValue( ); CacheableBytes^ managedDeltaBytes = ( CacheableBytes^ ) CacheableBytes::Create( deltaBytes.ptr( ) ); return ( array< Byte >^ ) managedDeltaBytes; + } } // namespace Client } // namespace Geode -} // namespace Apache - - } //namespace +} //namespace Apache