Hazelcast C++ Client
FieldDefinition.h
1 /*
2  * Copyright (c) 2008-2018, 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 // FieldDefinition.h
18 // Server
19 //
20 // Created by sancar koyunlu on 1/10/13.
21 // Copyright (c) 2013 sancar koyunlu. All rights reserved.
22 //
23 
24 #ifndef HAZELCAST_FIELD_DEFINITION
25 #define HAZELCAST_FIELD_DEFINITION
26 
27 #include "hazelcast/client/serialization/FieldType.h"
28 #include <string>
29 #include <ostream>
30 
31 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
32 #pragma warning(push)
33 #pragma warning(disable: 4251) //for dll export
34 #endif
35 
36 namespace hazelcast {
37  namespace client {
38  namespace serialization {
39  namespace pimpl {
40  class DataInput;
41 
42  class DataOutput;
43  }
44 
48  class HAZELCAST_API FieldDefinition {
49  public:
50 
55 
59  FieldDefinition(int, const std::string&, FieldType const&type, int version);
60 
64  FieldDefinition(int index, const std::string &fieldName, FieldType const &type, int factoryId,
65  int classId, int version);
66 
70  const FieldType &getType() const;
71 
75  std::string getName() const;
76 
80  int getIndex() const;
81 
85  int getFactoryId() const;
86 
90  int getClassId() const;
91 
92 
96  void writeData(pimpl::DataOutput& dataOutput);
97 
101  void readData(pimpl::DataInput& dataInput);
102 
103  bool operator==(const FieldDefinition &rhs) const;
104 
105  bool operator!=(const FieldDefinition &rhs) const;
106 
107  friend std::ostream &operator<<(std::ostream &os, const FieldDefinition &definition);
108 
109  private:
110  int index;
111  std::string fieldName;
112  FieldType type;
113  int classId;
114  int factoryId;
115  int version;
116  };
117  }
118  }
119 }
120 
121 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
122 #pragma warning(pop)
123 #endif
124 
125 #endif /* HAZELCAST_FIELD_DEFINITION */
126 
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
FieldDefinition defines name, type, index of a field.
Definition: FieldDefinition.h:48