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: ActiveResultHolder, AsyncChannel, Channel, ConsoleChannel, EventLogChannel, FileChannel, Formatter, FormattingChannel, Logger, Notification, NullChannel, OpcomChannel, PatternFormatter, SimpleFileChannel, SplitterChannel, StreamChannel, SyslogChannel, Task, TaskNotification, TaskCustomNotification, TaskFinishedNotification, TaskFailedNotification, TaskProgressNotification, TaskStartedNotification, TaskCancelledNotification, Poco::Net::SecureServerSocketImpl, Poco::Net::SecureStreamSocketImpl, Poco::Net::DatagramSocketImpl, Poco::Net::StreamSocketImpl, Poco::Net::HTTPServerParams, Poco::Net::ICMPSocketImpl, Poco::Net::RawSocketImpl, Poco::Net::ServerSocketImpl, Poco::Net::SocketImpl, Poco::Net::SocketNotification, Poco::Net::ReadableNotification, Poco::Net::WritableNotification, Poco::Net::ErrorNotification, Poco::Net::TimeoutNotification, Poco::Net::SocketNotifier, Poco::Net::ShutdownNotification, Poco::Net::TCPServerParams, Poco::Util::AbstractConfiguration, Poco::Util::Application, Poco::Util::IniFileConfiguration, Poco::Util::ConfigurationMapper, Poco::Util::ConfigurationView, Poco::Util::FilesystemConfiguration, Poco::Util::LoggingSubsystem, Poco::Util::LayeredConfiguration, Poco::Util::IntValidator, Poco::Util::MapConfiguration, Poco::Util::ServerApplication, Poco::Util::PropertyFileConfiguration, Poco::Util::RegExpValidator, Poco::Util::SystemConfiguration, Poco::Util::Subsystem, Poco::Util::WinRegistryConfiguration, Poco::Util::Validator, Poco::Util::XMLConfiguration

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.