GridGain C++
ignite_client.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_THIN_IGNITE_CLIENT
23 #define _IGNITE_THIN_IGNITE_CLIENT
24 
25 #include <vector>
26 
27 #include <ignite/common/concurrent.h>
28 
32 #include <ignite/thin/transactions/transactions.h>
33 
34 namespace ignite
35 {
36  namespace thin
37  {
48  class IGNITE_IMPORT_EXPORT IgniteClient
49  {
50  typedef common::concurrent::SharedPointer<void> SP_Void;
51  public:
56  {
57  // No-op.
58  }
59 
63  ~IgniteClient();
64 
72  static IgniteClient Start(const IgniteClientConfiguration& cfg);
73 
80  template<typename K, typename V>
82  {
83  return cache::CacheClient<K, V>(InternalGetCache(name));
84  }
85 
92  template<typename K, typename V>
94  {
95  return cache::CacheClient<K, V>(InternalGetOrCreateCache(name));
96  }
97 
104  template<typename K, typename V>
106  {
107  return cache::CacheClient<K, V>(InternalCreateCache(name));
108  }
109 
115  void DestroyCache(const char* name);
116 
123  void GetCacheNames(std::vector<std::string>& cacheNames);
124 
129  {
130  return transactions::ClientTransactions(InternalTransactions());
131  }
132 
137  {
138  return compute::ComputeClient(InternalCompute());
139  }
140 
141  private:
149  SP_Void InternalGetCache(const char* name);
150 
158  SP_Void InternalGetOrCreateCache(const char* name);
159 
167  SP_Void InternalCreateCache(const char* name);
168 
175  SP_Void InternalTransactions();
176 
183  SP_Void InternalCompute();
184 
190  IgniteClient(SP_Void& impl);
191 
193  SP_Void impl;
194  };
195  }
196 }
197 
198 #endif // _IGNITE_THIN_IGNITE_CLIENT
ignite_client_configuration.h
ignite::thin::IgniteClient::CreateCache
cache::CacheClient< K, V > CreateCache(const char *name)
Create cache.
Definition: ignite_client.h:105
ignite
Ignite API.
Definition: cache.h:47
ignite::thin::IgniteClient::GetCompute
compute::ComputeClient GetCompute()
Get client compute API.
Definition: ignite_client.h:136
cache_client.h
ignite::thin::compute::ComputeClient
Client Compute API.
Definition: compute_client.h:52
ignite::thin::IgniteClient::IgniteClient
IgniteClient()
Default constructor.
Definition: ignite_client.h:55
ignite::thin::IgniteClient::GetOrCreateCache
cache::CacheClient< K, V > GetOrCreateCache(const char *name)
Get or create cache.
Definition: ignite_client.h:93
compute_client.h
ignite::thin::IgniteClient::ClientTransactions
transactions::ClientTransactions ClientTransactions()
Starts transactions.
Definition: ignite_client.h:128
ignite::thin::cache::CacheClient
Cache client class template.
Definition: cache_client.h:63
ignite::thin::IgniteClientConfiguration
Ignite thin client configuration.
Definition: ignite_client_configuration.h:38
ignite::thin::IgniteClient::GetCache
cache::CacheClient< K, V > GetCache(const char *name)
Get cache.
Definition: ignite_client.h:81
ignite::thin::transactions::ClientTransactions
Transactions client.
Definition: thin-client/include/ignite/thin/transactions/transactions.h:42
ignite::thin::IgniteClient
Ignite client class.
Definition: ignite_client.h:48