Hazelcast C++ Client
PNCounter.h
1 /*
2  * Copyright (c) 2008-2019, 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 #ifndef HAZELCAST_CLIENT_PNCOUNTER_PNCOUNTER_H_
18 #define HAZELCAST_CLIENT_PNCOUNTER_PNCOUNTER_H_
19 
20 #include <stdint.h>
21 
22 #include "hazelcast/client/spi/ClientProxy.h"
23 #include "hazelcast/client/DistributedObject.h"
24 
73 #include "hazelcast/client/DistributedObject.h"
74 
75 namespace hazelcast {
76  namespace client {
77  namespace crdt {
78  namespace pncounter {
79  class HAZELCAST_API PNCounter : public virtual DistributedObject {
80  public:
92  virtual int64_t get() = 0;
93 
107  virtual int64_t getAndAdd(int64_t delta) = 0;
108 
122  virtual int64_t addAndGet(int64_t delta) = 0;
123 
137  virtual int64_t getAndSubtract(int64_t delta) = 0;
138 
152  virtual int64_t subtractAndGet(int64_t delta) = 0;
153 
166  virtual int64_t decrementAndGet() = 0;
167 
180  virtual int64_t incrementAndGet() = 0;
181 
194  virtual int64_t getAndDecrement() = 0;
195 
208  virtual int64_t getAndIncrement() = 0;
209 
215  virtual void reset() = 0;
216  };
217  }
218  }
219  }
220 }
221 
222 #endif //HAZELCAST_CLIENT_PNCOUNTER_PNCOUNTER_H_
Base class for all distributed objects.
Definition: DistributedObject.h:58
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32