activemq-cpp-3.9.5
decaf::util::concurrent::atomic::AtomicRefCounter Class Reference

#include <src/main/decaf/util/concurrent/atomic/AtomicRefCounter.h>

Inherited by decaf::lang::Pointer< StlMapEntrySet >, decaf::lang::Pointer< StlMapKeySet >, decaf::lang::Pointer< StlMapValueCollection >, decaf::lang::Pointer< ConstStlMapEntrySet >, decaf::lang::Pointer< ConstStlMapKeySet >, decaf::lang::Pointer< ConstStlMapValueCollection >, decaf::lang::Pointer< decaf::util::HashMap::HashMapEntrySet >, decaf::lang::Pointer< decaf::util::HashMap::HashMapKeySet >, decaf::lang::Pointer< decaf::util::HashMap::HashMapValueCollection >, decaf::lang::Pointer< decaf::util::HashMap::ConstHashMapEntrySet >, decaf::lang::Pointer< decaf::util::HashMap::ConstHashMapKeySet >, decaf::lang::Pointer< decaf::util::HashMap::ConstHashMapValueCollection >, decaf::lang::Pointer< activemq::commands::ActiveMQDestination >, decaf::lang::Pointer< activemq::commands::BrokerError >, decaf::lang::Pointer< decaf::lang::Exception >, decaf::lang::Pointer< activemq::commands::BrokerId >, decaf::lang::Pointer< activemq::commands::ConnectionId >, decaf::lang::Pointer< activemq::commands::ConsumerId >, decaf::lang::Pointer< activemq::commands::SessionId >, decaf::lang::Pointer< activemq::commands::BooleanExpression >, decaf::lang::Pointer< activemq::commands::DataStructure >, decaf::lang::Pointer< activemq::commands::MessageAck >, decaf::lang::Pointer< activemq::commands::MessageId >, decaf::lang::Pointer< activemq::commands::TransactionId >, decaf::lang::Pointer< activemq::commands::ProducerId >, decaf::lang::Pointer< activemq::core::ActiveMQAckHandler >, decaf::lang::Pointer< activemq::commands::Message >, decaf::lang::Pointer< activemq::commands::DestinationInfo >, decaf::lang::Pointer< activemq::core::kernels::ActiveMQProducerKernel >, decaf::lang::Pointer< activemq::core::kernels::ActiveMQConsumerKernel >, decaf::lang::Pointer< activemq::core::kernels::ActiveMQSessionKernel >, decaf::lang::Pointer< activemq::core::MessageDispatchChannel >, decaf::lang::Pointer< activemq::threads::TaskRunner >, decaf::lang::Pointer< activemq::core::kernels::ActiveMQXASessionKernel >, decaf::lang::Pointer< activemq::commands::ConsumerInfo >, decaf::lang::Pointer< activemq::commands::ProducerInfo >, decaf::lang::Pointer< cms::Destination >, decaf::lang::Pointer< activemq::commands::SessionInfo >, decaf::lang::Pointer< activemq::core::ActiveMQTransactionContext >, decaf::lang::Pointer< activemq::commands::ConnectionInfo >, decaf::lang::Pointer< activemq::state::TransactionState >, decaf::lang::Pointer< decaf::lang::Runnable >, decaf::lang::Pointer< decaf::lang::Thread >, decaf::lang::Pointer< activemq::commands::Response >, decaf::lang::Pointer< activemq::transport::ResponseCallback >, decaf::lang::Pointer< activemq::transport::Transport >, decaf::lang::Pointer< activemq::threads::CompositeTaskRunner >, decaf::lang::Pointer< activemq::transport::failover::CloseTransportsTask >, decaf::lang::Pointer< activemq::transport::failover::URIPool >, decaf::lang::Pointer< decaf::util::concurrent::locks::Condition >, decaf::lang::Pointer< QueueNode< decaf::lang::Pointer< activemq::transport::Transport > > >, decaf::lang::Pointer< activemq::transport::mock::ResponseBuilder >, decaf::lang::Pointer< activemq::wireformat::WireFormat >, decaf::lang::Pointer< activemq::commands::WireFormatInfo >, decaf::lang::Pointer< decaf::internal::util::ByteArrayAdapter >, decaf::lang::Pointer< decaf::util::Comparator< E > >, decaf::lang::Pointer< decaf::util::Properties >, decaf::lang::Pointer< Array >, decaf::lang::Pointer< FutureTaskSync >, decaf::lang::Pointer< decaf::util::concurrent::Callable< T > >, decaf::lang::Pointer< QueueNode< E > >, and decaf::lang::Pointer< T, REFCOUNTER >.

Public Member Functions

 AtomicRefCounter ()
 
 AtomicRefCounter (const AtomicRefCounter &other)
 
virtual ~AtomicRefCounter ()
 

Protected Member Functions

void swap (AtomicRefCounter &other)
 Swaps this instance's reference counter with the one given, this allows for copy-and-swap semantics of this object.
 
bool release ()
 Removes a reference to the counter Atomically and returns if the counter has reached zero, once the counter hits zero, the internal counter is destroyed and this instance is now considered to be unreferenced.
 

Constructor & Destructor Documentation

◆ AtomicRefCounter() [1/2]

decaf::util::concurrent::atomic::AtomicRefCounter::AtomicRefCounter ( )
inline

Referenced by AtomicRefCounter(), and swap().

◆ AtomicRefCounter() [2/2]

decaf::util::concurrent::atomic::AtomicRefCounter::AtomicRefCounter ( const AtomicRefCounter & other)
inline

◆ ~AtomicRefCounter()

virtual decaf::util::concurrent::atomic::AtomicRefCounter::~AtomicRefCounter ( )
inlinevirtual

Member Function Documentation

◆ release()

bool decaf::util::concurrent::atomic::AtomicRefCounter::release ( )
inlineprotected

Removes a reference to the counter Atomically and returns if the counter has reached zero, once the counter hits zero, the internal counter is destroyed and this instance is now considered to be unreferenced.

Returns
true if the count is now zero.

References decaf::util::concurrent::atomic::AtomicInteger::decrementAndGet().

◆ swap()

void decaf::util::concurrent::atomic::AtomicRefCounter::swap ( AtomicRefCounter & other)
inlineprotected

Swaps this instance's reference counter with the one given, this allows for copy-and-swap semantics of this object.

Parameters
otherThe value to swap with this one's.

References AtomicRefCounter().


The documentation for this class was generated from the following file: