kyotocabinet::AtomicInt64 Class Reference
Integer with atomic operations.
More...
#include <kcthread.h>
List of all members.
Detailed Description
Integer with atomic operations.
Constructor & Destructor Documentation
kyotocabinet::AtomicInt64::AtomicInt64 |
( |
|
) |
[explicit] |
kyotocabinet::AtomicInt64::AtomicInt64 |
( |
const AtomicInt64 & |
src |
) |
|
Copy constructor.
- Parameters:
-
kyotocabinet::AtomicInt64::AtomicInt64 |
( |
int64_t |
num |
) |
|
kyotocabinet::AtomicInt64::~AtomicInt64 |
( |
|
) |
|
Member Function Documentation
int64_t kyotocabinet::AtomicInt64::set |
( |
int64_t |
val |
) |
|
Set the new value.
- Parameters:
-
- Returns:
- the old value.
int64_t kyotocabinet::AtomicInt64::add |
( |
int64_t |
val |
) |
|
Add a value.
- Parameters:
-
| val | the additional value. |
- Returns:
- the old value.
bool kyotocabinet::AtomicInt64::cas |
( |
int64_t |
oval, |
|
|
int64_t |
nval | |
|
) |
| | |
Perform compare-and-swap.
- Parameters:
-
| oval | the old value. |
| nval | the new value. |
- Returns:
- true on success, or false on failure.
int64_t kyotocabinet::AtomicInt64::get |
( |
|
) |
const |
Get the current value.
- Returns:
- the current value.
Assignment operator from the self type.
- Parameters:
-
- Returns:
- the reference to itself.
AtomicInt64& kyotocabinet::AtomicInt64::operator= |
( |
const int64_t & |
right |
) |
|
Assignment operator from integer.
- Parameters:
-
- Returns:
- the reference to itself.
kyotocabinet::AtomicInt64::operator int64_t |
( |
|
) |
const |
Cast operator to integer.
- Returns:
- the current value.
AtomicInt64& kyotocabinet::AtomicInt64::operator+= |
( |
int64_t |
right |
) |
|
Summation assignment operator by integer.
- Parameters:
-
- Returns:
- the reference to itself.
AtomicInt64& kyotocabinet::AtomicInt64::operator-= |
( |
int64_t |
right |
) |
|
Subtraction assignment operator by integer.
- Parameters:
-
- Returns:
- the reference to itself.
int64_t kyotocabinet::AtomicInt64::secure_least |
( |
int64_t |
val |
) |
|
Secure the least value.
- Parameters:
-
- Returns:
- the current value.