| Apache Ignite C++

ignite_client.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_THIN_IGNITE_CLIENT
24 #define _IGNITE_THIN_IGNITE_CLIENT
25
26 #include <vector>
27
28 #include <ignite/common/concurrent.h>
29
30 #include <ignite/thin/ignite_client_configuration.h>
31 #include <ignite/thin/cache/cache_client.h>
32
33 namespace ignite
34 {
35 namespace thin
36 {
47 class IGNITE_IMPORT_EXPORT IgniteClient
48 {
49 typedef common::concurrent::SharedPointer<void> SP_Void;
50 public:
54 IgniteClient()
55 {
56 // No-op.
57 }
58
62 ~IgniteClient();
63
71 static IgniteClient Start(const IgniteClientConfiguration& cfg);
72
79 template<typename K, typename V>
80 cache::CacheClient<K, V> GetCache(const char* name)
81 {
82 return cache::CacheClient<K, V>(InternalGetCache(name));
83 }
84
91 template<typename K, typename V>
92 cache::CacheClient<K, V> GetOrCreateCache(const char* name)
93 {
94 return cache::CacheClient<K, V>(InternalGetOrCreateCache(name));
95 }
96
103 template<typename K, typename V>
104 cache::CacheClient<K, V> CreateCache(const char* name)
105 {
106 return cache::CacheClient<K, V>(InternalCreateCache(name));
107 }
108
114 void DestroyCache(const char* name);
115
122 void GetCacheNames(std::vector<std::string>& cacheNames);
123
124 private:
132 SP_Void InternalGetCache(const char* name);
133
141 SP_Void InternalGetOrCreateCache(const char* name);
142
150 SP_Void InternalCreateCache(const char* name);
151
157 IgniteClient(SP_Void& impl);
158
160 SP_Void impl;
161 };
162 }
163 }
164
165 #endif // _IGNITE_THIN_IGNITE_CLIENT
cache_client.h
Declares ignite::thin::cache::CacheClient.
ignite::thin::IgniteClient::GetOrCreateCache
cache::CacheClient< K, V > GetOrCreateCache(const char *name)
Get or create cache.
Definition: ignite_client.h:92
ignite::thin::IgniteClient::GetCache
cache::CacheClient< K, V > GetCache(const char *name)
Get cache.
Definition: ignite_client.h:80
ignite::thin::IgniteClient::IgniteClient
IgniteClient()
Default constructor.
Definition: ignite_client.h:54
ignite::thin::IgniteClientConfiguration
Ignite thin client configuration.
Definition: ignite_client_configuration.h:39
ignite::thin::cache::CacheClient
Cache client class template.
Definition: cache_client.h:56
ignite::thin::IgniteClient::CreateCache
cache::CacheClient< K, V > CreateCache(const char *name)
Create cache.
Definition: ignite_client.h:104
ignite_client_configuration.h
Declares ignite::thin::IgniteClientConfiguration class.
ignite
Apache Ignite API.
Definition: cache.h:48
ignite::thin::IgniteClient
Ignite client class.
Definition: ignite_client.h:47