Hazelcast C++ Client
 All Classes Functions Variables Enumerations Pages
FieldDefinition.h
1 /*
2  * Copyright (c) 2008-2015, 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 
30 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
31 #pragma warning(push)
32 #pragma warning(disable: 4251) //for dll export
33 #endif
34 
35 namespace hazelcast {
36  namespace client {
37  namespace serialization {
38  namespace pimpl {
39  class DataInput;
40 
41  class DataOutput;
42  }
43 
47  class HAZELCAST_API FieldDefinition {
48  public:
49 
54 
58  FieldDefinition(int, const std::string&, FieldType const&);
59 
63  FieldDefinition(int index, const std::string& fieldName, FieldType const& type, int factoryId, int classId);
64 
68  const FieldType &getType() const;
69 
73  std::string getName() const;
74 
78  int getIndex() const;
79 
83  int getFactoryId() const;
84 
88  int getClassId() const;
89 
90 
94  void writeData(pimpl::DataOutput& dataOutput);
95 
99  void readData(pimpl::DataInput& dataInput);
100 
101  private:
102  int index;
103  std::string fieldName;
104  FieldType type;
105  int classId;
106  int factoryId;
107  };
108  }
109  }
110 }
111 
112 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
113 #pragma warning(pop)
114 #endif
115 
116 #endif /* HAZELCAST_FIELD_DEFINITION */
117 
FieldDefinition defines name, type, index of a field.
Definition: FieldDefinition.h:47