SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWBasicUString::Deallocator Class Referenceabstract

Base class for subclasses that release client-allocated storage. More...

#include <rw/tools/bustring.h>

Inheritance diagram for RWBasicUString::Deallocator:
RWBasicUString::StaticDeallocator

Public Member Functions

virtual ~Deallocator ()
 
void deallocate (RWUChar16 *p)
 
void deallocate (RWUChar16 *p) const
 

Protected Member Functions

 Deallocator ()
 
virtual void doDeallocate (RWUChar16 *p)
 
virtual void doDeallocate (RWUChar16 *p) const =0
 

Detailed Description

Deallocator acts as an abstract base class for subclasses that release client-allocated storage.

Deallocator objects are required because RWBasicUString cannot assume that local invocation of methods such as operator delete[] or std::free() manipulate the same heap as that of the client. Such a case might arise if, for instance, an application contains some libraries that use debug versions of heap management routines while others do not.

A Deallocator subclass must override both doDeallocate() methods to avoid the ambiguities produced should the subclass declaration "hide" one of the superclass declarations of these functions.

Constructor & Destructor Documentation

◆ ~Deallocator()

virtual RWBasicUString::Deallocator::~Deallocator ( )
virtual

Required for virtual destruction.

◆ Deallocator()

RWBasicUString::Deallocator::Deallocator ( )
inlineprotected

Defined only to prevent direct instantiation of this class.

Member Function Documentation

◆ deallocate() [1/2]

void RWBasicUString::Deallocator::deallocate ( RWUChar16 * p)
inline

Forwards a deallocation request to a subclass-defined non-const deallocation method.

◆ deallocate() [2/2]

void RWBasicUString::Deallocator::deallocate ( RWUChar16 * p) const
inline

Forwards a deallocation request to a subclass-defined const deallocation method.

◆ doDeallocate() [1/2]

virtual void RWBasicUString::Deallocator::doDeallocate ( RWUChar16 * p)
protectedvirtual

A virtual function that must be implemented in each subclass. A subclass implementation should take whatever actions are required to deallocate the storage identified by p. The default implementation of this function simply forwards to the const version.

Reimplemented in RWBasicUString::StaticDeallocator.

◆ doDeallocate() [2/2]

virtual void RWBasicUString::Deallocator::doDeallocate ( RWUChar16 * p) const
protectedpure virtual

A pure virtual function that must be implemented in each subclass. A subclass implementation should take whatever actions are required to deallocate the storage identified by p.

Implemented in RWBasicUString::StaticDeallocator.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.