Poco

class RefCountedObject

Library: Foundation
Package: Core
Header: Poco/RefCountedObject.h

Description

A base class for objects that employ reference counting based garbage collection.

Reference-counted objects inhibit construction by copying and assignment.

Inheritance

Known Derived Classes: Poco::ActiveRecord::ActiveRecordBase, Poco::ActiveRecord::Context, Poco::Crypto::ECKeyImpl, Poco::Crypto::EVPCipherImpl, Poco::Crypto::CipherKeyImpl, Poco::Crypto::CipherImpl, Poco::ActiveRecord::ActiveRecord, Poco::Crypto::Cipher, Poco::ActiveRecord::KeylessActiveRecord, Poco::Crypto::KeyPairImpl, Poco::Crypto::RSACipherImpl, Poco::Crypto::RSAKeyImpl, Poco::Data::AbstractSessionImpl, Poco::Data::PooledSessionImpl, Poco::Data::PooledSessionHolder, Poco::Data::RowFilter, Poco::Data::SQLChannel, Poco::Data::SQLChannel::LogNotification, Poco::Data::SessionImpl, Poco::Data::SessionPool, ActiveResultHolder, ActiveRunnableBase, ActiveRunnable, AsyncChannel, Channel, ConsoleChannel, ColorConsoleChannel, EventChannel, EventLogChannel, FileChannel, Formatter, FormattingChannel, Logger, Notification, NullChannel, PatternFormatter, SimpleFileChannel, SplitterChannel, StreamChannel, SyslogChannel, Task, TaskNotification, TaskStartedNotification, TaskCancelledNotification, TaskFinishedNotification, TaskFailedNotification, TaskProgressNotification, TaskCustomNotification, WindowsConsoleChannel, WindowsColorConsoleChannel, Poco::Net::DatagramSocketImpl, Poco::Net::HTTPServerParams, Poco::Net::ICMPSocketImpl, Poco::Net::Impl::IPAddressImpl, Poco::Net::Impl::IPv4AddressImpl, Poco::Net::Impl::IPv6AddressImpl, Poco::Net::RemoteSyslogChannel, Poco::Net::RawSocketImpl, Poco::Net::RemoteSyslogListener, Poco::Net::SMTPChannel, Poco::Net::ServerSocketImpl, Poco::Net::Impl::SocketAddressImpl, Poco::Net::Impl::IPv4SocketAddressImpl, Poco::Net::Impl::IPv6SocketAddressImpl, Poco::Net::Impl::LocalSocketAddressImpl, Poco::Net::SocketImpl, Poco::Net::ReadableNotification, Poco::Net::SocketNotification, Poco::Net::SocketNotifier, Poco::Net::WritableNotification, Poco::Net::ErrorNotification, Poco::Net::TimeoutNotification, Poco::Net::IdleNotification, Poco::Net::ShutdownNotification, Poco::Net::SocketProactor::IONotification, Poco::Net::StreamSocketImpl, Poco::Net::TCPServerConnectionFilter, Poco::Net::TCPServerParams, Poco::Net::sizeof, Poco::Net::WebSocketImpl, Poco::Net::Context, Poco::Net::SecureServerSocketImpl, Poco::Net::SecureStreamSocketImpl, Poco::Net::Session, Poco::Util::AbstractConfiguration, Poco::Util::Application, Poco::Util::ConfigurationMapper, Poco::Util::ConfigurationView, Poco::Util::FilesystemConfiguration, Poco::Util::IniFileConfiguration, Poco::Util::IntValidator, Poco::Util::JSONConfiguration, Poco::Util::LayeredConfiguration, Poco::Util::LocalConfigurationView, Poco::Util::LoggingSubsystem, Poco::Util::MapConfiguration, Poco::Util::PropertyFileConfiguration, Poco::Util::ServerApplication, Poco::Util::RegExpValidator, Poco::Util::Subsystem, Poco::Util::SystemConfiguration, Poco::Util::TimerTask, Poco::Util::TimerTaskAdapter, Poco::Util::TimerFunc, Poco::Util::Validator, Poco::Util::WinRegistryConfiguration, Poco::Util::XMLConfiguration, Poco::Zip::Add, Poco::Zip::Delete, Poco::Zip::Keep, Poco::Zip::Rename, Poco::Zip::Replace, Poco::Zip::ZipOperation

Member Summary

Member Functions: duplicate, referenceCount, release

Constructors

RefCountedObject

RefCountedObject();

Creates the RefCountedObject. The initial reference count is one.

Destructor

~RefCountedObject protected virtual

virtual ~RefCountedObject();

Destroys the RefCountedObject.

Member Functions

duplicate inline

void duplicate() const;

Increments the object's reference count.

referenceCount inline

int referenceCount() const;

Returns the reference count.

release inline

void release() const noexcept;

Decrements the object's reference count and deletes the object if the count reaches zero.