Hazelcast C++ Client
Hazelcast C++ Client Library
index_config.h
1 /*
2  * Copyright (c) 2008-2022, 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 #pragma once
18 
19 #include <string>
20 
21 #include "hazelcast/util/export.h"
22 
23 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24 #pragma warning(push)
25 #pragma warning(disable : 4251) // for dll export
26 #endif
27 
28 namespace hazelcast {
29 namespace client {
30 namespace config {
40 struct HAZELCAST_API index_config
41 {
42  struct HAZELCAST_API bitmap_index_options
43  {
45  {
52 
60 
67  RAW
68  };
69 
70  std::string key;
71  unique_key_transformation transformation;
72 
76  static const std::string DEFAULT_KEY;
77 
82 
88  };
89 
91  {
94 
97 
99  BITMAP
100  };
101 
103  boost::optional<std::string> name;
104 
107 
109  std::vector<std::string> attributes;
110 
111  boost::optional<bitmap_index_options> options;
112 
113  static const index_type DEFAULT_TYPE;
114 
115  index_config();
116 
122  index_config(index_type type);
123 
131  template<typename... T>
132  index_config(index_type t, T... attrs)
133  : type(t)
134  {
135  add_attributes(std::forward<T>(attrs)...);
136  }
137 
138 private:
139  template<typename... T>
140  void add_attributes(std::string attribute, T... attrs)
141  {
142  attributes.emplace_back(std::move(attribute));
143  add_attributes(attrs...);
144  }
145 
146  void add_attributes();
147 };
148 } // namespace config
149 } // namespace client
150 } // namespace hazelcast
151 
152 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
153 #pragma warning(pop)
154 #endif
@ OBJECT
Extracted unique key value is interpreted as an object value.
Definition: index_config.h:51
@ LONG
Extracted unique key value is interpreted as a whole integer value of byte, short,...
Definition: index_config.h:59
static const unique_key_transformation DEFAULT_TRANSFORMATION
The default for \transformation.
Definition: index_config.h:81
static const std::string DEFAULT_KEY
The default for \key.
Definition: index_config.h:76
Configuration of an index.
Definition: index_config.h:41
std::vector< std::string > attributes
Indexed attributes.
Definition: index_config.h:109
boost::optional< std::string > name
Name of the index.
Definition: index_config.h:103
index_type type
Type of the index.
Definition: index_config.h:106
index_config(index_type t, T... attrs)
Creates an index configuration of the given type with provided attributes.
Definition: index_config.h:132