Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
Serializer.h
1 /*
2  * Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 //
17 // Created by sancar koyunlu on 6/7/13.
18 
19 #ifndef HAZELCAST_TYPE_SERIALIZER
20 #define HAZELCAST_TYPE_SERIALIZER
21 
22 #include <stdint.h>
23 
24 #include "hazelcast/util/HazelcastDll.h"
25 
26 namespace hazelcast {
27  namespace client {
28  namespace serialization {
29  class ObjectDataOutput;
30 
31  class ObjectDataInput;
32 
36  class HAZELCAST_API SerializerBase {
37  public:
41  virtual ~SerializerBase();
42 
52  virtual int32_t getHazelcastTypeId() const = 0;
53  };
54 
109  template <typename Serializable>
110  class Serializer : public SerializerBase {
111  public:
115  virtual ~Serializer() {}
116 
123  virtual void write(ObjectDataOutput &out, const Serializable &object) = 0;
124 
131  virtual void read(ObjectDataInput &in, Serializable &object) = 0;
132  };
133 
134  }
135  }
136 }
137 
138 
139 #endif //HAZELCAST_TYPE_SERIALIZER
140 
virtual ~Serializer()
Destructor.
Definition: Serializer.h:115
Internal Base class for Serializers.
Definition: Serializer.h:36
Base class for custom serialization.
Definition: Serializer.h:110
virtual void read(ObjectDataInput &in, Serializable &object)=0
Reads object from objectDataInputStream.
Provides serialization methods for primitive types,a arrays of primitive types, Portable, IdentifiedDataSerializable and custom serializables.
Definition: ObjectDataOutput.h:52
virtual void write(ObjectDataOutput &out, const Serializable &object)=0
This method writes object to ObjectDataOutput.
Provides deserialization methods for primitives types, arrays of primitive types Portable, IdentifiedDataSerializable and custom serializable types.
Definition: ObjectDataInput.h:66