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::Crypto::Cipher, Poco::Crypto::CipherImpl, Poco::Crypto::CipherKeyImpl, Poco::Crypto::RSACipherImpl, Poco::Crypto::RSAKeyImpl, Poco::Data::MySQL::MySQLStatementImpl, Poco::Data::ODBC::ODBCStatementImpl, Poco::Data::ODBC::Preparation, Poco::Data::SQLite::SQLiteStatementImpl, Poco::Data::AbstractBinding, Poco::Data::AbstractExtraction, Poco::Data::AbstractPreparation, Poco::Data::Binding, Poco::Data::AbstractSessionImpl, Poco::Data::Extraction, Poco::Data::PooledSessionHolder, Poco::Data::PooledSessionImpl, Poco::Data::SessionImpl, Poco::Data::StatementImpl, ActiveRunnableBase, ActiveResultHolder, ActiveRunnable, AsyncChannel, Channel, ConsoleChannel, EventLogChannel, FileChannel, Formatter, FormattingChannel, Logger, Notification, OpcomChannel, NullChannel, PatternFormatter, SimpleFileChannel, TaskStartedNotification, SplitterChannel, StreamChannel, Task, SyslogChannel, TaskFailedNotification, TaskProgressNotification, TaskCustomNotification, TaskNotification, TaskFinishedNotification, TaskCancelledNotification, WindowsConsoleChannel, Poco::Net::SecureServerSocketImpl, Poco::Net::SecureStreamSocketImpl, Poco::Net::DatagramSocketImpl, Poco::Net::HTTPServerParams, Poco::Net::ICMPSocketImpl, Poco::Net::SocketImpl, Poco::Net::RemoteSyslogChannel, Poco::Net::RawSocketImpl, Poco::Net::RemoteSyslogListener, Poco::Net::ServerSocketImpl, Poco::Net::ErrorNotification, Poco::Net::TimeoutNotification, Poco::Net::IdleNotification, Poco::Net::ShutdownNotification, Poco::Net::SocketNotification, Poco::Net::WritableNotification, Poco::Net::ReadableNotification, Poco::Net::SocketNotifier, Poco::Net::StreamSocketImpl, Poco::Net::TCPServerParams, Poco::Netconf::ConfigurationServiceRemoteObject, Poco::Netconf::ConfigurationServiceSkeleton, Poco::Netconf::ConfigurationServiceProxy, Poco::Netconf::IConfigurationService, Poco::OSP::Web::MediaTypeMapper, Poco::OSP::Web::WebServerDispatcher, Poco::OSP::Web::WebServerExtensionPoint, Poco::OSP::Web::WebSessionService, Poco::OSP::Bundle, Poco::OSP::Auth::AuthService, Poco::OSP::BundleContextFactory, Poco::OSP::BundleContext, Poco::OSP::BundleDirectory, Poco::OSP::BundleFactory, Poco::OSP::BundleFile, Poco::OSP::BundleInstallerService, Poco::OSP::BundleManifest, Poco::OSP::BundleStorage, Poco::OSP::ExtensionPointService, Poco::OSP::QLOrExpr, Poco::OSP::ExtensionPoint, Poco::OSP::Configuration, Poco::OSP::OSPSubsystem, Poco::OSP::Preferences, Poco::OSP::PreferencesService, Poco::OSP::QLExpr, Poco::OSP::QLAndExpr, Poco::OSP::QLNotExpr, Poco::OSP::QLExistsExpr, Poco::OSP::QLRelExpr, Poco::OSP::QLEqExpr, Poco::OSP::QLNeExpr, Poco::OSP::QLLtExpr, Poco::OSP::QLLeExpr, Poco::OSP::QLGtExpr, Poco::OSP::QLGeExpr, Poco::OSP::QLMatchExpr, Poco::OSP::QLMatchRegExpr, Poco::OSP::Service, Poco::OSP::ServiceRef, Poco::OSP::ServiceFactory, Poco::Remoting::Identifiable, Poco::Remoting::Proxy, Poco::Remoting::RemoteObject, Poco::Remoting::Skeleton, Poco::Util::ConfigurationMapper, Poco::Util::Application, Poco::Util::AbstractConfiguration, Poco::Util::FilesystemConfiguration, Poco::Util::ConfigurationView, Poco::Util::IniFileConfiguration, Poco::Util::IntValidator, Poco::Util::MapConfiguration, Poco::Util::LayeredConfiguration, Poco::Util::LoggingSubsystem, Poco::Util::PropertyFileConfiguration, Poco::Util::XMLConfiguration, Poco::Util::RegExpValidator, Poco::Util::ServerApplication, Poco::Util::Subsystem, Poco::Util::SystemConfiguration, Poco::Util::WinRegistryConfiguration, Poco::Util::Validator, Poco::Zip::Add, Poco::Zip::Delete, Poco::Zip::Keep, Poco::Zip::Replace, Poco::Zip::Rename, 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

void duplicate() const;

Increments the object's reference count.

referenceCount inline

int referenceCount() const;

Returns the reference count.

release

void release() const;

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