[
https://issues.apache.org/jira/browse/GEODE-4082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16288384#comment-16288384
]
ASF GitHub Bot commented on GEODE-4082:
---------------------------------------
pivotal-jbarrett closed pull request #168: GEODE-4082: Changes objectSize to
return size_t.
URL: https://github.com/apache/geode-native/pull/168
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/clicache/integration-test/DefaultCacheableN.cs
b/clicache/integration-test/DefaultCacheableN.cs
index 2751e281..552686e4 100644
--- a/clicache/integration-test/DefaultCacheableN.cs
+++ b/clicache/integration-test/DefaultCacheableN.cs
@@ -212,7 +212,7 @@ public void FromData(DataInput input)
}
}
- public uint ObjectSize
+ public UInt64 ObjectSize
{
get { return 100; }//need to implement
}
diff --git a/clicache/integration-test/SerializationTestsN.cs
b/clicache/integration-test/SerializationTestsN.cs
index 61fb58d9..ad5fed0a 100644
--- a/clicache/integration-test/SerializationTestsN.cs
+++ b/clicache/integration-test/SerializationTestsN.cs
@@ -494,7 +494,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
@@ -641,7 +641,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
@@ -789,7 +789,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
@@ -936,7 +936,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
@@ -1084,7 +1084,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
@@ -1232,7 +1232,7 @@ public void ToData(DataOutput output)
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
diff --git a/clicache/integration-test/ThinClientDeltaTestN.cs
b/clicache/integration-test/ThinClientDeltaTestN.cs
index 0c8f1a00..66c56b6a 100644
--- a/clicache/integration-test/ThinClientDeltaTestN.cs
+++ b/clicache/integration-test/ThinClientDeltaTestN.cs
@@ -131,7 +131,7 @@ public void FromData(DataInput input)
_staticData = input.ReadUTF();
}
- public uint ObjectSize
+ public UInt64 ObjectSize
{
get { return (uint)(4 + _staticData.Length); }
}
diff --git a/clicache/integration-test/ThinClientRegionTestsN.cs
b/clicache/integration-test/ThinClientRegionTestsN.cs
index 110e7b73..52eaf378 100644
--- a/clicache/integration-test/ThinClientRegionTestsN.cs
+++ b/clicache/integration-test/ThinClientRegionTestsN.cs
@@ -261,7 +261,7 @@ public UInt32 ClassId
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
diff --git a/clicache/src/CacheableBuiltins.hpp
b/clicache/src/CacheableBuiltins.hpp
index 527eabc4..2e9cdad0 100644
--- a/clicache/src/CacheableBuiltins.hpp
+++ b/clicache/src/CacheableBuiltins.hpp
@@ -217,11 +217,11 @@ namespace Apache
input->ReadObject(m_value);
}
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get() override
+ virtual System::UInt64 get() override
{
- return (System::UInt32)(m_value->Length) * sizeof(TManaged);
+ return m_value->Length * sizeof(TManaged);
}
}
/// <summary>
diff --git a/clicache/src/CacheableDate.cpp b/clicache/src/CacheableDate.cpp
index f4258ebd..986fe87b 100644
--- a/clicache/src/CacheableDate.cpp
+++ b/clicache/src/CacheableDate.cpp
@@ -64,9 +64,9 @@ namespace Apache
//Log::Fine("CacheableDate::Fromadata time " + m_dateTime.Ticks);
}
- System::UInt32 CacheableDate::ObjectSize::get()
+ System::UInt64 CacheableDate::ObjectSize::get()
{
- return (System::UInt32)sizeof(DateTime);
+ return sizeof(DateTime);
}
System::UInt32 CacheableDate::ClassId::get()
diff --git a/clicache/src/CacheableDate.hpp b/clicache/src/CacheableDate.hpp
index eb6d5eff..b0941539 100644
--- a/clicache/src/CacheableDate.hpp
+++ b/clicache/src/CacheableDate.hpp
@@ -96,9 +96,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableFileName.cpp
b/clicache/src/CacheableFileName.cpp
index 09b0bd57..639c1d00 100644
--- a/clicache/src/CacheableFileName.cpp
+++ b/clicache/src/CacheableFileName.cpp
@@ -57,9 +57,9 @@ namespace Apache
return GeodeClassIds::CacheableFileName;
}
- System::UInt32 CacheableFileName::ObjectSize::get()
+ System::UInt64 CacheableFileName::ObjectSize::get()
{
- return (System::UInt32)(m_str->Length * sizeof(char));
+ return m_str->Length * sizeof(char);
}
System::Int32 CacheableFileName::GetHashCode()
diff --git a/clicache/src/CacheableFileName.hpp
b/clicache/src/CacheableFileName.hpp
index 4de1d642..d31df9f7 100644
--- a/clicache/src/CacheableFileName.hpp
+++ b/clicache/src/CacheableFileName.hpp
@@ -83,9 +83,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableHashMap.cpp
b/clicache/src/CacheableHashMap.cpp
index f9683bb6..7c3a3ac8 100644
--- a/clicache/src/CacheableHashMap.cpp
+++ b/clicache/src/CacheableHashMap.cpp
@@ -44,11 +44,10 @@ namespace Apache
m_dictionary = input->ReadDictionary();
}
- System::UInt32 Client::CacheableHashMap::ObjectSize::get()
+ System::UInt64 Client::CacheableHashMap::ObjectSize::get()
{
return ((System::Collections::IDictionary^)m_dictionary)->Count;
+ }
} // namespace Client
} // namespace Geode
} // namespace Apache
-
- } //namespace
diff --git a/clicache/src/CacheableHashMap.hpp
b/clicache/src/CacheableHashMap.hpp
index b080fa6c..75016671 100644
--- a/clicache/src/CacheableHashMap.hpp
+++ b/clicache/src/CacheableHashMap.hpp
@@ -105,9 +105,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableHashSet.hpp
b/clicache/src/CacheableHashSet.hpp
index 306d9fc1..2e6e6ed1 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -78,11 +78,11 @@ namespace Apache
}
}
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get() override
+ virtual System::UInt64 get() override
{
- System::UInt32 size = 0;
+ System::UInt64 size = 0;
for each (Object^ key in this) {
if (key != nullptr)
//size += key->ObjectSize;
diff --git a/clicache/src/CacheableLinkedList.hpp
b/clicache/src/CacheableLinkedList.hpp
index c1f552a2..7228705c 100644
--- a/clicache/src/CacheableLinkedList.hpp
+++ b/clicache/src/CacheableLinkedList.hpp
@@ -109,21 +109,9 @@ namespace Apache
}
}
- /*System::UInt32 ObjectSize::get()
+ virtual property System::UInt64 ObjectSize
{
- //TODO::
- System::UInt32 size = static_cast<System::UInt32>
(sizeof(CacheableVector^));
- for each (IGeodeSerializable^ val in this) {
- if (val != nullptr) {
- size += val->ObjectSize;
- }
- }
- return m_linkedList->Count;
- }*/
-
- virtual property System::UInt32 ObjectSize
- {
- virtual System::UInt32 get()
+ virtual System::UInt64 get()
{
return m_linkedList->Count;
}
diff --git a/clicache/src/CacheableObject.cpp b/clicache/src/CacheableObject.cpp
index 9b89a929..1b15069e 100644
--- a/clicache/src/CacheableObject.cpp
+++ b/clicache/src/CacheableObject.cpp
@@ -62,14 +62,14 @@ namespace Apache
m_objectSize = dis.BytesRead - checkpoint;
}
- System::UInt32 CacheableObject::ObjectSize::get()
+ System::UInt64 CacheableObject::ObjectSize::get()
{
if (m_objectSize == 0) {
GeodeNullStream ns;
BinaryFormatter bf;
bf.Serialize(%ns, m_obj);
- m_objectSize = (System::UInt32)sizeof(CacheableObject^) +
(System::UInt32)ns.Length;
+ m_objectSize = sizeof(CacheableObject^) + ns.Length;
}
return m_objectSize;
} // namespace Client
diff --git a/clicache/src/CacheableObject.hpp b/clicache/src/CacheableObject.hpp
index c5331ff3..db85b2ee 100644
--- a/clicache/src/CacheableObject.hpp
+++ b/clicache/src/CacheableObject.hpp
@@ -89,9 +89,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
@@ -149,7 +149,7 @@ namespace Apache
private:
Object^ m_obj;
- System::UInt32 m_objectSize;
+ System::UInt64 m_objectSize;
};
} // namespace Client
} // namespace Geode
diff --git a/clicache/src/CacheableObjectArray.cpp
b/clicache/src/CacheableObjectArray.cpp
index 11385632..7c328df0 100644
--- a/clicache/src/CacheableObjectArray.cpp
+++ b/clicache/src/CacheableObjectArray.cpp
@@ -67,7 +67,7 @@ namespace Apache
}
}
- System::UInt32 CacheableObjectArray::ObjectSize::get()
+ System::UInt64 CacheableObjectArray::ObjectSize::get()
{
return Count;
}
diff --git a/clicache/src/CacheableObjectArray.hpp
b/clicache/src/CacheableObjectArray.hpp
index d37cebdf..d34cfee1 100644
--- a/clicache/src/CacheableObjectArray.hpp
+++ b/clicache/src/CacheableObjectArray.hpp
@@ -119,9 +119,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableObjectXml.cpp
b/clicache/src/CacheableObjectXml.cpp
index b5bf7cec..ca1b99fa 100644
--- a/clicache/src/CacheableObjectXml.cpp
+++ b/clicache/src/CacheableObjectXml.cpp
@@ -90,7 +90,7 @@ namespace Apache
}
}
- System::UInt32 CacheableObjectXml::ObjectSize::get()
+ System::UInt64 CacheableObjectXml::ObjectSize::get()
{
if (m_objectSize == 0) {
if (m_obj != nullptr) {
@@ -99,7 +99,7 @@ namespace Apache
GeodeNullStream ns;
xs.Serialize(%ns, m_obj);
- m_objectSize = (System::UInt32)sizeof(CacheableObjectXml^) +
(System::UInt32)ns.Length;
+ m_objectSize = sizeof(CacheableObjectXml^) + ns.Length;
}
}
return m_objectSize;
diff --git a/clicache/src/CacheableObjectXml.hpp
b/clicache/src/CacheableObjectXml.hpp
index 79d3e6c4..2ebb6522 100644
--- a/clicache/src/CacheableObjectXml.hpp
+++ b/clicache/src/CacheableObjectXml.hpp
@@ -92,9 +92,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
@@ -150,7 +150,7 @@ namespace Apache
private:
Object^ m_obj;
- System::UInt32 m_objectSize;
+ System::UInt64 m_objectSize;
};
} // namespace Client
} // namespace Geode
diff --git a/clicache/src/CacheableStack.cpp b/clicache/src/CacheableStack.cpp
index 8f814d6c..3c234388 100644
--- a/clicache/src/CacheableStack.cpp
+++ b/clicache/src/CacheableStack.cpp
@@ -72,7 +72,7 @@ namespace Apache
return GeodeClassIds::CacheableStack;
}
- System::UInt32 CacheableStack::ObjectSize::get()
+ System::UInt64 CacheableStack::ObjectSize::get()
{
//TODO:
/*System::UInt32 size = static_cast<System::UInt32>
(sizeof(CacheableStack^));
diff --git a/clicache/src/CacheableStack.hpp b/clicache/src/CacheableStack.hpp
index 2fa8ca12..d71cb051 100644
--- a/clicache/src/CacheableStack.hpp
+++ b/clicache/src/CacheableStack.hpp
@@ -89,9 +89,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableString.cpp b/clicache/src/CacheableString.cpp
index b4554c32..43e50845 100644
--- a/clicache/src/CacheableString.cpp
+++ b/clicache/src/CacheableString.cpp
@@ -134,7 +134,7 @@ namespace Apache
this->SetStringType();
}
- System::UInt32 CacheableString::ObjectSize::get()
+ System::UInt64 CacheableString::ObjectSize::get()
{
return (m_value->Length * sizeof(char));
}
diff --git a/clicache/src/CacheableString.hpp b/clicache/src/CacheableString.hpp
index c8b37bb5..e622e4cd 100644
--- a/clicache/src/CacheableString.hpp
+++ b/clicache/src/CacheableString.hpp
@@ -116,9 +116,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get() override;
+ virtual System::UInt64 get() override;
}
/// <summary>
diff --git a/clicache/src/CacheableStringArray.hpp
b/clicache/src/CacheableStringArray.hpp
index 926d6755..883eb8e3 100644
--- a/clicache/src/CacheableStringArray.hpp
+++ b/clicache/src/CacheableStringArray.hpp
@@ -101,16 +101,16 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get() override
+ virtual System::UInt64 get() override
{
- int size = 0;
+ auto size = sizeof(this);
for (int i = 0; i < m_value->Length; i++)
{
size += m_value[i]->Length;
}
- return (System::UInt32)(size + sizeof(this));
+ return size;
}
}
diff --git a/clicache/src/CacheableUndefined.cpp
b/clicache/src/CacheableUndefined.cpp
index 00780665..975cb626 100644
--- a/clicache/src/CacheableUndefined.cpp
+++ b/clicache/src/CacheableUndefined.cpp
@@ -43,9 +43,9 @@ namespace Apache
{
}
- System::UInt32 CacheableUndefined::ObjectSize::get()
+ System::UInt64 CacheableUndefined::ObjectSize::get()
{
- return static_cast<System::UInt32> (sizeof(CacheableUndefined^));
+ return sizeof(CacheableUndefined^);
}
} // namespace Client
diff --git a/clicache/src/CacheableUndefined.hpp
b/clicache/src/CacheableUndefined.hpp
index 4527a993..d1f606a7 100644
--- a/clicache/src/CacheableUndefined.hpp
+++ b/clicache/src/CacheableUndefined.hpp
@@ -75,9 +75,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/CacheableVector.cpp b/clicache/src/CacheableVector.cpp
index d95f94f7..dc5ccc0c 100644
--- a/clicache/src/CacheableVector.cpp
+++ b/clicache/src/CacheableVector.cpp
@@ -60,7 +60,7 @@ namespace Apache
}
}
- System::UInt32 CacheableVector::ObjectSize::get()
+ System::UInt64 CacheableVector::ObjectSize::get()
{
//TODO::
/*System::UInt32 size = static_cast<System::UInt32>
(sizeof(CacheableVector^));
diff --git a/clicache/src/CacheableVector.hpp b/clicache/src/CacheableVector.hpp
index d8a58e5d..748ad57f 100644
--- a/clicache/src/CacheableVector.hpp
+++ b/clicache/src/CacheableVector.hpp
@@ -91,9 +91,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/IGeodeSerializable.hpp
b/clicache/src/IGeodeSerializable.hpp
index a8ff06e1..ce2dc9f0 100644
--- a/clicache/src/IGeodeSerializable.hpp
+++ b/clicache/src/IGeodeSerializable.hpp
@@ -72,9 +72,9 @@ namespace Apache
/// Note that you can simply return zero if you are not using the
HeapLRU feature.
/// </remarks>
/// <returns>the size of this object in bytes.</returns>
- property System::UInt32 ObjectSize
+ property System::UInt64 ObjectSize
{
- System::UInt32 get( );
+ System::UInt64 get( );
}
/// <summary>
diff --git a/clicache/src/Properties.cpp b/clicache/src/Properties.cpp
index 6350c621..9b8c7db1 100644
--- a/clicache/src/Properties.cpp
+++ b/clicache/src/Properties.cpp
@@ -272,7 +272,7 @@ namespace Apache
}
generic<class TPropKey, class TPropValue>
- System::UInt32 Properties<TPropKey, TPropValue>::ObjectSize::get( )
+ System::UInt64 Properties<TPropKey, TPropValue>::ObjectSize::get( )
{
//TODO::
_GF_MG_EXCEPTION_TRY2
diff --git a/clicache/src/Properties.hpp b/clicache/src/Properties.hpp
index 2f6a4730..f33ecb0b 100644
--- a/clicache/src/Properties.hpp
+++ b/clicache/src/Properties.hpp
@@ -185,9 +185,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get( );
+ virtual System::UInt64 get( );
}
/// <summary>
diff --git a/clicache/src/RegionAttributes.hpp
b/clicache/src/RegionAttributes.hpp
index 90c58fe1..911c0f7e 100644
--- a/clicache/src/RegionAttributes.hpp
+++ b/clicache/src/RegionAttributes.hpp
@@ -449,9 +449,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get()
+ virtual System::UInt64 get()
{
return 0; //don't care
}
diff --git a/clicache/src/Serializable.cpp b/clicache/src/Serializable.cpp
index bc5d27d1..6077a76c 100644
--- a/clicache/src/Serializable.cpp
+++ b/clicache/src/Serializable.cpp
@@ -108,7 +108,7 @@ namespace Apache
}
}
- System::UInt32 Apache::Geode::Client::Serializable::ObjectSize::get()
+ System::UInt64 Apache::Geode::Client::Serializable::ObjectSize::get()
{
try
{
diff --git a/clicache/src/Serializable.hpp b/clicache/src/Serializable.hpp
index 2092e664..9460bb97 100644
--- a/clicache/src/Serializable.hpp
+++ b/clicache/src/Serializable.hpp
@@ -113,9 +113,9 @@ namespace Apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
/// <summary>
diff --git a/clicache/src/UserFunctionExecutionException.cpp
b/clicache/src/UserFunctionExecutionException.cpp
index e67a578b..ec5d84de 100644
--- a/clicache/src/UserFunctionExecutionException.cpp
+++ b/clicache/src/UserFunctionExecutionException.cpp
@@ -41,7 +41,7 @@ namespace Apache
throw gcnew
IllegalStateException("UserFunctionExecutionException::FromData is not intended
for use.");
}
- System::UInt32 UserFunctionExecutionException::ObjectSize::get()
+ System::UInt64 UserFunctionExecutionException::ObjectSize::get()
{
_GF_MG_EXCEPTION_TRY2
throw gcnew
IllegalStateException("UserFunctionExecutionException::ObjectSize is not
intended for use.");
diff --git a/clicache/src/UserFunctionExecutionException.hpp
b/clicache/src/UserFunctionExecutionException.hpp
index c1dd6e7e..1d8ba6dc 100644
--- a/clicache/src/UserFunctionExecutionException.hpp
+++ b/clicache/src/UserFunctionExecutionException.hpp
@@ -99,9 +99,9 @@ namespace Apache
/// <exception cref="IllegalStateException">
/// If this api is called from User code.
/// </exception>
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- virtual System::UInt32 get();
+ virtual System::UInt64 get();
}
// End: IGeodeSerializable members
diff --git a/clicache/src/impl/EnumInfo.hpp b/clicache/src/impl/EnumInfo.hpp
index b46dc6e4..c2db6516 100755
--- a/clicache/src/impl/EnumInfo.hpp
+++ b/clicache/src/impl/EnumInfo.hpp
@@ -57,9 +57,9 @@ namespace Apache
}
virtual void ToData(DataOutput^ output);
virtual void FromData(DataInput^ input);
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- System::UInt32 get(){ return 0; }
+ System::UInt64 get(){ return 0; }
}
virtual property System::UInt32 ClassId
{
diff --git a/clicache/src/impl/ManagedCacheableDelta.cpp
b/clicache/src/impl/ManagedCacheableDelta.cpp
index 189df107..fdebece4 100644
--- a/clicache/src/impl/ManagedCacheableDelta.cpp
+++ b/clicache/src/impl/ManagedCacheableDelta.cpp
@@ -82,10 +82,10 @@ namespace apache
}
}
- System::UInt32 ManagedCacheableDeltaGeneric::objectSize() const
+ size_t ManagedCacheableDeltaGeneric::objectSize() const
{
try {
- int ret = m_managedSerializableptr->ObjectSize;
+ auto ret = m_managedSerializableptr->ObjectSize;
if (ret > m_objectSize)
return ret;
else
diff --git a/clicache/src/impl/ManagedCacheableDelta.hpp
b/clicache/src/impl/ManagedCacheableDelta.hpp
index 2284ecd5..66ad6ac4 100644
--- a/clicache/src/impl/ManagedCacheableDelta.hpp
+++ b/clicache/src/impl/ManagedCacheableDelta.hpp
@@ -62,7 +62,7 @@ namespace apache
private:
int m_hashcode;
int m_classId;
- int m_objectSize;
+ size_t m_objectSize;
public:
/// <summary>
@@ -107,7 +107,7 @@ namespace apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual System::UInt32 objectSize() const override;
+ virtual size_t objectSize() const override;
/// <summary>
/// return the classId of the instance being serialized.
diff --git a/clicache/src/impl/ManagedCacheableKey.cpp
b/clicache/src/impl/ManagedCacheableKey.cpp
index 4fc8b20c..e86816ab 100644
--- a/clicache/src/impl/ManagedCacheableKey.cpp
+++ b/clicache/src/impl/ManagedCacheableKey.cpp
@@ -80,10 +80,10 @@ namespace apache
}
}
- System::UInt32 ManagedCacheableKeyGeneric::objectSize() const
+ size_t ManagedCacheableKeyGeneric::objectSize() const
{
try {
- int ret = m_managedptr->ObjectSize;
+ auto ret = m_managedptr->ObjectSize;
if (ret > m_objectSize)
return ret;
else
diff --git a/clicache/src/impl/ManagedCacheableKey.hpp
b/clicache/src/impl/ManagedCacheableKey.hpp
index f9ca6347..2a2da15e 100644
--- a/clicache/src/impl/ManagedCacheableKey.hpp
+++ b/clicache/src/impl/ManagedCacheableKey.hpp
@@ -58,7 +58,7 @@ namespace apache
private:
int m_hashcode;
int m_classId;
- int m_objectSize;
+ size_t m_objectSize;
public:
inline ManagedCacheableKeyGeneric(
@@ -96,7 +96,7 @@ namespace apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual System::UInt32 objectSize() const override;
+ virtual size_t objectSize() const override;
/// <summary>
/// return the classId of the instance being serialized.
diff --git a/clicache/src/impl/PdxFieldType.hpp
b/clicache/src/impl/PdxFieldType.hpp
index d820c89c..cb015b76 100644
--- a/clicache/src/impl/PdxFieldType.hpp
+++ b/clicache/src/impl/PdxFieldType.hpp
@@ -131,9 +131,9 @@ namespace Apache
virtual void ToData(DataOutput^ output);
virtual void FromData(DataInput^ input);
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- System::UInt32 get(){ return 0; }
+ System::UInt64 get(){ return 0; }
}
virtual property System::UInt32 ClassId
{
diff --git a/clicache/src/impl/PdxManagedCacheableKey.cpp
b/clicache/src/impl/PdxManagedCacheableKey.cpp
index 015b0d48..458ec195 100644
--- a/clicache/src/impl/PdxManagedCacheableKey.cpp
+++ b/clicache/src/impl/PdxManagedCacheableKey.cpp
@@ -87,7 +87,7 @@ namespace apache
}
}
- System::UInt32 PdxManagedCacheableKey::objectSize() const
+ size_t PdxManagedCacheableKey::objectSize() const
{
try {
return m_objectSize;
diff --git a/clicache/src/impl/PdxManagedCacheableKey.hpp
b/clicache/src/impl/PdxManagedCacheableKey.hpp
index d640f906..fbed4f37 100644
--- a/clicache/src/impl/PdxManagedCacheableKey.hpp
+++ b/clicache/src/impl/PdxManagedCacheableKey.hpp
@@ -38,8 +38,7 @@ namespace Apache
{
namespace Client
{
-
- interface class IPdxSerializable;
+ interface class IPdxSerializable;
} // namespace Client
} // namespace Geode
} // namespace Apache
@@ -60,7 +59,7 @@ namespace apache
{
private:
int m_hashcode;
- int m_objectSize;
+ size_t m_objectSize;
public:
@@ -111,7 +110,7 @@ namespace apache
/// <summary>
/// return the size of this object in bytes
/// </summary>
- virtual System::UInt32 objectSize() const override;
+ virtual size_t objectSize() const override;
/// <summary>
/// return the classId of the instance being serialized.
diff --git a/clicache/src/impl/PdxType.hpp b/clicache/src/impl/PdxType.hpp
index 71d59c0b..f837afd0 100644
--- a/clicache/src/impl/PdxType.hpp
+++ b/clicache/src/impl/PdxType.hpp
@@ -173,9 +173,9 @@ namespace Apache
}
virtual void ToData(DataOutput^ output);
virtual void FromData(DataInput^ input);
- virtual property System::UInt32 ObjectSize
+ virtual property System::UInt64 ObjectSize
{
- System::UInt32 get(){ return 0; }
+ System::UInt64 get(){ return 0; }
}
virtual property System::UInt32 ClassId
{
diff --git a/cppcache/include/geode/CacheableBuiltins.hpp
b/cppcache/include/geode/CacheableBuiltins.hpp
index 9ae440c1..323bb99b 100644
--- a/cppcache/include/geode/CacheableBuiltins.hpp
+++ b/cppcache/include/geode/CacheableBuiltins.hpp
@@ -121,7 +121,7 @@ class CacheableKeyType : public CacheableKey {
* return zero if the user does not require the ability to control
* cache memory utilization.
*/
- virtual uint32_t objectSize() const override {
+ virtual size_t objectSize() const override {
return sizeof(CacheableKeyType);
}
};
@@ -251,7 +251,7 @@ class CacheableArrayType : public Cacheable {
* return zero if the user does not require the ability to control
* cache memory utilization.
*/
- virtual uint32_t objectSize() const override {
+ virtual size_t objectSize() const override {
return static_cast<uint32_t>(
sizeof(CacheableArrayType) +
apache::geode::client::serializer::objectSize(m_value, m_length));
@@ -303,7 +303,7 @@ class CacheableContainerType : public Cacheable, public
TBase {
* return zero if the user does not require the ability to control
* cache memory utilization.
*/
- virtual uint32_t objectSize() const override {
+ virtual size_t objectSize() const override {
return static_cast<uint32_t>(
sizeof(CacheableContainerType) +
apache::geode::client::serializer::objectSize(*this));
diff --git a/cppcache/include/geode/CacheableDate.hpp
b/cppcache/include/geode/CacheableDate.hpp
index 38621b76..85ff895a 100644
--- a/cppcache/include/geode/CacheableDate.hpp
+++ b/cppcache/include/geode/CacheableDate.hpp
@@ -84,7 +84,7 @@ class CPPCACHE_EXPORT CacheableDate : public CacheableKey {
virtual int8_t typeId() const override;
/** @return the size of the object in bytes */
- virtual uint32_t objectSize() const override { return sizeof(CacheableDate);
}
+ virtual size_t objectSize() const override { return sizeof(CacheableDate); }
/** @return true if this key matches other. */
virtual bool operator==(const CacheableKey& other) const override;
diff --git a/cppcache/include/geode/CacheableEnum.hpp
b/cppcache/include/geode/CacheableEnum.hpp
index ca962040..53bf97a7 100644
--- a/cppcache/include/geode/CacheableEnum.hpp
+++ b/cppcache/include/geode/CacheableEnum.hpp
@@ -67,11 +67,11 @@ class CPPCACHE_EXPORT CacheableEnum : public CacheableKey {
virtual void fromData(DataInput& input) override;
/** @return the size of the object in bytes */
- virtual uint32_t objectSize() const override {
+ virtual size_t objectSize() const override {
auto size = sizeof(CacheableEnum);
size += m_enumClassName.length();
size += m_enumName.length();
- return static_cast<uint32_t>(size);
+ return size;
}
/**
diff --git a/cppcache/include/geode/CacheableObjectArray.hpp
b/cppcache/include/geode/CacheableObjectArray.hpp
index 35b69176..e8be9b58 100644
--- a/cppcache/include/geode/CacheableObjectArray.hpp
+++ b/cppcache/include/geode/CacheableObjectArray.hpp
@@ -87,7 +87,7 @@ class CPPCACHE_EXPORT CacheableObjectArray
return std::make_shared<CacheableObjectArray>(n);
}
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
protected:
/** Constructor, used for deserialization. */
diff --git a/cppcache/include/geode/CacheableString.hpp
b/cppcache/include/geode/CacheableString.hpp
index 9494d3ce..305c65c0 100644
--- a/cppcache/include/geode/CacheableString.hpp
+++ b/cppcache/include/geode/CacheableString.hpp
@@ -157,7 +157,7 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey
{
/** Destructor */
virtual ~CacheableString();
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
protected:
/**
diff --git a/cppcache/include/geode/CacheableUndefined.hpp
b/cppcache/include/geode/CacheableUndefined.hpp
index 724eb7ea..6317cedd 100644
--- a/cppcache/include/geode/CacheableUndefined.hpp
+++ b/cppcache/include/geode/CacheableUndefined.hpp
@@ -79,7 +79,7 @@ class CPPCACHE_EXPORT CacheableUndefined : public Cacheable {
return std::make_shared<CacheableUndefined>();
}
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
protected:
/** Constructor, used for deserialization. */
diff --git a/cppcache/include/geode/PdxInstance.hpp
b/cppcache/include/geode/PdxInstance.hpp
index fdf86aa9..ee51768c 100644
--- a/cppcache/include/geode/PdxInstance.hpp
+++ b/cppcache/include/geode/PdxInstance.hpp
@@ -505,7 +505,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
* This is an internal method.
* It is used in case of heap LRU property is set.
*/
- virtual uint32_t objectSize() const override = 0;
+ virtual size_t objectSize() const override = 0;
/**
* Return an unmodifiable list of the field names on this PdxInstance.
diff --git a/cppcache/include/geode/PdxWrapper.hpp
b/cppcache/include/geode/PdxWrapper.hpp
index a9ece006..f60d0511 100644
--- a/cppcache/include/geode/PdxWrapper.hpp
+++ b/cppcache/include/geode/PdxWrapper.hpp
@@ -100,7 +100,7 @@ class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
* cache memory utilization.
* Note that you must implement this only if you use the HeapLRU feature.
*/
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
/**
* Display this object as 'string', which depends on the implementation in
* the subclasses.
diff --git a/cppcache/include/geode/Properties.hpp
b/cppcache/include/geode/Properties.hpp
index 949d224f..3ecf2ec8 100644
--- a/cppcache/include/geode/Properties.hpp
+++ b/cppcache/include/geode/Properties.hpp
@@ -152,7 +152,7 @@ class CPPCACHE_EXPORT Properties : public Serializable {
/** Return type id for serialization. */
virtual int8_t typeId() const override;
- virtual uint32_t objectSize() const override {
+ virtual size_t objectSize() const override {
return 0; // don't care to set the right value
}
diff --git a/cppcache/include/geode/RegionAttributes.hpp
b/cppcache/include/geode/RegionAttributes.hpp
index d8afa375..53fbf8bc 100644
--- a/cppcache/include/geode/RegionAttributes.hpp
+++ b/cppcache/include/geode/RegionAttributes.hpp
@@ -208,7 +208,7 @@ class CPPCACHE_EXPORT RegionAttributes : public
Serializable {
virtual int8_t typeId() const;
// return zero deliberately
- virtual uint32_t objectSize() const { return 0; }
+ virtual size_t objectSize() const { return 0; }
/**
* This method returns the path of the library from which
diff --git a/cppcache/include/geode/Serializable.hpp
b/cppcache/include/geode/Serializable.hpp
index b5110416..abd64d5f 100644
--- a/cppcache/include/geode/Serializable.hpp
+++ b/cppcache/include/geode/Serializable.hpp
@@ -107,7 +107,7 @@ class CPPCACHE_EXPORT Serializable
* cache memory utilization.
* Note that you must implement this only if you use the HeapLRU feature.
*/
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
/**
* Display this object as 'string', which depends on the implementation in
diff --git a/cppcache/include/geode/Serializer.hpp
b/cppcache/include/geode/Serializer.hpp
index 40be26b5..1a8c3fe4 100644
--- a/cppcache/include/geode/Serializer.hpp
+++ b/cppcache/include/geode/Serializer.hpp
@@ -300,7 +300,8 @@ inline void writeObject(apache::geode::client::DataOutput&
output,
}
}
-inline uint32_t objectSize(const std::vector<std::shared_ptr<Cacheable>>&
value) {
+inline uint32_t objectSize(
+ const std::vector<std::shared_ptr<Cacheable>>& value) {
size_t objectSize = 0;
for (const auto& iter : value) {
if (iter) {
@@ -324,7 +325,8 @@ inline void readObject(apache::geode::client::DataInput&
input,
}
}
-template <typename TKey, typename TValue, typename Hash, typename KeyEqual,
typename Allocator>
+template <typename TKey, typename TValue, typename Hash, typename KeyEqual,
+ typename Allocator>
inline void writeObject(
apache::geode::client::DataOutput& output,
const std::unordered_map<TKey, TValue, Hash, KeyEqual, Allocator>& value) {
@@ -335,22 +337,24 @@ inline void writeObject(
}
}
-inline uint32_t objectSize(const HashMapOfCacheable& value) {
- uint32_t objectSize = 0;
+inline size_t objectSize(const HashMapOfCacheable& value) {
+ auto objectSize = (sizeof(std::shared_ptr<CacheableKey>) +
+ sizeof(std::shared_ptr<Cacheable>)) *
+ value.size();
for (const auto& iter : value) {
objectSize += iter.first->objectSize();
if (iter.second) {
objectSize += iter.second->objectSize();
}
}
- objectSize += static_cast<uint32_t>(
- (sizeof(std::shared_ptr<CacheableKey>) +
sizeof(std::shared_ptr<Cacheable>)) * value.size());
return objectSize;
}
-template <typename TKey, typename TValue, typename Hash, typename KeyEqual,
typename Allocator>
-inline void readObject(apache::geode::client::DataInput& input,
- std::unordered_map<TKey, TValue, Hash, KeyEqual,
Allocator>& value) {
+template <typename TKey, typename TValue, typename Hash, typename KeyEqual,
+ typename Allocator>
+inline void readObject(
+ apache::geode::client::DataInput& input,
+ std::unordered_map<TKey, TValue, Hash, KeyEqual, Allocator>& value) {
int32_t len = input.readArrayLen();
value.reserve(len);
TKey key;
@@ -363,28 +367,29 @@ inline void readObject(apache::geode::client::DataInput&
input,
}
template <typename TKey, typename Hash, typename KeyEqual, typename Allocator>
-inline void writeObject(apache::geode::client::DataOutput& output,
- const std::unordered_set<TKey, Hash, KeyEqual,
Allocator>& value) {
+inline void writeObject(
+ apache::geode::client::DataOutput& output,
+ const std::unordered_set<TKey, Hash, KeyEqual, Allocator>& value) {
output.writeArrayLen(static_cast<int32_t>(value.size()));
for (const auto& iter : value) {
writeObject(output, iter);
}
}
-inline uint32_t objectSize(const HashSetOfCacheableKey& value) {
- uint32_t objectSize = 0;
+inline size_t objectSize(const HashSetOfCacheableKey& value) {
+ auto objectSize = sizeof(std::shared_ptr<CacheableKey>) * value.size();
for (const auto& iter : value) {
if (iter) {
objectSize += iter->objectSize();
}
}
- objectSize += static_cast<uint32_t>(sizeof(std::shared_ptr<CacheableKey>) *
value.size());
return objectSize;
}
template <typename TKey, typename Hash, typename KeyEqual, typename Allocator>
-inline void readObject(apache::geode::client::DataInput& input,
- std::unordered_set<TKey, Hash, KeyEqual, Allocator>&
value) {
+inline void readObject(
+ apache::geode::client::DataInput& input,
+ std::unordered_set<TKey, Hash, KeyEqual, Allocator>& value) {
int32_t len = input.readArrayLen();
if (len > 0) {
TKey key;
diff --git a/cppcache/include/geode/Struct.hpp
b/cppcache/include/geode/Struct.hpp
index 8326dec5..c21ceaa6 100644
--- a/cppcache/include/geode/Struct.hpp
+++ b/cppcache/include/geode/Struct.hpp
@@ -143,7 +143,7 @@ class CPPCACHE_EXPORT Struct : public Serializable {
/**
* always returns 0
*/
- virtual uint32_t objectSize() const {
+ virtual size_t objectSize() const {
return 0; // does not get cached, so no need to account for it
}
diff --git a/cppcache/include/geode/UserFunctionExecutionException.hpp
b/cppcache/include/geode/UserFunctionExecutionException.hpp
index c5fe5305..bbfb821b 100644
--- a/cppcache/include/geode/UserFunctionExecutionException.hpp
+++ b/cppcache/include/geode/UserFunctionExecutionException.hpp
@@ -81,7 +81,7 @@ class UserFunctionExecutionException : public Serializable {
* Note that you must implement this only if you use the HeapLRU feature.
* @throws IllegalStateException If this api is called from User code.
*/
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
/**
*@brief return the typeId byte of the instance being serialized.
diff --git a/cppcache/integration-test/BuiltinCacheableWrappers.hpp
b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
index 09cccac2..a750823a 100644
--- a/cppcache/integration-test/BuiltinCacheableWrappers.hpp
+++ b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
@@ -140,14 +140,14 @@ inline void randomString(int32_t size, std::wstring&
randStr,
}
}
-inline uint32_t crc32(const uint8_t* buffer, uint32_t bufLen) {
+inline uint32_t crc32(const uint8_t* buffer, size_t bufLen) {
if (buffer == nullptr || bufLen == 0) {
return 0;
}
uint32_t crc = 0xffffffff;
- for (uint32_t index = 0; index < bufLen; index++) {
+ for (size_t index = 0; index < bufLen; index++) {
crc =
((crc >> 8) & 0x00ffffff) ^ m_crc32Table[(crc ^ buffer[index]) & 0xff];
}
diff --git a/cppcache/integration-test/DeltaEx.hpp
b/cppcache/integration-test/DeltaEx.hpp
index 3c30eced..35e90d8e 100644
--- a/cppcache/integration-test/DeltaEx.hpp
+++ b/cppcache/integration-test/DeltaEx.hpp
@@ -76,7 +76,7 @@ class DeltaEx : public Cacheable, public Delta {
fromDataCount++;
}
virtual int32_t classId() const override { return 1; }
- virtual uint32_t objectSize() const override { return 0; }
+ virtual size_t objectSize() const override { return 0; }
std::shared_ptr<Delta> clone() const override {
cloneCount++;
return std::make_shared<DeltaEx>(*this);
diff --git a/cppcache/integration-test/testSerialization.cpp
b/cppcache/integration-test/testSerialization.cpp
index 0f688290..a1f7ca2e 100644
--- a/cppcache/integration-test/testSerialization.cpp
+++ b/cppcache/integration-test/testSerialization.cpp
@@ -81,7 +81,7 @@ class OtherType : public Serializable {
output.writeInt(m_classIdToReturn);
}
- virtual uint32_t objectSize() const { return sizeof(CData); }
+ virtual size_t objectSize() const { return sizeof(CData); }
virtual void fromData(DataInput& input) {
int32_t size = input.readArrayLen();
diff --git a/cppcache/src/BucketServerLocation.hpp
b/cppcache/src/BucketServerLocation.hpp
index 73107748..c947ba21 100644
--- a/cppcache/src/BucketServerLocation.hpp
+++ b/cppcache/src/BucketServerLocation.hpp
@@ -124,7 +124,7 @@ class BucketServerLocation : public ServerLocation {
}
}
- uint32_t objectSize() const {
+ size_t objectSize() const {
return sizeof(int32_t) + sizeof(bool) + sizeof(int8_t);
}
diff --git a/cppcache/src/CacheableObjectArray.cpp
b/cppcache/src/CacheableObjectArray.cpp
index 0ebd9bd1..01c67bf4 100644
--- a/cppcache/src/CacheableObjectArray.cpp
+++ b/cppcache/src/CacheableObjectArray.cpp
@@ -57,8 +57,8 @@ int8_t CacheableObjectArray::typeId() const {
return GeodeTypeIds::CacheableObjectArray;
}
-uint32_t CacheableObjectArray::objectSize() const {
- uint32_t size = sizeof(CacheableObjectArray);
+size_t CacheableObjectArray::objectSize() const {
+ auto size = sizeof(CacheableObjectArray);
for (const auto& iter : *this) {
size += iter->objectSize();
}
diff --git a/cppcache/src/CacheableObjectPartList.cpp
b/cppcache/src/CacheableObjectPartList.cpp
index 98cd5363..7ee841f7 100644
--- a/cppcache/src/CacheableObjectPartList.cpp
+++ b/cppcache/src/CacheableObjectPartList.cpp
@@ -128,7 +128,7 @@ int8_t CacheableObjectPartList::DSFID() const {
return GeodeTypeIdsImpl::FixedIDByte;
}
-uint32_t CacheableObjectPartList::objectSize() const { return 0; }
+size_t CacheableObjectPartList::objectSize() const { return 0; }
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/CacheableObjectPartList.hpp
b/cppcache/src/CacheableObjectPartList.hpp
index 319b6be2..bd57052b 100644
--- a/cppcache/src/CacheableObjectPartList.hpp
+++ b/cppcache/src/CacheableObjectPartList.hpp
@@ -147,7 +147,7 @@ class CacheableObjectPartList : public Cacheable {
*/
virtual int8_t DSFID() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
};
} // namespace client
diff --git a/cppcache/src/CacheableString.cpp b/cppcache/src/CacheableString.cpp
index 2cce38fe..6499cca2 100644
--- a/cppcache/src/CacheableString.cpp
+++ b/cppcache/src/CacheableString.cpp
@@ -169,7 +169,7 @@ void CacheableString::initString(const wchar_t* value,
int32_t len) {
CacheableString::~CacheableString() {}
-uint32_t CacheableString::objectSize() const {
+size_t CacheableString::objectSize() const {
auto size = sizeof(CacheableString) +
sizeof(std::string::value_type) * m_str.capacity();
return size;
diff --git a/cppcache/src/CacheableToken.cpp b/cppcache/src/CacheableToken.cpp
index 5839125f..03735804 100644
--- a/cppcache/src/CacheableToken.cpp
+++ b/cppcache/src/CacheableToken.cpp
@@ -79,4 +79,4 @@ std::string CacheableToken::toString() const {
return ctstrings[m_value];
}
-uint32_t CacheableToken::objectSize() const { return sizeof(m_value); }
+size_t CacheableToken::objectSize() const { return sizeof(m_value); }
diff --git a/cppcache/src/CacheableToken.hpp b/cppcache/src/CacheableToken.hpp
index b0f6d9ec..b5572c6d 100644
--- a/cppcache/src/CacheableToken.hpp
+++ b/cppcache/src/CacheableToken.hpp
@@ -122,7 +122,7 @@ class CPPCACHE_EXPORT CacheableToken : public Cacheable {
*/
virtual std::string toString() const override;
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
protected:
CacheableToken(TokenType value);
diff --git a/cppcache/src/CacheableUndefined.cpp
b/cppcache/src/CacheableUndefined.cpp
index d7fd1eec..1d5fba9e 100644
--- a/cppcache/src/CacheableUndefined.cpp
+++ b/cppcache/src/CacheableUndefined.cpp
@@ -38,7 +38,7 @@ int8_t CacheableUndefined::DSFID() const {
return GeodeTypeIdsImpl::FixedIDByte;
}
-uint32_t CacheableUndefined::objectSize() const { return 0; }
+size_t CacheableUndefined::objectSize() const { return 0; }
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ClientConnectionRequest.cpp
b/cppcache/src/ClientConnectionRequest.cpp
index aca8788f..77bccd1a 100644
--- a/cppcache/src/ClientConnectionRequest.cpp
+++ b/cppcache/src/ClientConnectionRequest.cpp
@@ -29,7 +29,7 @@ void ClientConnectionRequest::toData(DataOutput& output)
const {
void ClientConnectionRequest::fromData(DataInput& input) {}
-uint32_t ClientConnectionRequest::objectSize() const { return 0; }
+size_t ClientConnectionRequest::objectSize() const { return 0; }
int8_t ClientConnectionRequest::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::ClientConnectionRequest);
diff --git a/cppcache/src/ClientConnectionRequest.hpp
b/cppcache/src/ClientConnectionRequest.hpp
index a4651755..8f1638d6 100644
--- a/cppcache/src/ClientConnectionRequest.hpp
+++ b/cppcache/src/ClientConnectionRequest.hpp
@@ -39,7 +39,7 @@ class ClientConnectionRequest : public ServerLocationRequest {
m_excludeServergroup_serverLocation(excludeServergroup) {}
virtual void toData(DataOutput& output) const;
virtual void fromData(DataInput& input);
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
virtual int8_t typeId() const;
std::string getServerGroup() const { return m_servergroup; }
const std::set<ServerLocation>& getExcludedServerGroup() const {
diff --git a/cppcache/src/ClientConnectionResponse.cpp
b/cppcache/src/ClientConnectionResponse.cpp
index dfcb84e9..e977b56c 100644
--- a/cppcache/src/ClientConnectionResponse.cpp
+++ b/cppcache/src/ClientConnectionResponse.cpp
@@ -31,7 +31,7 @@ int8_t ClientConnectionResponse::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::ClientConnectionResponse);
}
-uint32_t ClientConnectionResponse::objectSize() const {
+size_t ClientConnectionResponse::objectSize() const {
return (m_server.objectSize());
}
diff --git a/cppcache/src/ClientConnectionResponse.hpp
b/cppcache/src/ClientConnectionResponse.hpp
index ab25dc8b..0cc866c2 100644
--- a/cppcache/src/ClientConnectionResponse.hpp
+++ b/cppcache/src/ClientConnectionResponse.hpp
@@ -33,7 +33,7 @@ class ClientConnectionResponse : public
ServerLocationResponse {
ClientConnectionResponse() : ServerLocationResponse(), m_serverFound(false)
{}
virtual void fromData(DataInput& input);
virtual int8_t typeId() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
virtual ServerLocation getServerLocation() const;
void printInfo() { m_server.printInfo(); }
static Serializable* create() { return new ClientConnectionResponse(); }
diff --git a/cppcache/src/ClientHealthStats.hpp
b/cppcache/src/ClientHealthStats.hpp
index b8015747..1b2fccfc 100644
--- a/cppcache/src/ClientHealthStats.hpp
+++ b/cppcache/src/ClientHealthStats.hpp
@@ -61,7 +61,7 @@ class ClientHealthStats : public Serializable {
virtual int8_t DSFID() const;
/** @return the size of the object in bytes */
- virtual uint32_t objectSize() const { return sizeof(ClientHealthStats); }
+ virtual size_t objectSize() const { return sizeof(ClientHealthStats); }
/**
* Factory method for creating an instance of ClientHealthStats
*/
diff --git a/cppcache/src/ClientProxyMembershipID.hpp
b/cppcache/src/ClientProxyMembershipID.hpp
index fa3d8a75..d87bc64f 100644
--- a/cppcache/src/ClientProxyMembershipID.hpp
+++ b/cppcache/src/ClientProxyMembershipID.hpp
@@ -66,7 +66,7 @@ class ClientProxyMembershipID : public
DSMemberForVersionStamp {
void fromData(DataInput& input);
int32_t classId() const { return 0; }
int8_t typeId() const { return GeodeTypeIdsImpl::InternalDistributedMember; }
- uint32_t objectSize() const { return 0; }
+ size_t objectSize() const { return 0; }
int8_t DSFID() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDByte);
}
diff --git a/cppcache/src/EnumInfo.hpp b/cppcache/src/EnumInfo.hpp
index 1a97caa5..0c09aad0 100644
--- a/cppcache/src/EnumInfo.hpp
+++ b/cppcache/src/EnumInfo.hpp
@@ -41,8 +41,8 @@ class CPPCACHE_EXPORT EnumInfo : public CacheableKey {
static Serializable* createDeserializable() { return new EnumInfo(); }
virtual void toData(DataOutput& output) const override;
virtual void fromData(DataInput& input) override;
- virtual uint32_t objectSize() const override {
- uint32_t size = sizeof(EnumInfo);
+ virtual size_t objectSize() const override {
+ auto size = sizeof(EnumInfo);
size += sizeof(int32_t);
size += m_enumClassName->objectSize();
size += m_enumName->objectSize();
diff --git a/cppcache/src/EventId.hpp b/cppcache/src/EventId.hpp
index 5869997c..cd13aca0 100644
--- a/cppcache/src/EventId.hpp
+++ b/cppcache/src/EventId.hpp
@@ -66,8 +66,8 @@ class CPPCACHE_EXPORT EventId : public Cacheable {
**/
virtual void fromData(DataInput& input);
- virtual uint32_t objectSize() const {
- uint32_t objectSize = 0;
+ virtual size_t objectSize() const {
+ size_t objectSize = 0;
objectSize += sizeof(uint8_t);
objectSize += sizeof(int64_t);
objectSize += sizeof(uint8_t);
diff --git a/cppcache/src/FixedPartitionAttributesImpl.hpp
b/cppcache/src/FixedPartitionAttributesImpl.hpp
index 01cb12e8..f4fc8d09 100644
--- a/cppcache/src/FixedPartitionAttributesImpl.hpp
+++ b/cppcache/src/FixedPartitionAttributesImpl.hpp
@@ -72,12 +72,10 @@ class FixedPartitionAttributesImpl : public Serializable {
m_startingBucketId = input.readInt32();
}
- uint32_t objectSize() const {
+ size_t objectSize() const {
if (m_partitionName != nullptr) {
- return static_cast<uint32_t>(sizeof(int)) +
- static_cast<uint32_t>(sizeof(int)) +
- static_cast<uint32_t>(sizeof(bool)) +
- (m_partitionName->length()) * static_cast<uint32_t>(sizeof(char));
+ return sizeof(int) + sizeof(int) + sizeof(bool) +
+ (m_partitionName->length() * sizeof(char));
}
return 0;
}
diff --git a/cppcache/src/GetAllServersRequest.hpp
b/cppcache/src/GetAllServersRequest.hpp
index 38ee1c89..1c2f3c89 100644
--- a/cppcache/src/GetAllServersRequest.hpp
+++ b/cppcache/src/GetAllServersRequest.hpp
@@ -47,7 +47,7 @@ class GetAllServersRequest : public Serializable {
virtual int8_t DSFID() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDByte);
}
- virtual uint32_t objectSize() const { return m_serverGroup->length(); }
+ virtual size_t objectSize() const { return m_serverGroup->length(); }
virtual ~GetAllServersRequest() {}
};
diff --git a/cppcache/src/GetAllServersResponse.hpp
b/cppcache/src/GetAllServersResponse.hpp
index faa2b339..9fc6fc17 100644
--- a/cppcache/src/GetAllServersResponse.hpp
+++ b/cppcache/src/GetAllServersResponse.hpp
@@ -45,9 +45,7 @@ class GetAllServersResponse : public Serializable {
virtual int8_t DSFID() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDByte);
}
- virtual uint32_t objectSize() const {
- return static_cast<uint32_t>(m_servers.size());
- }
+ virtual size_t objectSize() const { return m_servers.size(); }
std::vector<ServerLocation> getServers() { return m_servers; }
virtual ~GetAllServersResponse() {}
};
diff --git a/cppcache/src/LocatorListRequest.cpp
b/cppcache/src/LocatorListRequest.cpp
index 753f074a..6421aeea 100644
--- a/cppcache/src/LocatorListRequest.cpp
+++ b/cppcache/src/LocatorListRequest.cpp
@@ -34,4 +34,4 @@ int8_t LocatorListRequest::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::LocatorListRequest);
}
-uint32_t LocatorListRequest::objectSize() const { return 0; }
+size_t LocatorListRequest::objectSize() const { return 0; }
diff --git a/cppcache/src/LocatorListRequest.hpp
b/cppcache/src/LocatorListRequest.hpp
index 0db77cd4..d5b2286d 100644
--- a/cppcache/src/LocatorListRequest.hpp
+++ b/cppcache/src/LocatorListRequest.hpp
@@ -40,7 +40,7 @@ class LocatorListRequest : public ServerLocationRequest {
virtual void toData(DataOutput& output) const;
virtual void fromData(DataInput& input);
virtual int8_t typeId() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
};
} // namespace client
diff --git a/cppcache/src/LocatorListResponse.cpp
b/cppcache/src/LocatorListResponse.cpp
index a04fd2ed..acaa85e4 100644
--- a/cppcache/src/LocatorListResponse.cpp
+++ b/cppcache/src/LocatorListResponse.cpp
@@ -30,7 +30,7 @@ int8_t LocatorListResponse::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::LocatorListResponse);
}
-uint32_t LocatorListResponse::objectSize() const { return 0; }
+size_t LocatorListResponse::objectSize() const { return 0; }
void LocatorListResponse::readList(DataInput& input) {
uint32_t size = input.readInt32();
diff --git a/cppcache/src/LocatorListResponse.hpp
b/cppcache/src/LocatorListResponse.hpp
index 7c4fca8e..657d0ef8 100644
--- a/cppcache/src/LocatorListResponse.hpp
+++ b/cppcache/src/LocatorListResponse.hpp
@@ -44,7 +44,7 @@ class LocatorListResponse : public ServerLocationResponse {
m_isBalanced(false) {} // Default constru needed for de-serialization
virtual void fromData(DataInput& input);
virtual int8_t typeId() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
const std::vector<ServerLocation>& getLocators() const;
bool isBalanced() const;
virtual ~LocatorListResponse() {} // Virtual destructor
diff --git a/cppcache/src/PdxFieldType.hpp b/cppcache/src/PdxFieldType.hpp
index 2a4f189e..1990b808 100644
--- a/cppcache/src/PdxFieldType.hpp
+++ b/cppcache/src/PdxFieldType.hpp
@@ -88,10 +88,10 @@ class CPPCACHE_EXPORT PdxFieldType : public Serializable {
virtual int32_t classId() const override { return m_typeId; }
- virtual uint32_t objectSize() const override {
- uint32_t size = sizeof(PdxFieldType);
- size += static_cast<uint32_t>(m_className.length());
- size += static_cast<uint32_t>(m_fieldName.length());
+ virtual size_t objectSize() const override {
+ auto size = sizeof(PdxFieldType);
+ size += m_className.length();
+ size += m_fieldName.length();
return size;
}
diff --git a/cppcache/src/PdxInstanceImpl.cpp b/cppcache/src/PdxInstanceImpl.cpp
index f170620c..b9f6f876 100644
--- a/cppcache/src/PdxInstanceImpl.cpp
+++ b/cppcache/src/PdxInstanceImpl.cpp
@@ -2121,13 +2121,13 @@ void PdxInstanceImpl::setOffsetForObject(DataInput&
dataInput,
dataInput.advanceCursor(pos);
}
-uint32_t PdxInstanceImpl::objectSize() const {
- uint32_t size = sizeof(PdxInstanceImpl);
+size_t PdxInstanceImpl::objectSize() const {
+ auto size = sizeof(PdxInstanceImpl);
size += m_bufferLength;
size += m_pdxType->objectSize();
for (FieldVsValues::const_iterator iter = m_updatedFields.begin();
iter != m_updatedFields.end(); ++iter) {
- size += static_cast<int32_t>(iter->first.length());
+ size += iter->first.length();
size += iter->second->objectSize();
}
return size;
diff --git a/cppcache/src/PdxInstanceImpl.hpp b/cppcache/src/PdxInstanceImpl.hpp
index 092bd5bd..601b2fda 100644
--- a/cppcache/src/PdxInstanceImpl.hpp
+++ b/cppcache/src/PdxInstanceImpl.hpp
@@ -943,7 +943,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public
WritablePdxInstance {
* This is an internal method.
* It is used in case of heap LRU property is set.
*/
- virtual uint32_t objectSize() const override;
+ virtual size_t objectSize() const override;
/**
* Return an unmodifiable list of the field names on this PdxInstance.
diff --git a/cppcache/src/PdxType.hpp b/cppcache/src/PdxType.hpp
index b0aab89c..d6487ebb 100644
--- a/cppcache/src/PdxType.hpp
+++ b/cppcache/src/PdxType.hpp
@@ -117,29 +117,26 @@ class PdxType : public Serializable,
return new PdxType(pdxTypeRegistryPtr, "", false);
}
- virtual uint32_t objectSize() const {
- uint32_t size = sizeof(PdxType);
+ virtual size_t objectSize() const {
+ auto size = sizeof(PdxType);
if (m_pdxFieldTypes != nullptr) {
for (size_t i = 0; i < m_pdxFieldTypes->size(); i++) {
size += m_pdxFieldTypes->at(i)->objectSize();
}
}
size += static_cast<uint32_t>(m_className.length());
- for (NameVsPdxType::const_iterator iter = m_fieldNameVsPdxType.begin();
- iter != m_fieldNameVsPdxType.end(); ++iter) {
- size += static_cast<uint32_t>(iter->first.length());
- size += iter->second->objectSize();
+ for (auto&& iter : m_fieldNameVsPdxType) {
+ size += iter.first.length();
+ size += iter.second->objectSize();
}
if (m_remoteToLocalFieldMap != nullptr) {
if (m_pdxFieldTypes != nullptr) {
- size +=
- static_cast<uint32_t>(sizeof(int32_t) * m_pdxFieldTypes->size());
+ size += sizeof(int32_t) * m_pdxFieldTypes->size();
}
}
if (m_localToRemoteFieldMap != nullptr) {
if (m_pdxFieldTypes != nullptr) {
- size +=
- static_cast<uint32_t>(sizeof(int32_t) * m_pdxFieldTypes->size());
+ size += sizeof(int32_t) * m_pdxFieldTypes->size();
}
}
return size;
diff --git a/cppcache/src/PdxWrapper.cpp b/cppcache/src/PdxWrapper.cpp
index 040f89bf..776c054c 100644
--- a/cppcache/src/PdxWrapper.cpp
+++ b/cppcache/src/PdxWrapper.cpp
@@ -135,7 +135,7 @@ void PdxWrapper::fromData(DataInput &input) {
"PdxWrapper fromData should not have been called");
}
-uint32_t PdxWrapper::objectSize() const {
+size_t PdxWrapper::objectSize() const {
if (m_sizer == nullptr || m_userObject == nullptr) {
return 0;
} else {
diff --git a/cppcache/src/PutAllPartialResult.hpp
b/cppcache/src/PutAllPartialResult.hpp
index b1d40b64..6e093072 100644
--- a/cppcache/src/PutAllPartialResult.hpp
+++ b/cppcache/src/PutAllPartialResult.hpp
@@ -124,7 +124,7 @@ class PutAllPartialResult : public Serializable {
return 0;
}
- uint32_t objectSize() const override {
+ size_t objectSize() const override {
throw IllegalStateException(
"PutAllPartialResult::objectSize is not intended for use.");
return 0;
diff --git a/cppcache/src/PutAllPartialResultServerException.cpp
b/cppcache/src/PutAllPartialResultServerException.cpp
index f7df4619..bbd90d1b 100644
--- a/cppcache/src/PutAllPartialResultServerException.cpp
+++ b/cppcache/src/PutAllPartialResultServerException.cpp
@@ -87,7 +87,7 @@ int32_t PutAllPartialResultServerException::classId() const {
return 0;
}
-uint32_t PutAllPartialResultServerException::objectSize() const {
+size_t PutAllPartialResultServerException::objectSize() const {
throw IllegalStateException(
"PutAllPartialResultServerException::objectSize is not intended for "
"use.");
diff --git a/cppcache/src/PutAllPartialResultServerException.hpp
b/cppcache/src/PutAllPartialResultServerException.hpp
index 5ab0d094..113a16f3 100644
--- a/cppcache/src/PutAllPartialResultServerException.hpp
+++ b/cppcache/src/PutAllPartialResultServerException.hpp
@@ -108,7 +108,7 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException :
public Serializable {
* Note that you must implement this only if you use the HeapLRU feature.
* @throws IllegalStateException If this api is called from User code.
*/
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
/**
*@brief return the typeId byte of the instance being serialized.
diff --git a/cppcache/src/QueueConnectionRequest.cpp
b/cppcache/src/QueueConnectionRequest.cpp
index e2185bb4..f70eef31 100644
--- a/cppcache/src/QueueConnectionRequest.cpp
+++ b/cppcache/src/QueueConnectionRequest.cpp
@@ -43,7 +43,7 @@ int8_t QueueConnectionRequest::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::QueueConnectionRequest);
}
-uint32_t QueueConnectionRequest::objectSize() const {
+size_t QueueConnectionRequest::objectSize() const {
return 0; // will implement later.
}
diff --git a/cppcache/src/QueueConnectionRequest.hpp
b/cppcache/src/QueueConnectionRequest.hpp
index 5e182236..43ec9bd5 100644
--- a/cppcache/src/QueueConnectionRequest.hpp
+++ b/cppcache/src/QueueConnectionRequest.hpp
@@ -46,7 +46,7 @@ class QueueConnectionRequest : public ServerLocationRequest {
virtual void toData(DataOutput& output) const;
virtual void fromData(DataInput& input);
virtual int8_t typeId() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
virtual std::set<ServerLocation> getExcludedServer() const;
virtual const ClientProxyMembershipID& getProxyMemberShipId() const;
virtual int getRedundentCopies() const;
diff --git a/cppcache/src/QueueConnectionResponse.cpp
b/cppcache/src/QueueConnectionResponse.cpp
index eb3d2830..9fce9a3b 100644
--- a/cppcache/src/QueueConnectionResponse.cpp
+++ b/cppcache/src/QueueConnectionResponse.cpp
@@ -31,7 +31,7 @@ int8_t QueueConnectionResponse::typeId() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::QueueConnectionResponse);
}
-uint32_t QueueConnectionResponse::objectSize() const {
+size_t QueueConnectionResponse::objectSize() const {
return 0; // Can be implemented later.
}
diff --git a/cppcache/src/QueueConnectionResponse.hpp
b/cppcache/src/QueueConnectionResponse.hpp
index 54c0c05f..cabc3d69 100644
--- a/cppcache/src/QueueConnectionResponse.hpp
+++ b/cppcache/src/QueueConnectionResponse.hpp
@@ -34,7 +34,7 @@ class QueueConnectionResponse : public ServerLocationResponse
{
: ServerLocationResponse(), m_durableQueueFound(false) {}
virtual void fromData(DataInput& input);
virtual int8_t typeId() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
virtual std::list<ServerLocation> getServers() { return m_list; }
virtual bool isDurableQueueFound() { return m_durableQueueFound; }
static Serializable* create() { return new QueueConnectionResponse(); }
diff --git a/cppcache/src/Serializable.cpp b/cppcache/src/Serializable.cpp
index c587068d..c0cf91b2 100644
--- a/cppcache/src/Serializable.cpp
+++ b/cppcache/src/Serializable.cpp
@@ -41,7 +41,7 @@ int8_t Serializable::DSFID() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDDefault);
}
-uint32_t Serializable::objectSize() const { return 0; }
+size_t Serializable::objectSize() const { return 0; }
std::string Serializable::toString() const {
return Utils::demangleTypeName(typeid(*this).name());
}
diff --git a/cppcache/src/ServerLocation.hpp b/cppcache/src/ServerLocation.hpp
index 109c8b13..f89bfb54 100644
--- a/cppcache/src/ServerLocation.hpp
+++ b/cppcache/src/ServerLocation.hpp
@@ -83,7 +83,7 @@ class CPPCACHE_EXPORT ServerLocation : public Serializable {
m_port = input.readInt32();
makeEpString();
}
- uint32_t objectSize() const {
+ size_t objectSize() const {
size_t size = sizeof(ServerLocation);
if (m_serverName) {
size += m_serverName->objectSize();
diff --git a/cppcache/src/ServerLocationRequest.hpp
b/cppcache/src/ServerLocationRequest.hpp
index 8c133700..c51b661b 100644
--- a/cppcache/src/ServerLocationRequest.hpp
+++ b/cppcache/src/ServerLocationRequest.hpp
@@ -33,7 +33,7 @@ class ServerLocationRequest : public Serializable {
virtual int32_t classId() const;
virtual int8_t typeId() const = 0;
virtual int8_t DSFID() const;
- virtual uint32_t objectSize() const = 0;
+ virtual size_t objectSize() const = 0;
virtual ~ServerLocationRequest() {}
};
diff --git a/cppcache/src/ServerLocationResponse.hpp
b/cppcache/src/ServerLocationResponse.hpp
index 3f926158..15bdc951 100644
--- a/cppcache/src/ServerLocationResponse.hpp
+++ b/cppcache/src/ServerLocationResponse.hpp
@@ -38,7 +38,7 @@ class ServerLocationResponse : public Serializable {
virtual int8_t DSFID() const {
return static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDByte);
}
- virtual uint32_t objectSize()
+ virtual size_t objectSize()
const = 0; // Has to be implemented by concrete class
virtual ~ServerLocationResponse() {} // Virtual destructor
};
diff --git a/cppcache/src/TombstoneList.cpp b/cppcache/src/TombstoneList.cpp
index c357e898..582ef898 100644
--- a/cppcache/src/TombstoneList.cpp
+++ b/cppcache/src/TombstoneList.cpp
@@ -68,7 +68,7 @@ void TombstoneList::add(const std::shared_ptr<MapEntryImpl>&
entry,
tombstoneEntryPtr->setExpiryTaskId(taskid);
m_tombstoneMap[key] = tombstoneEntryPtr;
m_cacheImpl->getCachePerfStats().incTombstoneCount();
- int32_t tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
+ auto tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
m_cacheImpl->getCachePerfStats().incTombstoneSize(tombstonesize);
}
@@ -143,7 +143,7 @@ void TombstoneList::eraseEntryFromTombstoneList(
}
m_cacheImpl->getCachePerfStats().decTombstoneCount();
- int32_t tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
+ auto tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
m_cacheImpl->getCachePerfStats().decTombstoneSize(tombstonesize);
m_tombstoneMap.erase(key);
}
@@ -159,7 +159,7 @@ long
TombstoneList::eraseEntryFromTombstoneListWithoutCancelTask(
taskid = static_cast<long>(m_tombstoneMap[key]->getExpiryTaskId());
handler = m_tombstoneMap[key]->getHandler();
m_cacheImpl->getCachePerfStats().decTombstoneCount();
- int32_t tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
+ auto tombstonesize = key->objectSize() + SIZEOF_TOMBSTONEOVERHEAD;
m_cacheImpl->getCachePerfStats().decTombstoneSize(tombstonesize);
m_tombstoneMap.erase(key);
}
diff --git a/cppcache/src/UserFunctionExecutionException.cpp
b/cppcache/src/UserFunctionExecutionException.cpp
index 8b24c156..290c991c 100644
--- a/cppcache/src/UserFunctionExecutionException.cpp
+++ b/cppcache/src/UserFunctionExecutionException.cpp
@@ -38,7 +38,7 @@ int32_t UserFunctionExecutionException::classId() const {
return 0;
}
-uint32_t UserFunctionExecutionException::objectSize() const {
+size_t UserFunctionExecutionException::objectSize() const {
throw IllegalStateException(
"UserFunctionExecutionException::objectSize is not intended for use.");
return 0;
diff --git a/cppcache/src/Utils.hpp b/cppcache/src/Utils.hpp
index 65ffcecd..fa18ff2f 100644
--- a/cppcache/src/Utils.hpp
+++ b/cppcache/src/Utils.hpp
@@ -137,24 +137,21 @@ class CPPCACHE_EXPORT Utils {
// Check objectSize() implementation return value and log a warning at most
// once.
- inline static uint32_t checkAndGetObjectSize(
+ inline static size_t checkAndGetObjectSize(
const std::shared_ptr<Cacheable>& theObject) {
- uint32_t objectSize = theObject->objectSize();
+ auto objectSize = theObject->objectSize();
static bool youHaveBeenWarned = false;
- if ((objectSize == 0 || objectSize == (static_cast<uint32_t>(-1))) &&
- !youHaveBeenWarned) {
+ if (objectSize == 0 && !youHaveBeenWarned) {
LOGWARN(
- "Object size for Heap LRU returned by class ID %d is 0 (zero) or -1 "
- "(UINT32_MAX). "
+ "Object size for Heap LRU returned by class ID %d is 0 (zero)."
"Even for empty objects the size returned should be at least one (1 "
- "byte) and "
- "should not be -1 or UINT32_MAX.",
+ "byte).",
theObject->classId());
youHaveBeenWarned = true;
LOGFINE("Type ID is %d for the object returning zero HeapLRU size",
theObject->typeId());
}
- GF_DEV_ASSERT(objectSize != 0 && objectSize != ((uint32_t)-1));
+ GF_DEV_ASSERT(objectSize != 0);
return objectSize;
}
diff --git a/cppcache/src/VersionedCacheableObjectPartList.cpp
b/cppcache/src/VersionedCacheableObjectPartList.cpp
index cc2c10fc..d8e318ca 100644
--- a/cppcache/src/VersionedCacheableObjectPartList.cpp
+++ b/cppcache/src/VersionedCacheableObjectPartList.cpp
@@ -311,7 +311,7 @@ int8_t VersionedCacheableObjectPartList::DSFID() const {
return GeodeTypeIdsImpl::FixedIDByte;
}
-uint32_t VersionedCacheableObjectPartList::objectSize() const { return 0; }
+size_t VersionedCacheableObjectPartList::objectSize() const { return 0; }
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/VersionedCacheableObjectPartList.hpp
b/cppcache/src/VersionedCacheableObjectPartList.hpp
index 312cac41..99737fd7 100644
--- a/cppcache/src/VersionedCacheableObjectPartList.hpp
+++ b/cppcache/src/VersionedCacheableObjectPartList.hpp
@@ -285,7 +285,7 @@ class VersionedCacheableObjectPartList : public
CacheableObjectPartList {
*/
virtual int8_t DSFID() const;
- virtual uint32_t objectSize() const;
+ virtual size_t objectSize() const;
};
} // namespace client
diff --git
a/docs/geode-native-docs/cpp-caching-api/serialization-using-serializable.html.md.erb
b/docs/geode-native-docs/cpp-caching-api/serialization-using-serializable.html.md.erb
index 3a1edbef..f9b12f62 100644
---
a/docs/geode-native-docs/cpp-caching-api/serialization-using-serializable.html.md.erb
+++
b/docs/geode-native-docs/cpp-caching-api/serialization-using-serializable.html.md.erb
@@ -131,7 +131,7 @@ int32_t classId( )
return 10; // must be unique per class.
}
-virtual uint32_t objectSize() const
+virtual size_t objectSize() const
{
return 10;
}
@@ -243,7 +243,7 @@ virtual int32_t classId( )const
return 10; // must be unique per class.
}
-virtual uint32_t objectSize() const
+virtual size_t objectSize() const
{
return 10;
}
diff --git a/quickstart/cpp/deltaobjects/DeltaExample.hpp
b/quickstart/cpp/deltaobjects/DeltaExample.hpp
index c0bd0778..6c46578d 100644
--- a/quickstart/cpp/deltaobjects/DeltaExample.hpp
+++ b/quickstart/cpp/deltaobjects/DeltaExample.hpp
@@ -143,7 +143,7 @@ class DeltaExample : public Cacheable, public Delta {
virtual int32_t classId() const { return 2; }
- virtual uint32_t objectSize() const { return 0; }
+ virtual size_t objectSize() const { return 0; }
std::shared_ptr<Delta> clone() {
return std::shared_ptr<Delta>(new DeltaExample(this));
diff --git a/quickstart/cpp/queryobjects/Portfolio.hpp
b/quickstart/cpp/queryobjects/Portfolio.hpp
index ac1ba204..b707735c 100644
--- a/quickstart/cpp/queryobjects/Portfolio.hpp
+++ b/quickstart/cpp/queryobjects/Portfolio.hpp
@@ -45,8 +45,7 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
uint8_t* arrayNull;
uint8_t* arrayZeroSize;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -64,8 +63,8 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
std::shared_ptr<CacheableStringArray> nm = nullptr);
virtual ~Portfolio();
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(Portfolio);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(Portfolio);
objectSize += getObjectSize(pkid);
objectSize += getObjectSize(position1);
objectSize += getObjectSize(position2);
diff --git a/quickstart/cpp/queryobjects/Position.hpp
b/quickstart/cpp/queryobjects/Position.hpp
index 4525909f..310e27f0 100644
--- a/quickstart/cpp/queryobjects/Position.hpp
+++ b/quickstart/cpp/queryobjects/Position.hpp
@@ -71,8 +71,8 @@ class TESTOBJECT_EXPORT Position : public
apache::geode::client::Serializable {
virtual int32_t classId() const { return 0x02; }
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(Position);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(Position);
objectSize += bondRating->objectSize();
objectSize += country->objectSize();
objectSize += secId->objectSize();
diff --git a/quickstart/cpp/queryobjects/PositionPdx.hpp
b/quickstart/cpp/queryobjects/PositionPdx.hpp
index 7a5c8ee1..ebdf8ec2 100644
--- a/quickstart/cpp/queryobjects/PositionPdx.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdx.hpp
@@ -77,8 +77,8 @@ class TESTOBJECT_EXPORT PositionPdx
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(PositionPdx);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(PositionPdx);
return objectSize;
}
diff --git a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
index bd26c1bd..90c1db37 100644
--- a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
@@ -78,8 +78,8 @@ class PositionPdxAuto : public
apache::geode::client::PdxSerializable {
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(PositionPdxAuto);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(PositionPdxAuto);
return objectSize;
}
diff --git a/tests/cli/NewTestObject/DeltaEx.cs
b/tests/cli/NewTestObject/DeltaEx.cs
index a6059f8d..ba1384fe 100644
--- a/tests/cli/NewTestObject/DeltaEx.cs
+++ b/tests/cli/NewTestObject/DeltaEx.cs
@@ -82,12 +82,11 @@ public UInt32 ClassId
}
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
- UInt32 objectSize = 0;
- return objectSize;
+ return 0;
}
}
public void SetDelta(bool isDelta)
diff --git a/tests/cli/NewTestObject/DeltaTestImpl.cs
b/tests/cli/NewTestObject/DeltaTestImpl.cs
index c83d730c..492849ac 100644
--- a/tests/cli/NewTestObject/DeltaTestImpl.cs
+++ b/tests/cli/NewTestObject/DeltaTestImpl.cs
@@ -80,7 +80,7 @@ public DeltaTestImpl(Int32 intValue, string strValue, double
doubleVal, byte[] b
this.testobj = testObject;
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
diff --git a/tests/cli/NewTestObject/Portfolio.cs
b/tests/cli/NewTestObject/Portfolio.cs
index c6244969..6f1eea95 100644
--- a/tests/cli/NewTestObject/Portfolio.cs
+++ b/tests/cli/NewTestObject/Portfolio.cs
@@ -45,7 +45,7 @@ public class Portfolio
private static string[] m_secIds = { "SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL" };
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
@@ -269,22 +269,22 @@ public void ToData(DataOutput output)
output.WriteBytes(m_arrayZeroSize);
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
- UInt32 objectSize = 0;
- objectSize += (UInt32)sizeof(Int32);
- objectSize += (UInt32)(m_pkid.Length * sizeof(char));
+ UInt64 objectSize = 0;
+ objectSize += (UInt64)sizeof(Int32);
+ objectSize += (UInt64)(m_pkid.Length * sizeof(char));
objectSize += GetObjectSize(m_position1);
objectSize += GetObjectSize(m_position2);
- objectSize += (UInt32)(m_type.Length * sizeof(char));
- objectSize += (UInt32)(m_status == null ? 0 : sizeof(char) *
m_status.Length);
+ objectSize += (UInt64)(m_type.Length * sizeof(char));
+ objectSize += (UInt64)(m_status == null ? 0 : sizeof(char) *
m_status.Length);
objectSize += (uint)m_names.Length;//TODO:need to calculate properly
- objectSize += (UInt32)(m_newVal == null ? 0 : sizeof(byte) *
m_newVal.Length);
+ objectSize += (UInt64)(m_newVal == null ? 0 : sizeof(byte) *
m_newVal.Length);
objectSize += 8; //TODO:need to calculate properly for m_creationDate.;
- objectSize += (UInt32)(m_arrayZeroSize == null ? 0 : sizeof(byte) *
m_arrayZeroSize.Length);
- objectSize += (UInt32)(m_arrayNull == null ? 0 : sizeof(byte) *
m_arrayNull.Length);
+ objectSize += (UInt64)(m_arrayZeroSize == null ? 0 : sizeof(byte) *
m_arrayZeroSize.Length);
+ objectSize += (UInt64)(m_arrayNull == null ? 0 : sizeof(byte) *
m_arrayNull.Length);
return objectSize;
}
}
diff --git a/tests/cli/NewTestObject/PortfolioPdx.cs
b/tests/cli/NewTestObject/PortfolioPdx.cs
index aaee9ce7..87866c83 100644
--- a/tests/cli/NewTestObject/PortfolioPdx.cs
+++ b/tests/cli/NewTestObject/PortfolioPdx.cs
@@ -46,7 +46,7 @@ public class PortfolioPdx
private static string[] m_secIds = { "SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL" };
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
diff --git a/tests/cli/NewTestObject/Position.cs
b/tests/cli/NewTestObject/Position.cs
index 96c1f577..5e61a110 100644
--- a/tests/cli/NewTestObject/Position.cs
+++ b/tests/cli/NewTestObject/Position.cs
@@ -68,7 +68,7 @@ private void Init()
m_pid = 0;
}
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
@@ -200,27 +200,27 @@ public void ToData(DataOutput output)
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
- UInt32 objectSize = 0;
- objectSize += (UInt32)sizeof(long);
- objectSize += (UInt32) (m_bondRating.Length * sizeof(char));
- objectSize += (UInt32)sizeof(double);
- objectSize += (UInt32)(m_country.Length * sizeof(char));
- objectSize += (UInt32)sizeof(double);
- objectSize += (UInt32)sizeof(Int64);
- objectSize += (UInt32)sizeof(Int64);
- objectSize += (UInt32)sizeof(double);
- objectSize += (UInt32)sizeof(double);
- objectSize += (UInt32)(m_secId.Length * sizeof(char));
- objectSize += (UInt32)(m_secLinks.Length * sizeof(char));
- objectSize += (UInt32)(m_secType == null ? 0 : sizeof(char) *
m_secType.Length);
- objectSize += (UInt32)sizeof(Int32);
- objectSize += (UInt32)(m_underlyer.Length * sizeof(char));
- objectSize += (UInt32)sizeof(Int64);
- objectSize += (UInt32)sizeof(Int32);
+ UInt64 objectSize = 0;
+ objectSize += (UInt64)sizeof(long);
+ objectSize += (UInt64) (m_bondRating.Length * sizeof(char));
+ objectSize += (UInt64)sizeof(double);
+ objectSize += (UInt64)(m_country.Length * sizeof(char));
+ objectSize += (UInt64)sizeof(double);
+ objectSize += (UInt64)sizeof(Int64);
+ objectSize += (UInt64)sizeof(Int64);
+ objectSize += (UInt64)sizeof(double);
+ objectSize += (UInt64)sizeof(double);
+ objectSize += (UInt64)(m_secId.Length * sizeof(char));
+ objectSize += (UInt64)(m_secLinks.Length * sizeof(char));
+ objectSize += (UInt64)(m_secType == null ? 0 : sizeof(char) *
m_secType.Length);
+ objectSize += (UInt64)sizeof(Int32);
+ objectSize += (UInt64)(m_underlyer.Length * sizeof(char));
+ objectSize += (UInt64)sizeof(Int64);
+ objectSize += (UInt64)sizeof(Int32);
return objectSize;
}
}
diff --git a/tests/cli/NewTestObject/PositionPdx.cs
b/tests/cli/NewTestObject/PositionPdx.cs
index f8564959..23b8fb91 100644
--- a/tests/cli/NewTestObject/PositionPdx.cs
+++ b/tests/cli/NewTestObject/PositionPdx.cs
@@ -68,7 +68,7 @@ private void Init()
m_pid = 0;
}
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
diff --git a/tests/cli/NewTestObject/TestObject1.cs
b/tests/cli/NewTestObject/TestObject1.cs
index 7467407c..589b4390 100644
--- a/tests/cli/NewTestObject/TestObject1.cs
+++ b/tests/cli/NewTestObject/TestObject1.cs
@@ -38,7 +38,7 @@ public TestObject1(string objectName, int objectIdentifire)
//Array.ForEach(arr, 'A');
identifire = objectIdentifire;
}
- public UInt32 ObjectSize
+ public UInt64 ObjectSize
{
get
{
diff --git a/tests/cli/PdxClassLibrary/PortfolioPdx.cs
b/tests/cli/PdxClassLibrary/PortfolioPdx.cs
index c331e257..23a91726 100644
--- a/tests/cli/PdxClassLibrary/PortfolioPdx.cs
+++ b/tests/cli/PdxClassLibrary/PortfolioPdx.cs
@@ -46,7 +46,7 @@ public class PortfolioPdx
private static string[] m_secIds = { "SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL" };
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
diff --git a/tests/cli/PdxClassLibrary/PositionPdx.cs
b/tests/cli/PdxClassLibrary/PositionPdx.cs
index 61bfbda9..08440bfe 100644
--- a/tests/cli/PdxClassLibrary/PositionPdx.cs
+++ b/tests/cli/PdxClassLibrary/PositionPdx.cs
@@ -68,7 +68,7 @@ private void Init()
m_pid = 0;
}
- private UInt32 GetObjectSize(IGeodeSerializable obj)
+ private UInt64 GetObjectSize(IGeodeSerializable obj)
{
return (obj == null ? 0 : obj.ObjectSize);
}
diff --git a/tests/cli/PdxClassLibrary/VariousPdxTypes.cs
b/tests/cli/PdxClassLibrary/VariousPdxTypes.cs
index aea41014..13e09586 100644
--- a/tests/cli/PdxClassLibrary/VariousPdxTypes.cs
+++ b/tests/cli/PdxClassLibrary/VariousPdxTypes.cs
@@ -869,7 +869,7 @@ public void FromData(DataInput input)
m_i4 = input.ReadInt32();
}
- public uint ObjectSize
+ public UInt64 ObjectSize
{
get { return 0; }
}
diff --git a/tests/cpp/security/Security.cpp b/tests/cpp/security/Security.cpp
index a179ea8f..631a8bd2 100644
--- a/tests/cpp/security/Security.cpp
+++ b/tests/cpp/security/Security.cpp
@@ -755,7 +755,7 @@ std::shared_ptr<Region> Security::getRegionPtr(const char
*reg) {
try {
if (name.empty()) { // just get a random root region
auto rootRegionVector = m_cache->rootRegions();
- int32_t size = rootRegionVector.size();
+ int32_t size = static_cast<int32_t>(rootRegionVector.size());
if (size == 0) {
FWKEXCEPTION("In Security::getRegionPtr() No regions exist.");
@@ -1009,9 +1009,10 @@ int32_t Security::doEntryOperations() {
int32_t *val =
(int32_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)
->value());
- *val = (*val == keyVal) ? keyVal + 1
- : keyVal; // alternate the value so that
it
- // can be validated later.
+ *val =
+ (*val == keyVal) ? keyVal + 1 : keyVal; // alternate the value
+ // so that it can be
+ // validated later.
int64_t *adjNow =
(int64_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)
->value() +
diff --git a/tests/cpp/testobject/BatchObject.hpp
b/tests/cpp/testobject/BatchObject.hpp
index 22774d74..4ec1624c 100644
--- a/tests/cpp/testobject/BatchObject.hpp
+++ b/tests/cpp/testobject/BatchObject.hpp
@@ -15,10 +15,10 @@
* limitations under the License.
*/
- #pragma once
+#pragma once
- #ifndef GEODE_TESTOBJECT_BATCHOBJECT_H_
- #define GEODE_TESTOBJECT_BATCHOBJECT_H_
+#ifndef GEODE_TESTOBJECT_BATCHOBJECT_H_
+#define GEODE_TESTOBJECT_BATCHOBJECT_H_
/*
* @brief User class for testing the cq functionality.
@@ -52,8 +52,7 @@ class TESTOBJECT_EXPORT BatchObject : public
TimestampedObject {
int32_t batch;
std::shared_ptr<CacheableBytes> byteArray;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -61,20 +60,20 @@ class TESTOBJECT_EXPORT BatchObject : public
TimestampedObject {
BatchObject() : index(0), timestamp(0), batch(0), byteArray(nullptr) {}
BatchObject(int32_t anIndex, int32_t batchSize, int32_t size);
virtual ~BatchObject();
- virtual void toData(apache::geode::client::DataOutput& output) const;
- virtual void fromData(apache::geode::client::DataInput& input);
- virtual int32_t classId() const { return 25; }
- std::string toString() const;
+ virtual void toData(apache::geode::client::DataOutput& output) const
override;
+ virtual void fromData(apache::geode::client::DataInput& input) override;
+ virtual int32_t classId() const override { return 25; }
+ std::string toString() const override;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(BatchObject);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(BatchObject);
return objectSize;
}
- uint64_t getTimestamp() { return timestamp; }
+ uint64_t getTimestamp() override { return timestamp; }
int getIndex() { return index; }
int getBatch() { return batch; }
- void resetTimestamp() {
+ void resetTimestamp() override {
ACE_Time_Value startTime;
startTime = ACE_OS::gettimeofday();
ACE_UINT64 tusec;
diff --git a/tests/cpp/testobject/DeltaFastAssetAccount.hpp
b/tests/cpp/testobject/DeltaFastAssetAccount.hpp
index ddde6c4d..5d925e81 100644
--- a/tests/cpp/testobject/DeltaFastAssetAccount.hpp
+++ b/tests/cpp/testobject/DeltaFastAssetAccount.hpp
@@ -59,8 +59,7 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public
Cacheable, public Delta {
uint64_t timestamp;
bool getBeforeUpdate;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -133,8 +132,8 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public
Cacheable, public Delta {
bool hasDelta() const override { return true; }
- uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(DeltaFastAssetAccount);
+ size_t objectSize() const override {
+ auto objectSize = sizeof(DeltaFastAssetAccount);
return objectSize;
}
diff --git a/tests/cpp/testobject/DeltaPSTObject.hpp
b/tests/cpp/testobject/DeltaPSTObject.hpp
index e5bfceda..57509fb7 100644
--- a/tests/cpp/testobject/DeltaPSTObject.hpp
+++ b/tests/cpp/testobject/DeltaPSTObject.hpp
@@ -69,8 +69,8 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable,
public Delta {
bool hasDelta() const override { return true; }
int32_t classId() const override { return 42; }
- uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(DeltaPSTObject);
+ size_t objectSize() const override {
+ auto objectSize = sizeof(DeltaPSTObject);
return objectSize;
}
void incrementField1() { ++field1; }
diff --git a/tests/cpp/testobject/DeltaTestImpl.hpp
b/tests/cpp/testobject/DeltaTestImpl.hpp
index 6acb49c6..c5037f43 100644
--- a/tests/cpp/testobject/DeltaTestImpl.hpp
+++ b/tests/cpp/testobject/DeltaTestImpl.hpp
@@ -77,7 +77,7 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable,
public Delta {
int32_t classId() const override { return 30; }
- uint32_t objectSize() const override { return 0; }
+ size_t objectSize() const override { return 0; }
std::shared_ptr<Delta> clone() const override {
return std::make_shared<DeltaTestImpl>(*this);
diff --git a/tests/cpp/testobject/EqStruct.hpp
b/tests/cpp/testobject/EqStruct.hpp
index bd66bd4f..7133bfe3 100644
--- a/tests/cpp/testobject/EqStruct.hpp
+++ b/tests/cpp/testobject/EqStruct.hpp
@@ -98,8 +98,7 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject {
char* var8;
char* var9;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -112,8 +111,8 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject
{
virtual int32_t classId() const override { return 101; }
std::string toString() const override;
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(EqStruct);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(EqStruct);
return objectSize;
}
diff --git a/tests/cpp/testobject/FastAsset.hpp
b/tests/cpp/testobject/FastAsset.hpp
index 7888926a..1265ce6c 100644
--- a/tests/cpp/testobject/FastAsset.hpp
+++ b/tests/cpp/testobject/FastAsset.hpp
@@ -51,7 +51,7 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
int32_t assetId;
double value;
- inline uint32_t getObjectSize(const std::shared_ptr<Serializable>& obj)
const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -63,8 +63,8 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 24; }
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(FastAsset);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(FastAsset);
return objectSize;
}
diff --git a/tests/cpp/testobject/FastAssetAccount.hpp
b/tests/cpp/testobject/FastAssetAccount.hpp
index 23a40315..2d4060f1 100644
--- a/tests/cpp/testobject/FastAssetAccount.hpp
+++ b/tests/cpp/testobject/FastAssetAccount.hpp
@@ -54,8 +54,7 @@ class TESTOBJECT_EXPORT FastAssetAccount : public
TimestampedObject {
std::shared_ptr<CacheableHashMap> assets;
uint64_t timestamp;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -74,8 +73,8 @@ class TESTOBJECT_EXPORT FastAssetAccount : public
TimestampedObject {
virtual int32_t classId() const { return 23; }
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(FastAssetAccount);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(FastAssetAccount);
return objectSize;
}
diff --git a/tests/cpp/testobject/InvalidPdxUsage.hpp
b/tests/cpp/testobject/InvalidPdxUsage.hpp
index 8a0dfc0d..e33cd826 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.hpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.hpp
@@ -529,8 +529,8 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public
PdxSerializable {
virtual ~InvalidPdxUsage() {}
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(InvalidPdxUsage);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(InvalidPdxUsage);
return objectSize;
}
diff --git a/tests/cpp/testobject/NestedPdxObject.hpp
b/tests/cpp/testobject/NestedPdxObject.hpp
index 65bd56d1..ab417d28 100644
--- a/tests/cpp/testobject/NestedPdxObject.hpp
+++ b/tests/cpp/testobject/NestedPdxObject.hpp
@@ -66,8 +66,8 @@ class TESTOBJECT_EXPORT ChildPdx : public PdxSerializable {
virtual ~ChildPdx();
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(ChildPdx);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(ChildPdx);
return objectSize;
}
@@ -157,8 +157,8 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
virtual ~ParentPdx();
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(ParentPdx);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(ParentPdx);
return objectSize;
}
diff --git a/tests/cpp/testobject/PSTObject.hpp
b/tests/cpp/testobject/PSTObject.hpp
index 0640d7e8..1f7d2e60 100644
--- a/tests/cpp/testobject/PSTObject.hpp
+++ b/tests/cpp/testobject/PSTObject.hpp
@@ -52,8 +52,7 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
int8_t field2;
std::shared_ptr<CacheableBytes> valueData;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -66,8 +65,8 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
virtual int32_t classId() const { return 0x04; }
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(PSTObject);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(PSTObject);
objectSize += getObjectSize(valueData);
return objectSize;
}
diff --git a/tests/cpp/testobject/PdxType.hpp b/tests/cpp/testobject/PdxType.hpp
index d738f75d..310c626a 100644
--- a/tests/cpp/testobject/PdxType.hpp
+++ b/tests/cpp/testobject/PdxType.hpp
@@ -657,8 +657,8 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
virtual ~PdxType() {}
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(PdxType);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(PdxType);
return objectSize;
}
diff --git a/tests/cpp/testobject/PdxVersioned1.hpp
b/tests/cpp/testobject/PdxVersioned1.hpp
index a37583fb..4b1263ae 100644
--- a/tests/cpp/testobject/PdxVersioned1.hpp
+++ b/tests/cpp/testobject/PdxVersioned1.hpp
@@ -128,8 +128,8 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public
PdxSerializable {
virtual ~PdxVersioned1() {}
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(PdxVersioned1);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(PdxVersioned1);
return objectSize;
}
// void checkNullAndDelete(void *data);
diff --git a/tests/cpp/testobject/PdxVersioned2.hpp
b/tests/cpp/testobject/PdxVersioned2.hpp
index dd4ccbc3..3c31dc0f 100644
--- a/tests/cpp/testobject/PdxVersioned2.hpp
+++ b/tests/cpp/testobject/PdxVersioned2.hpp
@@ -132,8 +132,8 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public
PdxSerializable {
virtual ~PdxVersioned2() {}
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(PdxVersioned2);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(PdxVersioned2);
return objectSize;
}
// void checkNullAndDelete(void *data);
diff --git a/tests/cpp/testobject/Portfolio.hpp
b/tests/cpp/testobject/Portfolio.hpp
index a8f67757..1b0a8077 100644
--- a/tests/cpp/testobject/Portfolio.hpp
+++ b/tests/cpp/testobject/Portfolio.hpp
@@ -49,8 +49,7 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
uint8_t* arrayNull;
uint8_t* arrayZeroSize;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -68,8 +67,8 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
std::shared_ptr<CacheableStringArray> nm = nullptr);
virtual ~Portfolio();
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(Portfolio);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(Portfolio);
objectSize += getObjectSize(pkid);
objectSize += getObjectSize(position1);
objectSize += getObjectSize(position2);
diff --git a/tests/cpp/testobject/Position.hpp
b/tests/cpp/testobject/Position.hpp
index e81b2e71..0904bf95 100644
--- a/tests/cpp/testobject/Position.hpp
+++ b/tests/cpp/testobject/Position.hpp
@@ -62,8 +62,7 @@ class TESTOBJECT_EXPORT Position : public
apache::geode::client::Serializable {
int64_t volatility;
int32_t pid;
- inline uint32_t getObjectSize(
- const std::shared_ptr<Serializable>& obj) const {
+ inline size_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -80,8 +79,8 @@ class TESTOBJECT_EXPORT Position : public
apache::geode::client::Serializable {
virtual int32_t classId() const { return 0x02; }
std::string toString() const;
- virtual uint32_t objectSize() const {
- uint32_t objectSize = sizeof(Position);
+ virtual size_t objectSize() const {
+ auto objectSize = sizeof(Position);
objectSize += getObjectSize(bondRating);
objectSize += getObjectSize(country);
objectSize += getObjectSize(secId);
diff --git a/tests/cpp/testobject/PositionPdx.hpp
b/tests/cpp/testobject/PositionPdx.hpp
index cfa0b3fa..5909a31b 100644
--- a/tests/cpp/testobject/PositionPdx.hpp
+++ b/tests/cpp/testobject/PositionPdx.hpp
@@ -81,8 +81,8 @@ class TESTOBJECT_EXPORT PositionPdx
std::string toString() const override;
- virtual uint32_t objectSize() const override {
- uint32_t objectSize = sizeof(PositionPdx);
+ virtual size_t objectSize() const override {
+ auto objectSize = sizeof(PositionPdx);
return objectSize;
}
diff --git a/tests/cpp/testobject/TestObject1.hpp
b/tests/cpp/testobject/TestObject1.hpp
index f57325fc..ecefaf3d 100644
--- a/tests/cpp/testobject/TestObject1.hpp
+++ b/tests/cpp/testobject/TestObject1.hpp
@@ -55,7 +55,7 @@ class TESTOBJECT_EXPORT TestObject1 : public Cacheable {
int32_t classId() const { return 31; }
- uint32_t objectSize() const { return 0; }
+ size_t objectSize() const { return 0; }
static Serializable* create();
};
diff --git a/tests/cpp/testobject/TimestampedObject.hpp
b/tests/cpp/testobject/TimestampedObject.hpp
index e24447a4..b0c25040 100644
--- a/tests/cpp/testobject/TimestampedObject.hpp
+++ b/tests/cpp/testobject/TimestampedObject.hpp
@@ -43,7 +43,7 @@ class TESTOBJECT_EXPORT TimestampedObject
virtual void fromData(apache::geode::client::DataInput& input) {}
virtual void toData(apache::geode::client::DataOutput& output) const {}
virtual int32_t classId() const { return 0; }
- virtual uint32_t objectSize() const { return 0; }
+ virtual size_t objectSize() const { return 0; }
virtual ~TimestampedObject() {}
};
} // namespace testobject
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Serializable::objectSize should return size_t
> ---------------------------------------------
>
> Key: GEODE-4082
> URL: https://issues.apache.org/jira/browse/GEODE-4082
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: Jacob S. Barrett
> Assignee: Jacob S. Barrett
>
> For consistency with C++11 object sizes returned from
> {Serializable::objectSize} should be of type {size_t}. For consistency and
> counting of larger collections .NET interface {IGeodeSerializable.ObjectSize}
> should return {System::UInt64}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)