http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxRemoteWriter.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxRemoteWriter.cpp b/src/clicache/src/impl/PdxRemoteWriter.cpp index 4696d03..e55abad 100644 --- a/src/clicache/src/impl/PdxRemoteWriter.cpp +++ b/src/clicache/src/impl/PdxRemoteWriter.cpp @@ -25,312 +25,310 @@ namespace Apache { namespace Client { -namespace Generic - { + namespace Internal { - /* - * Purpose of this class to map local type to remote type - * If remote type will have extra field then we have to merge that field - * if local type has field then need to put on stream - */ + /* + * Purpose of this class to map local type to remote type + * If remote type will have extra field then we have to merge that field + * if local type has field then need to put on stream + */ - void PdxRemoteWriter::writePreserveData() - { - m_currentDataIdx++;//it starts from -1 + void PdxRemoteWriter::writePreserveData() + { + m_currentDataIdx++;//it starts from -1 - if(m_preserveData != nullptr) + if (m_preserveData != nullptr) + { + while (m_currentDataIdx < m_remoteTolocalMap->Length) { - while(m_currentDataIdx < m_remoteTolocalMap->Length) + if (m_remoteTolocalMap[m_currentDataIdx] == -1)//need to add preserve data with offset { - if(m_remoteTolocalMap[m_currentDataIdx] == -1)//need to add preserve data with offset - { - PdxLocalWriter::AddOffset(); - m_dataOutput->WriteBytesOnly(m_preserveData[m_preserveDataIdx++]); - m_currentDataIdx++; - } - else if(m_remoteTolocalMap[m_currentDataIdx] == -2)//need to add preserve data WITHOUT offset - { - m_dataOutput->WriteBytesOnly(m_preserveData[m_preserveDataIdx++]); - m_currentDataIdx++; - } - else - { - break; //continue writing local data.. - } + PdxLocalWriter::AddOffset(); + m_dataOutput->WriteBytesOnly(m_preserveData[m_preserveDataIdx++]); + m_currentDataIdx++; + } + else if (m_remoteTolocalMap[m_currentDataIdx] == -2)//need to add preserve data WITHOUT offset + { + m_dataOutput->WriteBytesOnly(m_preserveData[m_preserveDataIdx++]); + m_currentDataIdx++; + } + else + { + break; //continue writing local data.. } } } - - void PdxRemoteWriter::initialize() - { - //this is default case - if(m_preserveData == nullptr) - { - //this needs to fix for IPdxTypeMapper - m_pdxType = PdxTypeRegistry::GetLocalPdxType(m_pdxClassName); - m_offsets = gcnew array<int>(m_pdxType->NumberOfVarLenFields); - } - } - - bool PdxRemoteWriter::isFieldWritingStarted() - { - return m_currentDataIdx != -1;//field writing NOT started. do we need this?? - } - - IPdxWriter^ PdxRemoteWriter::WriteUnreadFields(IPdxUnreadFields^ unread) - { - PdxLocalWriter::WriteUnreadFields(unread); - m_remoteTolocalMap = m_pdxType->GetRemoteToLocalMap(); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteByte( String^ fieldName, SByte value ) - { - writePreserveData(); - PdxLocalWriter::WriteByte(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteSByte( String^ fieldName, SByte value ) - { - writePreserveData(); - PdxLocalWriter::WriteSByte(fieldName, value); - return this; - - } - - IPdxWriter^ PdxRemoteWriter::WriteBoolean( String^ fieldName, bool value ) - { - writePreserveData(); - PdxLocalWriter::WriteBoolean(fieldName, value); - return this; - - } - - IPdxWriter^ PdxRemoteWriter::WriteChar( String^ fieldName, Char value ) - { - writePreserveData(); - PdxLocalWriter::WriteChar(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteUInt16( String^ fieldName, uint16_t value ) - { - writePreserveData(); - PdxLocalWriter::WriteUInt16(fieldName, value); - return this; - - } - - IPdxWriter^ PdxRemoteWriter::WriteUInt32( String^ fieldName, uint32_t value ) - { - writePreserveData(); - PdxLocalWriter::WriteUInt32(fieldName, value); - return this; - - } - - IPdxWriter^ PdxRemoteWriter::WriteUInt64( String^ fieldName, uint64_t value ) - { - writePreserveData(); - PdxLocalWriter::WriteUInt64(fieldName, value); - return this; - - } - - IPdxWriter^ PdxRemoteWriter::WriteShort( String^ fieldName, int16_t value ) - { - writePreserveData(); - PdxLocalWriter::WriteShort(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteInt( String^ fieldName, int32_t value ) - { - writePreserveData(); - PdxLocalWriter::WriteInt(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteLong( String^ fieldName, Int64 value ) - { - writePreserveData(); - PdxLocalWriter::WriteLong(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteFloat( String^ fieldName, float value ) - { - writePreserveData(); - PdxLocalWriter::WriteFloat(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteDouble( String^ fieldName, double value ) - { - writePreserveData(); - PdxLocalWriter::WriteDouble(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteString( String^ fieldName, String^ value ) - { - writePreserveData(); - PdxLocalWriter::WriteString(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteUTFHuge( String^ fieldName, String^ value ) - { - writePreserveData(); - PdxLocalWriter::WriteUTFHuge(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteASCIIHuge( String^ fieldName, String^ value ) - { - writePreserveData(); - PdxLocalWriter::WriteASCIIHuge(fieldName, value); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteObject( String^ fieldName, Object^ obj ) - { - writePreserveData(); - PdxLocalWriter::WriteObject(fieldName, obj); - return this; - } - - //TODO: - //IPdxWriter^ PdxRemoteWriter::WriteMap( String^ fieldName, System::Collections::IDictionary^ map ); - - IPdxWriter^ PdxRemoteWriter::WriteCollection( String^ fieldName, System::Collections::IList^ obj) - { - writePreserveData(); - PdxLocalWriter::WriteCollection(fieldName, obj); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteDate( String^ fieldName, System::DateTime date) - { - writePreserveData(); - PdxLocalWriter::WriteDate(fieldName, date); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteBooleanArray( String^ fieldName, array<bool>^ boolArray) - { - writePreserveData(); - PdxLocalWriter::WriteBooleanArray(fieldName, boolArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteCharArray(String^ fieldName, array<Char>^ charArray) - { - writePreserveData(); - PdxLocalWriter::WriteCharArray(fieldName, charArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteByteArray(String^ fieldName, array<Byte>^ byteArray) - { - writePreserveData(); - PdxLocalWriter::WriteByteArray(fieldName, byteArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteSByteArray(String^ fieldName, array<SByte>^ sbyteArray) - { - writePreserveData(); - PdxLocalWriter::WriteSByteArray(fieldName, sbyteArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteShortArray(String^ fieldName, array<System::Int16>^ shortArray) - { - writePreserveData(); - PdxLocalWriter::WriteShortArray(fieldName, shortArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteUnsignedShortArray(String^ fieldName, array<System::UInt16>^ ushortArray) - { - writePreserveData(); - PdxLocalWriter::WriteUnsignedShortArray(fieldName, ushortArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteIntArray(String^ fieldName, array<System::Int32>^ intArray) - { - writePreserveData(); - PdxLocalWriter::WriteIntArray(fieldName, intArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteUnsignedIntArray(String^ fieldName, array<System::UInt32>^ uintArray) - { - writePreserveData(); - PdxLocalWriter::WriteUnsignedIntArray(fieldName, uintArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteLongArray(String^ fieldName, array<Int64>^ longArray) - { - writePreserveData(); - PdxLocalWriter::WriteLongArray(fieldName, longArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteUnsignedLongArray(String^ fieldName, array<System::UInt64>^ ulongArray) - { - writePreserveData(); - PdxLocalWriter::WriteUnsignedLongArray(fieldName, ulongArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteFloatArray(String^ fieldName, array<float>^ floatArray) - { - writePreserveData(); - PdxLocalWriter::WriteFloatArray(fieldName, floatArray); - return this; - } + } + + void PdxRemoteWriter::initialize() + { + //this is default case + if (m_preserveData == nullptr) + { + //this needs to fix for IPdxTypeMapper + m_pdxType = PdxTypeRegistry::GetLocalPdxType(m_pdxClassName); + m_offsets = gcnew array<int>(m_pdxType->NumberOfVarLenFields); + } + } + + bool PdxRemoteWriter::isFieldWritingStarted() + { + return m_currentDataIdx != -1;//field writing NOT started. do we need this?? + } + + IPdxWriter^ PdxRemoteWriter::WriteUnreadFields(IPdxUnreadFields^ unread) + { + PdxLocalWriter::WriteUnreadFields(unread); + m_remoteTolocalMap = m_pdxType->GetRemoteToLocalMap(); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteByte(String^ fieldName, SByte value) + { + writePreserveData(); + PdxLocalWriter::WriteByte(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteSByte(String^ fieldName, SByte value) + { + writePreserveData(); + PdxLocalWriter::WriteSByte(fieldName, value); + return this; + + } + + IPdxWriter^ PdxRemoteWriter::WriteBoolean(String^ fieldName, bool value) + { + writePreserveData(); + PdxLocalWriter::WriteBoolean(fieldName, value); + return this; + + } + + IPdxWriter^ PdxRemoteWriter::WriteChar(String^ fieldName, Char value) + { + writePreserveData(); + PdxLocalWriter::WriteChar(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteUInt16(String^ fieldName, uint16_t value) + { + writePreserveData(); + PdxLocalWriter::WriteUInt16(fieldName, value); + return this; + + } + + IPdxWriter^ PdxRemoteWriter::WriteUInt32(String^ fieldName, uint32_t value) + { + writePreserveData(); + PdxLocalWriter::WriteUInt32(fieldName, value); + return this; + + } + + IPdxWriter^ PdxRemoteWriter::WriteUInt64(String^ fieldName, uint64_t value) + { + writePreserveData(); + PdxLocalWriter::WriteUInt64(fieldName, value); + return this; + + } + + IPdxWriter^ PdxRemoteWriter::WriteShort(String^ fieldName, int16_t value) + { + writePreserveData(); + PdxLocalWriter::WriteShort(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteInt(String^ fieldName, int32_t value) + { + writePreserveData(); + PdxLocalWriter::WriteInt(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteLong(String^ fieldName, Int64 value) + { + writePreserveData(); + PdxLocalWriter::WriteLong(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteFloat(String^ fieldName, float value) + { + writePreserveData(); + PdxLocalWriter::WriteFloat(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteDouble(String^ fieldName, double value) + { + writePreserveData(); + PdxLocalWriter::WriteDouble(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteString(String^ fieldName, String^ value) + { + writePreserveData(); + PdxLocalWriter::WriteString(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteUTFHuge(String^ fieldName, String^ value) + { + writePreserveData(); + PdxLocalWriter::WriteUTFHuge(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteASCIIHuge(String^ fieldName, String^ value) + { + writePreserveData(); + PdxLocalWriter::WriteASCIIHuge(fieldName, value); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteObject(String^ fieldName, Object^ obj) + { + writePreserveData(); + PdxLocalWriter::WriteObject(fieldName, obj); + return this; + } + + //TODO: + //IPdxWriter^ PdxRemoteWriter::WriteMap( String^ fieldName, System::Collections::IDictionary^ map ); + + IPdxWriter^ PdxRemoteWriter::WriteCollection(String^ fieldName, System::Collections::IList^ obj) + { + writePreserveData(); + PdxLocalWriter::WriteCollection(fieldName, obj); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteDate(String^ fieldName, System::DateTime date) + { + writePreserveData(); + PdxLocalWriter::WriteDate(fieldName, date); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteBooleanArray(String^ fieldName, array<bool>^ boolArray) + { + writePreserveData(); + PdxLocalWriter::WriteBooleanArray(fieldName, boolArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteCharArray(String^ fieldName, array<Char>^ charArray) + { + writePreserveData(); + PdxLocalWriter::WriteCharArray(fieldName, charArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteByteArray(String^ fieldName, array<Byte>^ byteArray) + { + writePreserveData(); + PdxLocalWriter::WriteByteArray(fieldName, byteArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteSByteArray(String^ fieldName, array<SByte>^ sbyteArray) + { + writePreserveData(); + PdxLocalWriter::WriteSByteArray(fieldName, sbyteArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteShortArray(String^ fieldName, array<System::Int16>^ shortArray) + { + writePreserveData(); + PdxLocalWriter::WriteShortArray(fieldName, shortArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteUnsignedShortArray(String^ fieldName, array<System::UInt16>^ ushortArray) + { + writePreserveData(); + PdxLocalWriter::WriteUnsignedShortArray(fieldName, ushortArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteIntArray(String^ fieldName, array<System::Int32>^ intArray) + { + writePreserveData(); + PdxLocalWriter::WriteIntArray(fieldName, intArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteUnsignedIntArray(String^ fieldName, array<System::UInt32>^ uintArray) + { + writePreserveData(); + PdxLocalWriter::WriteUnsignedIntArray(fieldName, uintArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteLongArray(String^ fieldName, array<Int64>^ longArray) + { + writePreserveData(); + PdxLocalWriter::WriteLongArray(fieldName, longArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteUnsignedLongArray(String^ fieldName, array<System::UInt64>^ ulongArray) + { + writePreserveData(); + PdxLocalWriter::WriteUnsignedLongArray(fieldName, ulongArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteFloatArray(String^ fieldName, array<float>^ floatArray) + { + writePreserveData(); + PdxLocalWriter::WriteFloatArray(fieldName, floatArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteDoubleArray(String^ fieldName, array<double>^ doubleArray) + { + writePreserveData(); + PdxLocalWriter::WriteDoubleArray(fieldName, doubleArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteStringArray(String^ fieldName, array<String^>^ stringArray) + { + writePreserveData(); + PdxLocalWriter::WriteStringArray(fieldName, stringArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteObjectArray(String^ fieldName, List<Object^>^ objectArray) + { + writePreserveData(); + PdxLocalWriter::WriteObjectArray(fieldName, objectArray); + return this; + } + + IPdxWriter^ PdxRemoteWriter::WriteArrayOfByteArrays(String^ fieldName, array<array<Byte>^>^ byteArrays) + { + writePreserveData(); + PdxLocalWriter::WriteArrayOfByteArrays(fieldName, byteArrays); + return this; + } + + //TODO: + //IPdxWriter^ PdxRemoteWriter::WriteEnum(String^ fieldName, Enum e) ; + //IPdxWriter^ PdxRemoteWriter::WriteInetAddress(String^ fieldName, InetAddress address); + + } // namespace Internal + } // namespace Client + } // namespace Geode +} // namespace Apache - IPdxWriter^ PdxRemoteWriter::WriteDoubleArray(String^ fieldName, array<double>^ doubleArray) - { - writePreserveData(); - PdxLocalWriter::WriteDoubleArray(fieldName, doubleArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteStringArray(String^ fieldName, array<String^>^ stringArray) - { - writePreserveData(); - PdxLocalWriter::WriteStringArray(fieldName, stringArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteObjectArray(String^ fieldName, List<Object^>^ objectArray) - { - writePreserveData(); - PdxLocalWriter::WriteObjectArray(fieldName, objectArray); - return this; - } - - IPdxWriter^ PdxRemoteWriter::WriteArrayOfByteArrays(String^ fieldName, array<array<Byte>^>^ byteArrays) - { - writePreserveData(); - PdxLocalWriter::WriteArrayOfByteArrays(fieldName, byteArrays); - return this; - } - - //TODO: - //IPdxWriter^ PdxRemoteWriter::WriteEnum(String^ fieldName, Enum e) ; - //IPdxWriter^ PdxRemoteWriter::WriteInetAddress(String^ fieldName, InetAddress address); - - - } - } - } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxRemoteWriter.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxRemoteWriter.hpp b/src/clicache/src/impl/PdxRemoteWriter.hpp index fa1c0d0..beceeed 100644 --- a/src/clicache/src/impl/PdxRemoteWriter.hpp +++ b/src/clicache/src/impl/PdxRemoteWriter.hpp @@ -28,8 +28,7 @@ namespace Apache { namespace Client { -namespace Generic - { + ref class DataOutput; namespace Internal { @@ -332,8 +331,8 @@ namespace Generic virtual IPdxWriter^ WriteUnreadFields(IPdxUnreadFields^ unread) override; }; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxType.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxType.cpp b/src/clicache/src/impl/PdxType.cpp index d0de6a7..8d3319e 100644 --- a/src/clicache/src/impl/PdxType.cpp +++ b/src/clicache/src/impl/PdxType.cpp @@ -31,49 +31,47 @@ namespace Apache { namespace Client { -namespace Generic - { namespace Internal { - void PdxType::AddFixedLengthTypeField(String^ fieldName, String^ className, - Byte typeId, Int32 size) + void PdxType::AddFixedLengthTypeField(String^ fieldName, String^ className, + Byte typeId, Int32 size) { int current = m_pdxFieldTypes->Count; PdxFieldType^ pfType = gcnew PdxFieldType(fieldName, className, (Byte)typeId, - current/*field index*/, - false, size, 0/*var len field idx*/); + current/*field index*/, + false, size, 0/*var len field idx*/); m_pdxFieldTypes->Add(pfType); - //this will make sure one can't add same field name + //this will make sure one can't add same field name m_fieldNameVsPdxType->Add(fieldName, pfType); } - void PdxType::AddVariableLengthTypeField(String^ fieldName, String^ className, - Byte typeId) + void PdxType::AddVariableLengthTypeField(String^ fieldName, String^ className, + Byte typeId) { - //we don't store offset of first var len field, this is the purpose of following check - if(m_isVarLenFieldAdded) + //we don't store offset of first var len field, this is the purpose of following check + if (m_isVarLenFieldAdded) m_varLenFieldIdx++;//it initial value is zero so variable length field idx start with zero - + m_numberOfVarLenFields++; m_isVarLenFieldAdded = true; int current = m_pdxFieldTypes->Count; - PdxFieldType^ pfType = gcnew PdxFieldType(fieldName, className, (Byte)typeId, - current, true, -1, m_varLenFieldIdx); + PdxFieldType^ pfType = gcnew PdxFieldType(fieldName, className, (Byte)typeId, + current, true, -1, m_varLenFieldIdx); m_pdxFieldTypes->Add(pfType); - //this will make sure one can't add same field name + //this will make sure one can't add same field name m_fieldNameVsPdxType->Add(fieldName, pfType); } - void PdxType::ToData( DataOutput^ output ) + void PdxType::ToData(DataOutput^ output) { - //defaulf java Dataserializable require this + //defaulf java Dataserializable require this output->WriteByte(GemFireClassIds::DATA_SERIALIZABLE); output->WriteByte(GemFireClassIds::JAVA_CLASS); output->WriteObject((Object^)m_javaPdxClass); - //pdx type + //pdx type output->WriteString(m_className); output->WriteBoolean(m_noJavaClass); output->WriteInt32(m_gemfireTypeId); @@ -81,54 +79,54 @@ namespace Generic output->WriteArrayLen(m_pdxFieldTypes->Count); - for(int i =0; i < m_pdxFieldTypes->Count; i++) + for (int i = 0; i < m_pdxFieldTypes->Count; i++) { m_pdxFieldTypes[i]->ToData(output); } } - - IGFSerializable^ PdxType::FromData( DataInput^ input ) + + IGFSerializable^ PdxType::FromData(DataInput^ input) { - //defaulf java Dataserializable require this + //defaulf java Dataserializable require this Byte val = input->ReadByte();//DS Byte val1 = input->ReadByte();//class input->ReadObject();//classname m_className = input->ReadString(); //Object^ pdxObject = Serializable::GetPdxType(m_className); - // m_pdxDomainType = pdxObject->GetType(); + // m_pdxDomainType = pdxObject->GetType(); /*PdxWrapper^ pdxWrapper = dynamic_cast<PdxWrapper^>(pdxObject); if(pdxWrapper == nullptr) - m_pdxDomainType = pdxObject->GetType(); + m_pdxDomainType = pdxObject->GetType(); else - m_pdxDomainType = pdxWrapper->GetObject()->GetType();*/ + m_pdxDomainType = pdxWrapper->GetObject()->GetType();*/ //Log::Debug("PdxType::FromData " + m_className); m_noJavaClass = input->ReadBoolean(); m_gemfireTypeId = input->ReadInt32(); m_varLenFieldIdx = input->ReadInt32(); int len = input->ReadArrayLen(); - - bool foundVarLenType = false; - for(int i = 0; i < len; i++) + + bool foundVarLenType = false; + for (int i = 0; i < len; i++) { PdxFieldType^ pft = gcnew PdxFieldType(); pft->FromData(input); m_pdxFieldTypes->Add(pft); - if(pft->IsVariableLengthType == true) - foundVarLenType = true; + if (pft->IsVariableLengthType == true) + foundVarLenType = true; } - //as m_varLenFieldIdx starts with 0 - if(m_varLenFieldIdx != 0) - m_numberOfVarLenFields = m_varLenFieldIdx + 1; - else if(foundVarLenType) - m_numberOfVarLenFields = 1; - - InitializeType(); + //as m_varLenFieldIdx starts with 0 + if (m_varLenFieldIdx != 0) + m_numberOfVarLenFields = m_varLenFieldIdx + 1; + else if (foundVarLenType) + m_numberOfVarLenFields = 1; + + InitializeType(); return this; } @@ -147,9 +145,9 @@ namespace Generic PdxFieldType^ pft = nullptr; m_fieldNameVsPdxType->TryGetValue(fieldName, pft); - if(pft != nullptr) + if (pft != nullptr) { - if(pft->IsVariableLengthType) + if (pft->IsVariableLengthType) return variableLengthFieldPosition(pft, offsetPosition, offsetSize, pdxStreamlen); else return fixedLengthFieldPosition(pft, offsetPosition, offsetSize, pdxStreamlen); @@ -161,10 +159,10 @@ namespace Generic Int32 PdxType::GetFieldPosition(Int32 fieldIdx, uint8_t* offsetPosition, Int32 offsetSize, Int32 pdxStreamlen) { PdxFieldType^ pft = m_pdxFieldTypes[fieldIdx]; - - if(pft != nullptr) + + if (pft != nullptr) { - if(pft->IsVariableLengthType) + if (pft->IsVariableLengthType) return variableLengthFieldPosition(pft, offsetPosition, offsetSize, pdxStreamlen); else return fixedLengthFieldPosition(pft, offsetPosition, offsetSize, pdxStreamlen); @@ -175,49 +173,49 @@ namespace Generic Int32 PdxType::variableLengthFieldPosition(PdxFieldType^ varLenField, uint8_t* offsetPosition, Int32 offsetSize, Int32 pdxStreamlen) { - int seqId = varLenField->SequenceId; + int seqId = varLenField->SequenceId; - int offset = varLenField->VarLenOffsetIndex ; + int offset = varLenField->VarLenOffsetIndex; - if(offset == -1) + if (offset == -1) return /*first var len field*/ varLenField->RelativeOffset; else { - //we write offset from behind - return PdxHelper::ReadInt(offsetPosition + (m_numberOfVarLenFields - offset - 1)*offsetSize ,offsetSize); + //we write offset from behind + return PdxHelper::ReadInt(offsetPosition + (m_numberOfVarLenFields - offset - 1)*offsetSize, offsetSize); } } Int32 PdxType::fixedLengthFieldPosition(PdxFieldType^ fixLenField, uint8_t* offsetPosition, Int32 offsetSize, Int32 pdxStreamlen) { - int seqId = fixLenField->SequenceId; + int seqId = fixLenField->SequenceId; int offset = fixLenField->VarLenOffsetIndex; - if(fixLenField->RelativeOffset >= 0) + if (fixLenField->RelativeOffset >= 0) { - //starting fields - return fixLenField->RelativeOffset ; + //starting fields + return fixLenField->RelativeOffset; } - else if(offset == -1) //Pdx length + else if (offset == -1) //Pdx length { - //there is no var len field so just subtracts relative offset from behind - return pdxStreamlen + fixLenField->RelativeOffset ; + //there is no var len field so just subtracts relative offset from behind + return pdxStreamlen + fixLenField->RelativeOffset; } else { - //need to read offset and then subtract relative offset - return PdxHelper::ReadInt(offsetPosition + - (m_numberOfVarLenFields - offset -1)*offsetSize, - offsetSize) - + fixLenField->RelativeOffset ; + //need to read offset and then subtract relative offset + return PdxHelper::ReadInt(offsetPosition + + (m_numberOfVarLenFields - offset - 1)*offsetSize, + offsetSize) + + fixLenField->RelativeOffset; } } PdxType^ PdxType::isLocalTypeContains(PdxType^ otherType) { - if(m_pdxFieldTypes->Count >= otherType->m_pdxFieldTypes->Count) + if (m_pdxFieldTypes->Count >= otherType->m_pdxFieldTypes->Count) { return isContains(this, otherType); } @@ -226,7 +224,7 @@ namespace Generic PdxType^ PdxType::isRemoteTypeContains(PdxType^ remoteType) { - if(m_pdxFieldTypes->Count <= remoteType->m_pdxFieldTypes->Count) + if (m_pdxFieldTypes->Count <= remoteType->m_pdxFieldTypes->Count) { return isContains(remoteType, this); } @@ -238,43 +236,43 @@ namespace Generic int nTotalFields = otherVersion->m_pdxFieldTypes->Count; PdxType^ contains = nullptr; - if(isLocalTypeContains(otherVersion) != nullptr) + if (isLocalTypeContains(otherVersion) != nullptr) return this; - if(isRemoteTypeContains(otherVersion) != nullptr) + if (isRemoteTypeContains(otherVersion) != nullptr) return otherVersion; //need to create new one, clone of local PdxType^ newone = clone(); int varLenFields = newone->m_numberOfVarLenFields; - + for each(PdxFieldType^ tmp in otherVersion->m_pdxFieldTypes) { bool found = false; for each(PdxFieldType^ tmpNew in newone->m_pdxFieldTypes) { - if(tmpNew->Equals(tmp)) + if (tmpNew->Equals(tmp)) { found = true; break; } } - if(!found) + if (!found) { - PdxFieldType^ newFt = gcnew PdxFieldType(tmp->FieldName, - tmp->ClassName, - tmp->TypeId, - newone->m_pdxFieldTypes->Count,//sequence id - tmp->IsVariableLengthType, - tmp->Size, - (tmp->IsVariableLengthType? varLenFields++/*it increase after that*/: 0)); + PdxFieldType^ newFt = gcnew PdxFieldType(tmp->FieldName, + tmp->ClassName, + tmp->TypeId, + newone->m_pdxFieldTypes->Count,//sequence id + tmp->IsVariableLengthType, + tmp->Size, + (tmp->IsVariableLengthType ? varLenFields++/*it increase after that*/ : 0)); newone->m_pdxFieldTypes->Add(newFt);//fieldnameVsPFT will happen after that } } newone->m_numberOfVarLenFields = varLenFields; - if(varLenFields >0) + if (varLenFields > 0) newone->m_varLenFieldIdx = varLenFields; //need to keep all versions in local version @@ -285,21 +283,21 @@ namespace Generic PdxType^ PdxType::isContains(PdxType^ first, PdxType^ second) { int j = 0; - for(int i =0; i< second->m_pdxFieldTypes->Count; i++) - { + for (int i = 0; i < second->m_pdxFieldTypes->Count; i++) + { PdxFieldType^ secondPdt = second->m_pdxFieldTypes[i]; bool matched = false; - for(; j< first->m_pdxFieldTypes->Count; j++) + for (; j < first->m_pdxFieldTypes->Count; j++) { PdxFieldType^ firstPdt = first->m_pdxFieldTypes[j]; - if(firstPdt->Equals(secondPdt)) + if (firstPdt->Equals(secondPdt)) { matched = true; break; } } - if(!matched) + if (!matched) return nullptr; } return first; @@ -314,41 +312,41 @@ namespace Generic for each(PdxFieldType^ tmp in m_pdxFieldTypes) { newone->m_pdxFieldTypes->Add(tmp); - } + } return newone; } - array<int>^ PdxType::GetLocalToRemoteMap() - { - if(m_localToRemoteFieldMap != nullptr) + array<int>^ PdxType::GetLocalToRemoteMap() + { + if (m_localToRemoteFieldMap != nullptr) return m_localToRemoteFieldMap; - - msclr::lock lockInstance(m_lockObj); - if(m_localToRemoteFieldMap != nullptr) + + msclr::lock lockInstance(m_lockObj); + if (m_localToRemoteFieldMap != nullptr) return m_localToRemoteFieldMap; - initLocalToRemote(); + initLocalToRemote(); - return m_localToRemoteFieldMap; + return m_localToRemoteFieldMap; - } - array<int>^ PdxType::GetRemoteToLocalMap() - { - //return m_remoteToLocalFieldMap; + } + array<int>^ PdxType::GetRemoteToLocalMap() + { + //return m_remoteToLocalFieldMap; - if(m_remoteToLocalFieldMap != nullptr) + if (m_remoteToLocalFieldMap != nullptr) return m_remoteToLocalFieldMap; - - msclr::lock lockInstance(m_lockObj); - if(m_remoteToLocalFieldMap != nullptr) + + msclr::lock lockInstance(m_lockObj); + if (m_remoteToLocalFieldMap != nullptr) return m_remoteToLocalFieldMap; - initRemoteToLocal(); + initRemoteToLocal(); - return m_remoteToLocalFieldMap; - } + return m_remoteToLocalFieldMap; + } /* * this is write data on remote type(this will always have all fields) - */ + */ void PdxType::initRemoteToLocal() { //get local type from type Registry and then map local fields. @@ -356,20 +354,20 @@ namespace Generic PdxType^ localPdxType = PdxTypeRegistry::GetLocalPdxType(m_className); m_numberOfFieldsExtra = 0; - if(localPdxType != nullptr) + if (localPdxType != nullptr) { - IList<PdxFieldType^>^ localPdxFields = localPdxType->m_pdxFieldTypes; + IList<PdxFieldType^>^ localPdxFields = localPdxType->m_pdxFieldTypes; Int32 fieldIdx = 0; - - m_remoteToLocalFieldMap = gcnew array<Int32>(m_pdxFieldTypes->Count); + + m_remoteToLocalFieldMap = gcnew array<Int32>(m_pdxFieldTypes->Count); for each(PdxFieldType^ remotePdxField in m_pdxFieldTypes) { - bool found = false; - + bool found = false; + for each(PdxFieldType^ localPdxfield in localPdxFields) { - if(localPdxfield->Equals(remotePdxField)) + if (localPdxfield->Equals(remotePdxField)) { found = true; m_remoteToLocalFieldMap[fieldIdx++] = 1;//field there in remote type @@ -377,11 +375,11 @@ namespace Generic } } - if(!found) + if (!found) { //while writing take this from weakhashmap //local field is not in remote type - if(remotePdxField->IsVariableLengthType) + if (remotePdxField->IsVariableLengthType) m_remoteToLocalFieldMap[fieldIdx++] = -1;//local type don't have this fields else m_remoteToLocalFieldMap[fieldIdx++] = -2;//local type don't have this fields @@ -390,48 +388,47 @@ namespace Generic } } } - void PdxType::initLocalToRemote() { PdxType^ localPdxType = PdxTypeRegistry::GetLocalPdxType(m_className); - if(localPdxType != nullptr) + if (localPdxType != nullptr) { //Log::Debug("In initLocalToRemote: " + m_gemfireTypeId); IList<PdxFieldType^>^ localPdxFields = localPdxType->m_pdxFieldTypes; - + Int32 fieldIdx = 0; //type which need to read/write should control local type m_localToRemoteFieldMap = gcnew array<Int32>(localPdxType->m_pdxFieldTypes->Count); - for(int i = 0; i < m_localToRemoteFieldMap->Length && i < m_pdxFieldTypes->Count;i++) + for (int i = 0; i < m_localToRemoteFieldMap->Length && i < m_pdxFieldTypes->Count; i++) { - if(localPdxFields[fieldIdx]->Equals(m_pdxFieldTypes[i])) + if (localPdxFields[fieldIdx]->Equals(m_pdxFieldTypes[i])) { - //fields are in same order, we can read as it is + //fields are in same order, we can read as it is m_localToRemoteFieldMap[fieldIdx++] = -2; } else break; } - - for(;fieldIdx < m_localToRemoteFieldMap->Length;) + + for (; fieldIdx < m_localToRemoteFieldMap->Length;) { - PdxFieldType^ localPdxField = localPdxType->m_pdxFieldTypes[fieldIdx]; - bool found = false; - + PdxFieldType^ localPdxField = localPdxType->m_pdxFieldTypes[fieldIdx]; + bool found = false; + for each(PdxFieldType^ remotePdxfield in m_pdxFieldTypes) { - if(localPdxField->Equals(remotePdxfield)) + if (localPdxField->Equals(remotePdxfield)) { found = true; - //store pdxfield type position to get the offset quickly + //store pdxfield type position to get the offset quickly m_localToRemoteFieldMap[fieldIdx++] = remotePdxfield->SequenceId; break; } } - if(!found) + if (!found) { //local field is not in remote type m_localToRemoteFieldMap[fieldIdx++] = -1; @@ -446,18 +443,18 @@ namespace Generic //--read next var len offset and subtract offset //--if no var len then take length of stream - (len of offsets) //2. there is no offser for first var len field - - bool foundVarLen = false; + + bool foundVarLen = false; int lastVarLenSeqId = 0; int prevFixedSizeOffsets = 0; //set offsets from back first PdxFieldType^ previousField = nullptr; - for(int i = m_pdxFieldTypes->Count -1; i >= 0 ; i--) + for (int i = m_pdxFieldTypes->Count - 1; i >= 0; i--) { PdxFieldType^ tmpft = m_pdxFieldTypes[i]; m_fieldNameVsPdxType[tmpft->FieldName] = tmpft; - if(tmpft->IsVariableLengthType) + if (tmpft->IsVariableLengthType) { tmpft->VarLenOffsetIndex = tmpft->VarLenFieldIdx; tmpft->RelativeOffset = 0; @@ -466,33 +463,33 @@ namespace Generic } else { - if(foundVarLen) + if (foundVarLen) { tmpft->VarLenOffsetIndex = lastVarLenSeqId; - //relative offset is subtracted from var len offsets - tmpft->RelativeOffset = (-tmpft->Size + previousField->RelativeOffset) ; + //relative offset is subtracted from var len offsets + tmpft->RelativeOffset = (-tmpft->Size + previousField->RelativeOffset); } else { tmpft->VarLenOffsetIndex = -1;//Pdx header length - //relative offset is subtracted from var len offsets + //relative offset is subtracted from var len offsets tmpft->RelativeOffset = -tmpft->Size; - if(previousField != nullptr)//boundary condition - tmpft->RelativeOffset = (-tmpft->Size + previousField->RelativeOffset) ; + if (previousField != nullptr)//boundary condition + tmpft->RelativeOffset = (-tmpft->Size + previousField->RelativeOffset); } } previousField = tmpft; } - foundVarLen = false; + foundVarLen = false; prevFixedSizeOffsets = 0; //now do optimization till you don't fine var len - for(int i = 0; i< m_pdxFieldTypes->Count && !foundVarLen; i++) + for (int i = 0; i < m_pdxFieldTypes->Count && !foundVarLen; i++) { PdxFieldType^ tmpft = m_pdxFieldTypes[i]; - if(tmpft->IsVariableLengthType) + if (tmpft->IsVariableLengthType) { tmpft->VarLenOffsetIndex = -1;//first var len field tmpft->RelativeOffset = prevFixedSizeOffsets; @@ -502,30 +499,30 @@ namespace Generic { tmpft->VarLenOffsetIndex = 0;//no need to read offset tmpft->RelativeOffset = prevFixedSizeOffsets; - prevFixedSizeOffsets += tmpft->Size; + prevFixedSizeOffsets += tmpft->Size; } } } bool PdxType::Equals(Object^ otherObj) { - if(otherObj == nullptr) + if (otherObj == nullptr) return false; PdxType^ ot = dynamic_cast<PdxType^>(otherObj); - if(ot == nullptr) + if (ot == nullptr) return false; - if(ot == this) + if (ot == this) return true; - if(ot->m_pdxFieldTypes->Count != m_pdxFieldTypes->Count) + if (ot->m_pdxFieldTypes->Count != m_pdxFieldTypes->Count) return false; - for(int i = 0; i < m_pdxFieldTypes->Count; i++) + for (int i = 0; i < m_pdxFieldTypes->Count; i++) { - if(!ot->m_pdxFieldTypes[i]->Equals(m_pdxFieldTypes[i])) + if (!ot->m_pdxFieldTypes[i]->Equals(m_pdxFieldTypes[i])) return false; } return true; @@ -534,24 +531,23 @@ namespace Generic Int32 PdxType::GetHashCode() { int hash = m_cachedHashcode; - if(hash == 0) + if (hash == 0) { hash = 1; hash = hash * 31 + m_className->GetHashCode(); - for(int i = 0; i < m_pdxFieldTypes->Count; i++) + for (int i = 0; i < m_pdxFieldTypes->Count; i++) { hash = hash * 31 + m_pdxFieldTypes[i]->GetHashCode(); } - if(hash == 0) + if (hash == 0) { hash = 1; } - m_cachedHashcode = hash; + m_cachedHashcode = hash; } return m_cachedHashcode; } - } - } - } - } -} \ No newline at end of file + } // namespace Internal + } // namespace Client + } // namespace Geode +} // namespace Apache http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxType.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxType.hpp b/src/clicache/src/impl/PdxType.hpp index d53d32c..82af710 100644 --- a/src/clicache/src/impl/PdxType.hpp +++ b/src/clicache/src/impl/PdxType.hpp @@ -30,8 +30,7 @@ namespace Apache { namespace Client { -namespace Generic - { + ref class DataOutput; ref class DataInput; namespace Internal @@ -195,8 +194,8 @@ namespace Generic virtual bool Equals(Object^ otherType) override; virtual Int32 GetHashCode() override; }; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxTypeRegistry.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxTypeRegistry.cpp b/src/clicache/src/impl/PdxTypeRegistry.cpp index b63b230..c1c7834 100644 --- a/src/clicache/src/impl/PdxTypeRegistry.cpp +++ b/src/clicache/src/impl/PdxTypeRegistry.cpp @@ -27,8 +27,7 @@ namespace Apache { namespace Client { -namespace Generic - { + namespace Internal { int PdxTypeRegistry::testGetNumberOfPdxIds() @@ -310,9 +309,9 @@ namespace Generic g_readerWriterLock->ReleaseWriterLock(); } return nullptr; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxTypeRegistry.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxTypeRegistry.hpp b/src/clicache/src/impl/PdxTypeRegistry.hpp index c001d74..7aa6738 100644 --- a/src/clicache/src/impl/PdxTypeRegistry.hpp +++ b/src/clicache/src/impl/PdxTypeRegistry.hpp @@ -31,8 +31,7 @@ namespace Apache { namespace Client { -namespace Generic - { + namespace Internal { public ref class PdxTypeRegistry @@ -105,8 +104,8 @@ namespace Generic static bool pdxIgnoreUnreadFields = false; static bool pdxReadSerialized = false; }; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxWrapper.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxWrapper.hpp b/src/clicache/src/impl/PdxWrapper.hpp index 4f6f220..5be917a 100755 --- a/src/clicache/src/impl/PdxWrapper.hpp +++ b/src/clicache/src/impl/PdxWrapper.hpp @@ -27,8 +27,7 @@ namespace Apache { namespace Client { -namespace Generic - { + ref class PdxWrapper : IPdxSerializable { private: @@ -79,7 +78,6 @@ namespace Generic return false; } }; - } - } - } -} \ No newline at end of file + } // namespace Client + } // namespace Geode +} // namespace Apache http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxWriterWithTypeCollector.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxWriterWithTypeCollector.cpp b/src/clicache/src/impl/PdxWriterWithTypeCollector.cpp index 974a215..f607b8e 100644 --- a/src/clicache/src/impl/PdxWriterWithTypeCollector.cpp +++ b/src/clicache/src/impl/PdxWriterWithTypeCollector.cpp @@ -30,8 +30,7 @@ namespace Apache { namespace Client { -namespace Generic - { + namespace Internal { void PdxWriterWithTypeCollector::initialize() @@ -352,9 +351,9 @@ namespace Generic pft->IdentityField = true; return this; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PdxWriterWithTypeCollector.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PdxWriterWithTypeCollector.hpp b/src/clicache/src/impl/PdxWriterWithTypeCollector.hpp index 2589d1d..95f9c37 100644 --- a/src/clicache/src/impl/PdxWriterWithTypeCollector.hpp +++ b/src/clicache/src/impl/PdxWriterWithTypeCollector.hpp @@ -30,8 +30,7 @@ namespace Apache { namespace Client { -namespace Generic - { + ref class DataOutput; namespace Internal { @@ -322,8 +321,8 @@ namespace Generic virtual IPdxWriter^ WriteUnreadFields(IPdxUnreadFields^ unread) override; }; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/PersistenceManagerProxy.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/PersistenceManagerProxy.hpp b/src/clicache/src/impl/PersistenceManagerProxy.hpp index 1d4d3a0..80a5452 100644 --- a/src/clicache/src/impl/PersistenceManagerProxy.hpp +++ b/src/clicache/src/impl/PersistenceManagerProxy.hpp @@ -27,8 +27,7 @@ namespace Apache { namespace Client { -namespace Generic - { + public interface class IPersistenceManagerProxy { public: @@ -92,8 +91,8 @@ namespace Generic m_persistenceManager->Close(); } }; - } - } - } -} + } // namespace Client + } // namespace Geode +} // namespace Apache + http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/ResultCollectorProxy.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/ResultCollectorProxy.hpp b/src/clicache/src/impl/ResultCollectorProxy.hpp index 22b8d9d..902bb4e 100644 --- a/src/clicache/src/impl/ResultCollectorProxy.hpp +++ b/src/clicache/src/impl/ResultCollectorProxy.hpp @@ -29,8 +29,7 @@ namespace Apache { namespace Client { -namespace Generic - { + public interface class ResultCollectorG { public: @@ -71,7 +70,7 @@ namespace Generic } }; - } - } - } -} + } // namespace Client + } // namespace Geode +} // namespace Apache + http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/SafeConvert.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/SafeConvert.hpp b/src/clicache/src/impl/SafeConvert.hpp index 591e5ca..29d4f8c 100644 --- a/src/clicache/src/impl/SafeConvert.hpp +++ b/src/clicache/src/impl/SafeConvert.hpp @@ -39,8 +39,7 @@ namespace Apache { namespace Client { -namespace Generic - { + interface class IPdxSerializable; public ref class SafeConvertClassGeneric { @@ -49,7 +48,7 @@ namespace Generic static void SetAppDomainEnabled(bool isAppDomainEnable) { - Apache::Geode::Client::Generic::Log::Fine("AppDomain support enabled: " + isAppDomainEnable); + Apache::Geode::Client::Log::Fine("AppDomain support enabled: " + isAppDomainEnable); isAppDomainEnabled = isAppDomainEnable; } }; @@ -58,7 +57,7 @@ namespace Generic /// Helper function to convert native <c>apache::geode::client::Serializable</c> object /// to managed <see cref="IGFSerializable" /> object. /// </summary> - inline static Apache::Geode::Client::Generic::IGFSerializable^ + inline static Apache::Geode::Client::IGFSerializable^ SafeUMSerializableConvertGeneric( apache::geode::client::Serializable* obj ) { @@ -92,11 +91,11 @@ namespace Generic if( mg_obj_delta != nullptr ) { - return dynamic_cast<Apache::Geode::Client::Generic::IGFSerializable^>(mg_obj_delta->ptr( )); + return dynamic_cast<Apache::Geode::Client::IGFSerializable^>(mg_obj_delta->ptr( )); } else if(mg_bytesObj_delta != nullptr) { - return dynamic_cast<Apache::Geode::Client::Generic::IGFSerializable^>(mg_bytesObj_delta->ptr( )); + return dynamic_cast<Apache::Geode::Client::IGFSerializable^>(mg_bytesObj_delta->ptr( )); } else { @@ -111,13 +110,13 @@ namespace Generic } WrapperDelegateGeneric^ wrapperMethod = - Apache::Geode::Client::Generic::Serializable::GetWrapperGeneric( obj->typeId( ) ); + Apache::Geode::Client::Serializable::GetWrapperGeneric( obj->typeId( ) ); if (wrapperMethod != nullptr) { return wrapperMethod( obj ); } - return gcnew Apache::Geode::Client::Generic::Serializable( obj ); + return gcnew Apache::Geode::Client::Serializable( obj ); } } } @@ -165,8 +164,8 @@ namespace Generic //} //else { - Apache::Geode::Client::Generic::IGFDelta^ sDelta = - dynamic_cast<Apache::Geode::Client::Generic::IGFDelta^> (mg_obj); + Apache::Geode::Client::IGFDelta^ sDelta = + dynamic_cast<Apache::Geode::Client::IGFDelta^> (mg_obj); if(sDelta != nullptr){ if(!SafeConvertClassGeneric::isAppDomainEnabled) return new apache::geode::client::ManagedCacheableDeltaGeneric( sDelta); @@ -242,12 +241,12 @@ namespace Generic } WrapperDelegateGeneric^ wrapperMethod = - Apache::Geode::Client::Generic::Serializable::GetWrapperGeneric( obj->typeId( ) ); + Apache::Geode::Client::Serializable::GetWrapperGeneric( obj->typeId( ) ); if (wrapperMethod != nullptr) { return safe_cast<TValue>(wrapperMethod( obj )); } - return safe_cast<TValue>(gcnew Apache::Geode::Client::Generic::Serializable( obj )); + return safe_cast<TValue>(gcnew Apache::Geode::Client::Serializable( obj )); } } } @@ -258,12 +257,12 @@ namespace Generic /// <c>SafeM2UMConvert</c>. /// </summary> inline static apache::geode::client::Serializable* SafeMSerializableConvertGeneric( - Apache::Geode::Client::Generic::IGFSerializable^ mg_obj ) + Apache::Geode::Client::IGFSerializable^ mg_obj ) { //it is called for cacheables types only - return SafeM2UMConvertGeneric<Apache::Geode::Client::Generic::IGFSerializable, + return SafeM2UMConvertGeneric<Apache::Geode::Client::IGFSerializable, apache::geode::client::ManagedCacheableKeyGeneric, apache::geode::client::Serializable, - Apache::Geode::Client::Generic::Serializable>( mg_obj ); + Apache::Geode::Client::Serializable>( mg_obj ); } generic<class TValue> @@ -294,8 +293,8 @@ namespace Generic return new apache::geode::client::PdxManagedCacheableKeyBytes(pdxType, true); } - Apache::Geode::Client::Generic::IGFDelta^ sDelta = - dynamic_cast<Apache::Geode::Client::Generic::IGFDelta^> (mg_obj); + Apache::Geode::Client::IGFDelta^ sDelta = + dynamic_cast<Apache::Geode::Client::IGFDelta^> (mg_obj); if(sDelta != nullptr) { if(!SafeConvertClassGeneric::isAppDomainEnabled) @@ -305,8 +304,8 @@ namespace Generic } else { - Apache::Geode::Client::Generic::IGFSerializable^ tmpIGFS = - dynamic_cast<Apache::Geode::Client::Generic::IGFSerializable^>(mg_obj); + Apache::Geode::Client::IGFSerializable^ tmpIGFS = + dynamic_cast<Apache::Geode::Client::IGFSerializable^>(mg_obj); if(tmpIGFS != nullptr) { if(!SafeConvertClassGeneric::isAppDomainEnabled) @@ -327,7 +326,7 @@ namespace Generic else return new apache::geode::client::PdxManagedCacheableKeyBytes(gcnew PdxWrapper(mg_obj), true); } - throw gcnew Apache::Geode::Client::Generic::IllegalStateException(String::Format("Unable to map object type {0}. Possible Object type may not be registered or PdxSerializer is not registered. ", mg_obj->GetType())); + throw gcnew Apache::Geode::Client::IllegalStateException(String::Format("Unable to map object type {0}. Possible Object type may not be registered or PdxSerializer is not registered. ", mg_obj->GetType())); } } @@ -359,7 +358,7 @@ namespace Generic /// to managed <see cref="ICacheableKey" /> object. /// </summary> generic<class TKey> - inline static Generic::ICacheableKey^ SafeGenericUMKeyConvert( apache::geode::client::CacheableKey* obj ) + inline static Client::ICacheableKey^ SafeGenericUMKeyConvert( apache::geode::client::CacheableKey* obj ) { //All cacheables will be ManagedCacheableKey only if (obj == nullptr) return nullptr; @@ -373,21 +372,21 @@ namespace Generic if (mg_obj != nullptr) { - return (Generic::ICacheableKey^)mg_obj->ptr( ); + return (Client::ICacheableKey^)mg_obj->ptr( ); } else if(mg_bytesObj != nullptr) { - return (Generic::ICacheableKey^)mg_bytesObj->ptr( ); + return (Client::ICacheableKey^)mg_bytesObj->ptr( ); } else { WrapperDelegateGeneric^ wrapperMethod = - Apache::Geode::Client::Generic::Serializable::GetWrapperGeneric( obj->typeId( ) ); + Apache::Geode::Client::Serializable::GetWrapperGeneric( obj->typeId( ) ); if (wrapperMethod != nullptr) { - return (Generic::ICacheableKey^)wrapperMethod( obj ); + return (Client::ICacheableKey^)wrapperMethod( obj ); } - return gcnew Generic::CacheableKey( obj ); + return gcnew Client::CacheableKey( obj ); } } @@ -395,7 +394,7 @@ namespace Generic inline static apache::geode::client::CacheableKey* SafeGenericMKeyConvert( TKey mg_obj ) { if (mg_obj == nullptr) return NULL; - apache::geode::client::CacheableKey* obj = Apache::Geode::Client::Generic::Serializable::GetUnmanagedValueGeneric<TKey>( mg_obj ).ptr(); + apache::geode::client::CacheableKey* obj = Apache::Geode::Client::Serializable::GetUnmanagedValueGeneric<TKey>( mg_obj ).ptr(); if (obj != nullptr) { return obj; @@ -425,30 +424,30 @@ namespace Generic template<typename NativeType> //where NativeType : apache::geode::client::SharedPtr<NativeType> //generic<typename ManagedType> where ManagedType : Internal::SBWrap<apache::geode::client::RegionAttributes> - inline static NativeType* GetNativePtrFromSBWrap( Apache::Geode::Client::Generic::Internal::SBWrap<NativeType>^ mg_obj ) + inline static NativeType* GetNativePtrFromSBWrap( Apache::Geode::Client::Internal::SBWrap<NativeType>^ mg_obj ) { return (mg_obj != nullptr ? mg_obj->_NativePtr : NULL); } template<typename NativeType> //where NativeType : apache::geode::client::SharedPtr<NativeType> //generic<typename ManagedType> where ManagedType : Internal::SBWrap<apache::geode::client::RegionAttributes> - inline static NativeType* GetNativePtrFromSBWrapGeneric( Apache::Geode::Client::Generic::Internal::SBWrap<NativeType>^ mg_obj ) + inline static NativeType* GetNativePtrFromSBWrapGeneric( Apache::Geode::Client::Internal::SBWrap<NativeType>^ mg_obj ) { return (mg_obj != nullptr ? mg_obj->_NativePtr : NULL); } template<typename NativeType> - inline static NativeType* GetNativePtrFromUMWrap( Apache::Geode::Client::Generic::Internal::UMWrap<NativeType>^ mg_obj ) + inline static NativeType* GetNativePtrFromUMWrap( Apache::Geode::Client::Internal::UMWrap<NativeType>^ mg_obj ) { return (mg_obj != nullptr ? mg_obj->_NativePtr : NULL); } template<typename NativeType> - inline static NativeType* GetNativePtrFromUMWrapGeneric( Apache::Geode::Client::Generic::Internal::UMWrap<NativeType>^ mg_obj ) + inline static NativeType* GetNativePtrFromUMWrapGeneric( Apache::Geode::Client::Internal::UMWrap<NativeType>^ mg_obj ) { return (mg_obj != nullptr ? mg_obj->_NativePtr : NULL); - } - } // end namespace Generic - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/TransactionListener.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/TransactionListener.hpp b/src/clicache/src/impl/TransactionListener.hpp index 113255c..5d8debd 100644 --- a/src/clicache/src/impl/TransactionListener.hpp +++ b/src/clicache/src/impl/TransactionListener.hpp @@ -32,8 +32,6 @@ namespace Apache { namespace Client { -namespace Generic - { /// <summary> /// Contains the generic listener object. Inherits from non generic listener interface. @@ -45,31 +43,31 @@ namespace Generic { private: - Apache::Geode::Client::Generic::ITransactionListener<TKey, TValue>^ m_listener; + Apache::Geode::Client::ITransactionListener<TKey, TValue>^ m_listener; public: - void SetTransactionListener(Apache::Geode::Client::Generic::ITransactionListener<TKey, TValue>^ listener) + void SetTransactionListener(Apache::Geode::Client::ITransactionListener<TKey, TValue>^ listener) { m_listener = listener; } virtual void AfterCommit(Apache::Geode::Client::TransactionEvent^ event) override { - Apache::Geode::Client::Generic::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); + Apache::Geode::Client::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); m_listener->AfterCommit(%gevent); } virtual void AfterFailedCommit(Apache::Geode::Client::TransactionEvent^ event) override { - Apache::Geode::Client::Generic::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); + Apache::Geode::Client::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); m_listener->AfterFailedCommit(%gevent); } virtual void AfterRollback(Apache::Geode::Client::TransactionEvent^ event) override { - Apache::Geode::Client::Generic::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); + Apache::Geode::Client::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(event)); m_listener->AfterRollback(%gevent); } @@ -78,8 +76,8 @@ namespace Generic m_listener->Close(); } }; - } - } - } -} + } // namespace Client + } // namespace Geode +} // namespace Apache + #endif \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/TransactionWriter.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/TransactionWriter.hpp b/src/clicache/src/impl/TransactionWriter.hpp index 87f6c81..ad3d514 100644 --- a/src/clicache/src/impl/TransactionWriter.hpp +++ b/src/clicache/src/impl/TransactionWriter.hpp @@ -32,8 +32,6 @@ namespace Apache { namespace Client { -namespace Generic - { /// <summary> /// Contains the generic writer object. Inherits from non generic writer interface. @@ -45,24 +43,24 @@ namespace Generic { private: - Apache::Geode::Client::Generic::ITransactionWriter<TKey, TValue>^ m_writer; + Apache::Geode::Client::ITransactionWriter<TKey, TValue>^ m_writer; public: - void SetTransactionWriter(Apache::Geode::Client::Generic::ITransactionWriter<TKey, TValue>^ writer) + void SetTransactionWriter(Apache::Geode::Client::ITransactionWriter<TKey, TValue>^ writer) { m_writer = writer; } virtual void BeforeCommit(Apache::Geode::Client::TransactionEvent^ te) override { - Apache::Geode::Client::Generic::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(te)); + Apache::Geode::Client::TransactionEvent<TKey, TValue> gevent(GetNativePtr<apache::geode::client::TransactionEvent>(te)); m_writer->BeforeCommit(%gevent); } }; - } - } - } -} + } // namespace Client + } // namespace Geode +} // namespace Apache + #endif \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/clicache/src/impl/WeakhashMap.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/impl/WeakhashMap.hpp b/src/clicache/src/impl/WeakhashMap.hpp index 6d8999a..30a4a60 100644 --- a/src/clicache/src/impl/WeakhashMap.hpp +++ b/src/clicache/src/impl/WeakhashMap.hpp @@ -32,8 +32,7 @@ namespace Apache { namespace Client { -namespace Generic - { + namespace Internal { public ref class EntryNode @@ -252,8 +251,8 @@ namespace Generic m_dictionary->Clear(); } }; - } - } - } - } + } // namespace Client + } // namespace Geode +} // namespace Apache + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/com/gemstone/gemfire/plugins/sqlite/SqLiteImpl.cs ---------------------------------------------------------------------- diff --git a/src/com/gemstone/gemfire/plugins/sqlite/SqLiteImpl.cs b/src/com/gemstone/gemfire/plugins/sqlite/SqLiteImpl.cs index 50b00ba..ef971cb 100644 --- a/src/com/gemstone/gemfire/plugins/sqlite/SqLiteImpl.cs +++ b/src/com/gemstone/gemfire/plugins/sqlite/SqLiteImpl.cs @@ -18,7 +18,7 @@ using System; using System.Data; using System.Data.SQLite; -using Apache.Geode.Client.Generic; +using Apache.Geode.Client; using System.IO; using System.Runtime.Serialization.Formatters.Binary; namespace Apache.Geode.Plugins.SQLite http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/templates/security/csharp/UserPasswordAuthInit.cs ---------------------------------------------------------------------- diff --git a/src/templates/security/csharp/UserPasswordAuthInit.cs b/src/templates/security/csharp/UserPasswordAuthInit.cs index bf9597b..6b9b844 100644 --- a/src/templates/security/csharp/UserPasswordAuthInit.cs +++ b/src/templates/security/csharp/UserPasswordAuthInit.cs @@ -18,10 +18,10 @@ namespace Apache.Geode.Templates.Cache.Security { - using Apache.Geode.Client.Generic; + using Apache.Geode.Client; ///<summary> - /// An <see cref="Apache.Geode.Client.Generic.IAuthInitialize"/> implementation + /// An <see cref="Apache.Geode.Client.IAuthInitialize"/> implementation /// that obtains the user name and password as the credentials from the /// given set of properties. /// </summary> http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/tests/cli/FwkUtil/FwkData.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/FwkUtil/FwkData.cs b/src/tests/cli/FwkUtil/FwkData.cs index 8be91f5..f7c3771 100644 --- a/src/tests/cli/FwkUtil/FwkData.cs +++ b/src/tests/cli/FwkUtil/FwkData.cs @@ -226,7 +226,7 @@ namespace Apache.Geode.Client.FwkLib // Now collect the region atributes XmlNode attrnode = xmlNode.FirstChild.FirstChild.FirstChild; - Apache.Geode.Client.Generic.Properties<string, string> rattr = Apache.Geode.Client.Generic.Properties<string, string>.Create<string, string>(); + Apache.Geode.Client.Properties<string, string> rattr = Apache.Geode.Client.Properties<string, string>.Create<string, string>(); //AttributesFactory af = new AttributesFactory(); if (attrnode.Name == "region-attributes") { @@ -247,7 +247,7 @@ namespace Apache.Geode.Client.FwkLib //SetThisAttribute(tmpnode.Name, tmpnode, af); } } - Apache.Geode.Client.Generic.DataOutput dout = new Apache.Geode.Client.Generic.DataOutput(); + Apache.Geode.Client.DataOutput dout = new Apache.Geode.Client.DataOutput(); //RegionAttributes rattr = af.CreateRegionAttributes(); rattr.ToData(dout); // Console.WriteLine("Going to construct FwkData with region = " + regionName + @@ -265,7 +265,7 @@ namespace Apache.Geode.Client.FwkLib XmlAttribute nameattr = xmlNode.FirstChild.FirstChild.Attributes["name"]; String poolName = nameattr.Value; // Now collect the pool atributes - Apache.Geode.Client.Generic.Properties<string, string> prop = Apache.Geode.Client.Generic.Properties<string, string>.Create<string, string>(); + Apache.Geode.Client.Properties<string, string> prop = Apache.Geode.Client.Properties<string, string>.Create<string, string>(); XmlAttributeCollection attrcoll = xmlNode.FirstChild.FirstChild.Attributes; if (attrcoll != null) { @@ -273,7 +273,7 @@ namespace Apache.Geode.Client.FwkLib { prop.Insert(eachattr.Name, eachattr.Value); } - Apache.Geode.Client.Generic.DataOutput dout = new Apache.Geode.Client.Generic.DataOutput(); + Apache.Geode.Client.DataOutput dout = new Apache.Geode.Client.DataOutput(); prop.ToData(dout); FwkData td = new FwkData(poolName, dout.GetBuffer(), DataKind.Pool); dataNodes[name] = td; @@ -357,7 +357,7 @@ namespace Apache.Geode.Client.FwkLib return null; } - public static void SetThisAttribute(string name, XmlNode node, Apache.Geode.Client.Generic.AttributesFactory<string, string> af) + public static void SetThisAttribute(string name, XmlNode node, Apache.Geode.Client.AttributesFactory<string, string> af) { string value = node.Value; switch (name) @@ -396,11 +396,11 @@ namespace Apache.Geode.Client.FwkLib case "disk-policy": if (value == "none") { - af.SetDiskPolicy(Apache.Geode.Client.Generic.DiskPolicyType.None); + af.SetDiskPolicy(Apache.Geode.Client.DiskPolicyType.None); } else if (value == "overflows") { - af.SetDiskPolicy(Apache.Geode.Client.Generic.DiskPolicyType.Overflows); + af.SetDiskPolicy(Apache.Geode.Client.DiskPolicyType.Overflows); } else { @@ -426,7 +426,7 @@ namespace Apache.Geode.Client.FwkLib if (nlrttl.Name == "expiration-attributes") { XmlAttributeCollection exAttrColl = nlrttl.Attributes; - Apache.Geode.Client.Generic.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); + Apache.Geode.Client.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); string rttl = exAttrColl["timeout"].Value; af.SetRegionTimeToLive(action, uint.Parse(rttl)); } @@ -441,7 +441,7 @@ namespace Apache.Geode.Client.FwkLib if (nlrit.Name == "expiration-attributes") { XmlAttributeCollection exAttrColl = nlrit.Attributes; - Apache.Geode.Client.Generic.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); + Apache.Geode.Client.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); string rit = exAttrColl["timeout"].Value; af.SetRegionIdleTimeout(action, uint.Parse(rit)); } @@ -456,7 +456,7 @@ namespace Apache.Geode.Client.FwkLib if (nlettl.Name == "expiration-attributes") { XmlAttributeCollection exAttrColl = nlettl.Attributes; - Apache.Geode.Client.Generic.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); + Apache.Geode.Client.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); string ettl = exAttrColl["timeout"].Value; af.SetEntryTimeToLive(action, uint.Parse(ettl)); } @@ -471,7 +471,7 @@ namespace Apache.Geode.Client.FwkLib if (nleit.Name == "expiration-attributes") { XmlAttributeCollection exAttrColl = nleit.Attributes; - Apache.Geode.Client.Generic.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); + Apache.Geode.Client.ExpirationAction action = StrToExpirationAction(exAttrColl["action"].Value); string eit = exAttrColl["timeout"].Value; af.SetEntryIdleTimeout(action, uint.Parse(eit)); } @@ -581,7 +581,7 @@ namespace Apache.Geode.Client.FwkLib case "persistence-manager": string pmlibrary = null; string pmfunction = null; - Apache.Geode.Client.Generic.Properties<string, string> prop = new Apache.Geode.Client.Generic.Properties<string, string>(); + Apache.Geode.Client.Properties<string, string> prop = new Apache.Geode.Client.Properties<string, string>(); XmlAttributeCollection pmattrs = node.Attributes; foreach (XmlAttribute attr in pmattrs) { @@ -627,9 +627,9 @@ namespace Apache.Geode.Client.FwkLib } } - private static Apache.Geode.Client.Generic.ExpirationAction StrToExpirationAction(string str) + private static Apache.Geode.Client.ExpirationAction StrToExpirationAction(string str) { - return (Apache.Geode.Client.Generic.ExpirationAction)Enum.Parse(typeof(Apache.Geode.Client.Generic.ExpirationAction), + return (Apache.Geode.Client.ExpirationAction)Enum.Parse(typeof(Apache.Geode.Client.ExpirationAction), str.Replace("-", string.Empty), true); } } @@ -892,34 +892,34 @@ namespace Apache.Geode.Client.FwkLib /// </summary> /// <param name="key">The key of the region to read.</param> /// <returns>The attributes of the region.</returns> - public Apache.Geode.Client.Generic.RegionAttributes<string, string> GetRegionAttributes(string key) + public Apache.Geode.Client.RegionAttributes<string, string> GetRegionAttributes(string key) { FwkData data = ReadData(key); if (data != null && data.Kind == DataKind.Region) { - Apache.Geode.Client.Generic.AttributesFactory<string, string> af = new Apache.Geode.Client.Generic.AttributesFactory<string, string>(); - Apache.Geode.Client.Generic.RegionAttributes<string, string> attrs = af.CreateRegionAttributes(); + Apache.Geode.Client.AttributesFactory<string, string> af = new Apache.Geode.Client.AttributesFactory<string, string>(); + Apache.Geode.Client.RegionAttributes<string, string> attrs = af.CreateRegionAttributes(); byte[] attrsArr = data.Data2 as byte[]; if (attrsArr != null && attrsArr.Length > 0) { - Apache.Geode.Client.Generic.DataInput dinp = new Apache.Geode.Client.Generic.DataInput(attrsArr); + Apache.Geode.Client.DataInput dinp = new Apache.Geode.Client.DataInput(attrsArr); attrs.FromData(dinp); } return attrs; } return null; } - public Apache.Geode.Client.Generic.Properties<string, string> GetPoolAttributes(string key) + public Apache.Geode.Client.Properties<string, string> GetPoolAttributes(string key) { FwkData data = ReadData(key); if (data != null && data.Kind == DataKind.Pool) { - Apache.Geode.Client.Generic.Properties<string, string> prop = Apache.Geode.Client.Generic.Properties<string, string>.Create<string, string>(); + Apache.Geode.Client.Properties<string, string> prop = Apache.Geode.Client.Properties<string, string>.Create<string, string>(); //RegionAttributes attrs = af.CreateRegionAttributes(); byte[] attrsArr = data.Data2 as byte[]; if (attrsArr != null && attrsArr.Length > 0) { - Apache.Geode.Client.Generic.DataInput dinp = new Apache.Geode.Client.Generic.DataInput(attrsArr); + Apache.Geode.Client.DataInput dinp = new Apache.Geode.Client.DataInput(attrsArr); prop.FromData(dinp); } return prop; http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/tests/cli/NativeWrapper/ManagedWrapper.cpp ---------------------------------------------------------------------- diff --git a/src/tests/cli/NativeWrapper/ManagedWrapper.cpp b/src/tests/cli/NativeWrapper/ManagedWrapper.cpp index 7222f0d..b16c776 100644 --- a/src/tests/cli/NativeWrapper/ManagedWrapper.cpp +++ b/src/tests/cli/NativeWrapper/ManagedWrapper.cpp @@ -27,13 +27,13 @@ ManagedWrapper::ManagedWrapper(int len) : m_nativePtr(new NativeType()) ManagedWrapper::~ManagedWrapper() { - Apache::Geode::Client::Generic::Log::Info("Invoked Dispose of ManagedWrapper"); + Apache::Geode::Client::Log::Info("Invoked Dispose of ManagedWrapper"); InternalCleanup(); } ManagedWrapper::!ManagedWrapper() { - Apache::Geode::Client::Generic::Log::Info("Invoked Finalizer of ManagedWrapper"); + Apache::Geode::Client::Log::Info("Invoked Finalizer of ManagedWrapper"); InternalCleanup(); } @@ -45,7 +45,7 @@ void ManagedWrapper::InternalCleanup() bool ManagedWrapper::UnsafeDoOp(int size, int numOps) { - Apache::Geode::Client::Generic::Log::Info("Managed string length: {0}", m_str->Length); + Apache::Geode::Client::Log::Info("Managed string length: {0}", m_str->Length); return UnsafeNativePtr->doOp(size, numOps, (numOps / 5) + 1); } http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/tests/cli/NativeWrapper/ManagedWrapper.hpp ---------------------------------------------------------------------- diff --git a/src/tests/cli/NativeWrapper/ManagedWrapper.hpp b/src/tests/cli/NativeWrapper/ManagedWrapper.hpp index b86866b..97b5a70 100644 --- a/src/tests/cli/NativeWrapper/ManagedWrapper.hpp +++ b/src/tests/cli/NativeWrapper/ManagedWrapper.hpp @@ -147,12 +147,12 @@ namespace Internal /// object is in progress since the temporary <c>ManagedPtrWrap</c> /// object holds a reference to the managed object. /// </summary> - property Apache::Geode::Client::Generic::Internal::ManagedPtrWrap<NativeType, ManagedWrapper> + property Apache::Geode::Client::Internal::ManagedPtrWrap<NativeType, ManagedWrapper> SafeNativePtr2 { - inline Apache::Geode::Client::Generic::Internal::ManagedPtrWrap<NativeType, ManagedWrapper> get() + inline Apache::Geode::Client::Internal::ManagedPtrWrap<NativeType, ManagedWrapper> get() { - return Apache::Geode::Client::Generic::Internal::ManagedPtrWrap<NativeType, ManagedWrapper>( + return Apache::Geode::Client::Internal::ManagedPtrWrap<NativeType, ManagedWrapper>( m_nativePtr, this); } } http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/tests/cli/NativeWrapper/NativeType.cpp ---------------------------------------------------------------------- diff --git a/src/tests/cli/NativeWrapper/NativeType.cpp b/src/tests/cli/NativeWrapper/NativeType.cpp index 1489d94..1b986e9 100644 --- a/src/tests/cli/NativeWrapper/NativeType.cpp +++ b/src/tests/cli/NativeWrapper/NativeType.cpp @@ -33,7 +33,7 @@ NativeType::NativeType() NativeType::~NativeType() { #ifdef _MANAGED - Apache::Geode::Client::Generic::Log::Info("Invoked destructor of NativeType"); + Apache::Geode::Client::Log::Info("Invoked destructor of NativeType"); #endif g_nativeTypeDestroyed = true; } @@ -51,7 +51,7 @@ bool NativeType::doOp(int size, int numOps, int numGCOps) std::vector<std::string> vec; for (int i = 1; i <= numOps; ++i) { #ifdef _MANAGED - Apache::Geode::Client::Generic::Log::Info("Allocating string number {0} with " + Apache::Geode::Client::Log::Info("Allocating string number {0} with " "size {1}", i, size); #endif std::string s(size, 'A' + i); @@ -60,10 +60,10 @@ bool NativeType::doOp(int size, int numOps, int numGCOps) #ifdef _MANAGED System::GC::AddMemoryPressure(size); if ((i % numGCOps) == 0) { - Apache::Geode::Client::Generic::Log::Info("Started GC collection."); + Apache::Geode::Client::Log::Info("Started GC collection."); System::GC::Collect(); System::GC::WaitForPendingFinalizers(); - Apache::Geode::Client::Generic::Log::Info("Completed GC collection."); + Apache::Geode::Client::Log::Info("Completed GC collection."); } System::Threading::Thread::Sleep(500); #else http://git-wip-us.apache.org/repos/asf/geode/blob/649e4a87/src/tests/cli/NewFwkLib/CacheHelper.cs ---------------------------------------------------------------------- diff --git a/src/tests/cli/NewFwkLib/CacheHelper.cs b/src/tests/cli/NewFwkLib/CacheHelper.cs index 5c712cf..dbe085a 100644 --- a/src/tests/cli/NewFwkLib/CacheHelper.cs +++ b/src/tests/cli/NewFwkLib/CacheHelper.cs @@ -27,10 +27,10 @@ using System.Xml; namespace Apache.Geode.Client.FwkLib { using Apache.Geode.DUnitFramework; - using Apache.Geode.Client.Generic; - //using Region = Apache.Geode.Client.Generic.IRegion<Object, Object>; - //using IntRegion = Apache.Geode.Client.Generic.IRegion<int, byte[]>; - //using StringRegion = Apache.Geode.Client.Generic.IRegion<string, byte[]>; + using Apache.Geode.Client; + //using Region = Apache.Geode.Client.IRegion<Object, Object>; + //using IntRegion = Apache.Geode.Client.IRegion<int, byte[]>; + //using StringRegion = Apache.Geode.Client.IRegion<string, byte[]>; using VMW = Apache.Geode.Client; public class PropsStringToObject { @@ -456,7 +456,7 @@ namespace Apache.Geode.Client.FwkLib } } - public static string RegionTag(Apache.Geode.Client.Generic.RegionAttributes<TKey, TVal> attrs) + public static string RegionTag(Apache.Geode.Client.RegionAttributes<TKey, TVal> attrs) { string tag = string.Empty; tag += attrs.CachingEnabled ? "Caching" : "NoCache"; @@ -464,7 +464,7 @@ namespace Apache.Geode.Client.FwkLib return tag; } - public static string RegionAttributesToString(Apache.Geode.Client.Generic.RegionAttributes<TKey, TVal> attrs) + public static string RegionAttributesToString(Apache.Geode.Client.RegionAttributes<TKey, TVal> attrs) { StringBuilder attrsSB = new StringBuilder(); attrsSB.Append(Environment.NewLine + "caching: " +