Skip to content

Commit

Permalink
renamed getTypeId to getHazelcastTypeId to avoid collisions with user…
Browse files Browse the repository at this point in the history
… functuins
  • Loading branch information
sancar committed Feb 8, 2016
1 parent b184db6 commit a0c8022
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions examples/serialization/custom/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Person {
std::string name;
};

int getTypeId(const Person& p){
int getHazelcastTypeId(const Person* p){
return 666;
}

Expand All @@ -60,7 +60,7 @@ class CustomSerializer : public hazelcast::client::serialization::Serializer<Per
assert(i == 666);
}

int getTypeId() const {
int getHazelcastTypeId() const {
return 666;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace hazelcast {
return boost::shared_ptr<T>(static_cast<T *>(NULL));
} else {
std::auto_ptr<T> result(new T);
constants.checkClassType(getTypeId(*result) , typeId);
constants.checkClassType(getHazelcastTypeId(result.get()) , typeId);
if (constants.CONSTANT_TYPE_DATA == typeId) {
readDataSerializable(reinterpret_cast<IdentifiedDataSerializable *>(result.get()));
} else if (constants.CONSTANT_TYPE_PORTABLE == typeId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace hazelcast {
writeInt(pimpl::SerializationConstants::CONSTANT_TYPE_NULL);
} else {
const T *object = static_cast<const T *>(serializable);
int type = getTypeId(*object);
int type = getHazelcastTypeId(object);
writeInt(type);

boost::shared_ptr<SerializerBase> serializer = context->getSerializerHolder().serializerFor(type);
Expand Down
10 changes: 5 additions & 5 deletions hazelcast/include/hazelcast/client/serialization/Serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ namespace hazelcast {
* for your classes. Also not that for your serialized classes you need to implement as free function
* in same namespace with your class
*
* int getTypeId(const MyClass&);
* int getHazelcastTypeId(const MyClass*);
*
* which should return same id with its serializer.
*/
virtual int getTypeId() const = 0;
virtual int getHazelcastTypeId() const = 0;
};

/**
Expand All @@ -62,7 +62,7 @@ namespace hazelcast {
void read(serialization::ObjectDataInput & in, ExampleBaseClass& object);
int getTypeId() const;
int getHazelcastTypeId() const;
};
}
Expand All @@ -84,7 +84,7 @@ namespace hazelcast {
//.....
}
int getTypeId() const {
int getHazelcastTypeId() const {
//..
}
};
Expand All @@ -93,7 +93,7 @@ namespace hazelcast {
* Along with serializer following function should be provided with same namespace that ExampleBaseClass
* belongs to
*
* int getTypeId(const MyClass&);
* int getHazelcastTypeId(const MyClass*);
*
* which should return same id with its serializer.
*
Expand Down
4 changes: 2 additions & 2 deletions hazelcast/include/hazelcast/client/serialization/TypeIDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ namespace hazelcast {
class Portable;
class IdentifiedDataSerializable;

int HAZELCAST_API getTypeId(const Portable& portable);
int HAZELCAST_API getHazelcastTypeId(const Portable* portable);

int HAZELCAST_API getTypeId(const IdentifiedDataSerializable& identifiedDataSerializable);
int HAZELCAST_API getHazelcastTypeId(const IdentifiedDataSerializable* identifiedDataSerializable);

}
}
Expand Down
4 changes: 2 additions & 2 deletions hazelcast/src/hazelcast/client/serialization/TypeIDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
namespace hazelcast {
namespace client {
namespace serialization {
int getTypeId(const Portable& portable) {
int getHazelcastTypeId(const Portable* portable) {
return pimpl::SerializationConstants::CONSTANT_TYPE_PORTABLE;
}

int getTypeId(const IdentifiedDataSerializable& identifiedDataSerializable) {
int getHazelcastTypeId(const IdentifiedDataSerializable* identifiedDataSerializable) {
return pimpl::SerializationConstants::CONSTANT_TYPE_DATA;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace hazelcast {
}

bool SerializerHolder::registerSerializer(boost::shared_ptr<SerializerBase> serializer) {
boost::shared_ptr<SerializerBase> available = serializers.putIfAbsent(serializer->getTypeId(), serializer);
boost::shared_ptr<SerializerBase> available = serializers.putIfAbsent(serializer->getHazelcastTypeId(), serializer);
return available.get() == NULL;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace hazelcast {
assert(i == 999);
}

int TestCustomPersonSerializer::getTypeId() const {
int TestCustomPersonSerializer::getHazelcastTypeId() const {
return 999;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace hazelcast {

void read(serialization::ObjectDataInput & in, TestCustomPerson& object);

int getTypeId() const;
int getHazelcastTypeId() const;
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace hazelcast {
assert(i == 666);
}

int getTypeId() const {
int getHazelcastTypeId() const {
return 666;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace hazelcast {
return !(*this == rhs);
}

int getTypeId(TestCustomXSerializable const& param) {
int getHazelcastTypeId(TestCustomXSerializable const* param) {
return 666;
}

Expand Down Expand Up @@ -71,7 +71,7 @@ namespace hazelcast {
return name;
}

int getTypeId(TestCustomPerson const& param) {
int getHazelcastTypeId(TestCustomPerson const* param) {
return 999;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace hazelcast {
int id;
};

int getTypeId(const TestCustomXSerializable& );
int getHazelcastTypeId(const TestCustomXSerializable* );

class TestCustomPerson {
public:
Expand All @@ -61,7 +61,7 @@ namespace hazelcast {
std::string name;
};

int getTypeId(const TestCustomPerson& );
int getHazelcastTypeId(const TestCustomPerson* );
}
}
}
Expand Down

0 comments on commit a0c8022

Please sign in to comment.