activemq-cpp-3.9.5
|
A boolean value that may be updated atomically. More...
#include <src/main/decaf/util/concurrent/atomic/AtomicBoolean.h>
Public Member Functions | |
AtomicBoolean () | |
Creates a new AtomicBoolean whose initial value is false. | |
AtomicBoolean (bool initialValue) | |
Creates a new AtomicBoolean with the initial value. | |
virtual | ~AtomicBoolean () |
bool | get () const |
Gets the current value of this AtomicBoolean. | |
void | set (bool newValue) |
Unconditionally sets to the given value. | |
bool | compareAndSet (bool expect, bool update) |
Atomically sets the value to the given updated value if the current value == the expected value. | |
bool | getAndSet (bool newValue) |
Atomically sets to the given value and returns the previous value. | |
std::string | toString () const |
Returns the String representation of the current value. | |
A boolean value that may be updated atomically.
An AtomicBoolean is used in applications such as atomically updated flags, and cannot be used as a replacement for a Boolean.
decaf::util::concurrent::atomic::AtomicBoolean::AtomicBoolean | ( | ) |
Creates a new AtomicBoolean whose initial value is false.
decaf::util::concurrent::atomic::AtomicBoolean::AtomicBoolean | ( | bool | initialValue | ) |
Creates a new AtomicBoolean with the initial value.
initialValue | - The initial value of this boolean. |
|
inlinevirtual |
bool decaf::util::concurrent::atomic::AtomicBoolean::compareAndSet | ( | bool | expect, |
bool | update ) |
Atomically sets the value to the given updated value if the current value == the expected value.
expect | - the expected value |
update | - the new value |
|
inline |
Gets the current value of this AtomicBoolean.
Referenced by activemq::wireformat::openwire::OpenWireFormat::inReceive(), activemq::wireformat::stomp::StompWireFormat::inReceive(), activemq::core::ActiveMQConnection::isClosed(), activemq::core::ActiveMQConnection::isStarted(), and activemq::core::ActiveMQConnection::isTransportFailed().
bool decaf::util::concurrent::atomic::AtomicBoolean::getAndSet | ( | bool | newValue | ) |
Atomically sets to the given value and returns the previous value.
newValue | - the new value |
|
inline |
Unconditionally sets to the given value.
newValue | - the new value |
std::string decaf::util::concurrent::atomic::AtomicBoolean::toString | ( | ) | const |
Returns the String representation of the current value.