Hazelcast C++ Client
TransactionOptions.h
1 /*
2  * Copyright (c) 2008-2018, 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 // Created by sancar koyunlu on 8/2/13.
18 #ifndef HAZELCAST_TransactionOptions
19 #define HAZELCAST_TransactionOptions
20 
21 #include "hazelcast/util/HazelcastDll.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 {
33  class HAZELCAST_API TransactionType {
34  public:
38  enum Type {
39  TWO_PHASE = 1,
40  LOCAL = 2
41  };
46 
50  TransactionType(Type value);
51 
55  operator int() const;
56 
60  void operator=(int i);
61 
62  };
63 
67  class HAZELCAST_API TransactionOptions {
68  public:
75 
80  TransactionType getTransactionType() const;
81 
94  TransactionOptions& setTransactionType(TransactionType transactionType);
95 
100  int getTimeout() const;
101 
106  int getTimeoutMillis() const;
107 
118  TransactionOptions& setTimeout(int timeoutInSeconds);
119 
125  int getDurability() const;
126 
137  TransactionOptions& setDurability(int durability);
138 
139  private:
140  int timeoutSeconds;
141 
142  int durability;
143 
144  TransactionType transactionType;
145 
146  };
147  }
148 }
149 
150 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
151 #pragma warning(pop)
152 #endif
153 
154 #endif //HAZELCAST_TransactionOptions
155 
Contains the configuration for a Hazelcast transaction.
Definition: TransactionOptions.h:67
Transaction type.
Definition: TransactionOptions.h:33
Type
Type enum.
Definition: TransactionOptions.h:38
Definition: MapEntryView.h:32
Type value
value.
Definition: TransactionOptions.h:45