|
activemq-cpp-3.8.2
|
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. More... | |
| AtomicBoolean (bool initialValue) | |
| Creates a new AtomicBoolean with the initial value. More... | |
| virtual | ~AtomicBoolean () |
| bool | get () const |
| Gets the current value of this AtomicBoolean. More... | |
| void | set (bool newValue) |
| Unconditionally sets to the given value. More... | |
| bool | compareAndSet (bool expect, bool update) |
| Atomically sets the value to the given updated value if the current value == the expected value. More... | |
| bool | getAndSet (bool newValue) |
| Atomically sets to the given value and returns the previous value. More... | |
| std::string | toString () const |
| Returns the String representation of the current value. More... | |
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::stomp::StompWireFormat::inReceive(), activemq::wireformat::openwire::OpenWireFormat::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.