| Apache Ignite C++

binary_enum_entry.h
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
23 #ifndef _IGNITE_BINARY_BINARY_ENUM_ENTRY
24 #define _IGNITE_BINARY_BINARY_ENUM_ENTRY
25
26 #include <stdint.h>
27
28 #include <ignite/common/common.h>
29
30 namespace ignite
31 {
32 namespace binary
33 {
39 class IGNITE_IMPORT_EXPORT BinaryEnumEntry
40 {
41 public:
45 BinaryEnumEntry() :
46 typeId(0),
47 ordinal(0)
48 {
49 // No-op.
50 }
51
58 BinaryEnumEntry(int32_t typeId, int32_t ordinal) :
59 typeId(typeId),
60 ordinal(ordinal)
61 {
62 // No-op.
63 }
64
72 int32_t GetTypeId() const
73 {
74 return typeId;
75 }
76
82 int32_t GetOrdinal() const
83 {
84 return ordinal;
85 }
86
92 bool IsNull() const
93 {
94 return typeId == 0;
95 }
96
97 private:
99 int32_t typeId;
100
102 int32_t ordinal;
103 };
104 }
105 }
106
107 #endif //_IGNITE_BINARY_BINARY_ENUM_ENTRY
ignite::binary::BinaryEnumEntry::GetOrdinal
int32_t GetOrdinal() const
Get ordinal of the enum value.
Definition: binary_enum_entry.h:82
ignite::binary::BinaryEnumEntry::BinaryEnumEntry
BinaryEnumEntry()
Default constructor.
Definition: binary_enum_entry.h:45
ignite::binary::BinaryEnumEntry::IsNull
bool IsNull() const
Check whether value was acquired by reading a NULL value.
Definition: binary_enum_entry.h:92
ignite::binary::BinaryEnumEntry::BinaryEnumEntry
BinaryEnumEntry(int32_t typeId, int32_t ordinal)
Constructor.
Definition: binary_enum_entry.h:58
ignite::binary::BinaryEnumEntry
Binary enum entry.
Definition: binary_enum_entry.h:39
ignite::binary::BinaryEnumEntry::GetTypeId
int32_t GetTypeId() const
Get type ID.
Definition: binary_enum_entry.h:72
ignite
Apache Ignite API.
Definition: cache.h:48