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

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;

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