Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
TransactionOptions.h
1 /*
2  * Copyright (c) 2008-2017, 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 
112  TransactionOptions& setTimeout(int timeoutInSeconds);
113 
119  int getDurability() const;
120 
131  TransactionOptions& setDurability(int durability);
132 
133  private:
134  int timeoutSeconds;
135 
136  int durability;
137 
138  TransactionType transactionType;
139 
140  };
141  }
142 }
143 
144 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
145 #pragma warning(pop)
146 #endif
147 
148 #endif //HAZELCAST_TransactionOptions
149 
Contains the configuration for a Hazelcast transaction.
Definition: TransactionOptions.h:67
Transaction type.
Definition: TransactionOptions.h:33
Type
Type enum.
Definition: TransactionOptions.h:38
Type value
value.
Definition: TransactionOptions.h:45