Hazelcast C++ Client
Hazelcast C++ Client Library
index_config.h
1 /*
2  * Copyright (c) 2008-2021, 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  struct HAZELCAST_API bitmap_index_options {
48 
56 
62  RAW
63  };
64 
65  std::string key;
66  unique_key_transformation transformation;
67 
71  static const std::string DEFAULT_KEY;
72 
77 
83  };
84 
85  enum index_type {
88 
91 
93  BITMAP
94  };
95 
97  boost::optional<std::string> name;
98 
101 
103  std::vector<std::string> attributes;
104 
105  boost::optional<bitmap_index_options> options;
106 
107  static const index_type DEFAULT_TYPE;
108 
109  index_config();
110 
116  index_config(index_type type);
117 
124  template<typename ...T>
125  index_config(index_type t, T... attrs) : type(t) {
126  add_attributes(std::forward<T>(attrs)...);
127  }
128 
129  private:
130  template<typename ...T>
131  void add_attributes(std::string attribute, T... attrs) {
132  attributes.emplace_back(std::move(attribute));
133  add_attributes(attrs...);
134  }
135 
136  void add_attributes();
137  };
138  }
139  }
140 }
141 
142 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
143 #pragma warning(pop)
144 #endif
@ OBJECT
Extracted unique key value is interpreted as an object value.
Definition: index_config.h:47
@ LONG
Extracted unique key value is interpreted as a whole integer value of byte, short,...
Definition: index_config.h:55
static const unique_key_transformation DEFAULT_TRANSFORMATION
The default for \transformation.
Definition: index_config.h:76
static const std::string DEFAULT_KEY
The default for \key.
Definition: index_config.h:71
Configuration of an index.
Definition: index_config.h:40
std::vector< std::string > attributes
Indexed attributes.
Definition: index_config.h:103
boost::optional< std::string > name
Name of the index.
Definition: index_config.h:97
index_type type
Type of the index.
Definition: index_config.h:100
index_config(index_type t, T... attrs)
Creates an index configuration of the given type with provided attributes.
Definition: index_config.h:125