GridGain C++
binary_enum_entry.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 GridGain Systems, Inc. and Contributors.
3  *
4  * Licensed under the GridGain Community Edition License (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  * https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
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 
22 #ifndef _IGNITE_BINARY_BINARY_ENUM_ENTRY
23 #define _IGNITE_BINARY_BINARY_ENUM_ENTRY
24 
25 #include <stdint.h>
26 
27 #include <ignite/common/common.h>
28 
29 namespace ignite
30 {
31  namespace binary
32  {
38  class IGNITE_IMPORT_EXPORT BinaryEnumEntry
39  {
40  public:
45  typeId(0),
46  ordinal(0)
47  {
48  // No-op.
49  }
50 
57  BinaryEnumEntry(int32_t typeId, int32_t ordinal) :
58  typeId(typeId),
59  ordinal(ordinal)
60  {
61  // No-op.
62  }
63 
71  int32_t GetTypeId() const
72  {
73  return typeId;
74  }
75 
81  int32_t GetOrdinal() const
82  {
83  return ordinal;
84  }
85 
91  bool IsNull() const
92  {
93  return typeId == 0;
94  }
95 
96  private:
98  int32_t typeId;
99 
101  int32_t ordinal;
102  };
103  }
104 }
105 
106 #endif //_IGNITE_BINARY_BINARY_ENUM_ENTRY
ignite
Ignite API.
Definition: cache.h:47
ignite::binary::BinaryEnumEntry::GetOrdinal
int32_t GetOrdinal() const
Get ordinal of the enum value.
Definition: binary_enum_entry.h:81
ignite::binary::BinaryEnumEntry::IsNull
bool IsNull() const
Check whether value was acquired by reading a NULL value.
Definition: binary_enum_entry.h:91
ignite::binary::BinaryEnumEntry::BinaryEnumEntry
BinaryEnumEntry(int32_t typeId, int32_t ordinal)
Constructor.
Definition: binary_enum_entry.h:57
ignite::binary::BinaryEnumEntry::BinaryEnumEntry
BinaryEnumEntry()
Default constructor.
Definition: binary_enum_entry.h:44
ignite::binary::BinaryEnumEntry::GetTypeId
int32_t GetTypeId() const
Get type ID.
Definition: binary_enum_entry.h:71
ignite::binary::BinaryEnumEntry
Binary enum entry.
Definition: binary_enum_entry.h:38