Fennel: ClosableObject Class Reference (original) (raw)

ClosableObject is a common base for all classes which require a close() method to be called before destruction (e.g. More...

#include <[ClosableObject.h](ClosableObject%5F8h-source.html)>

Inheritance diagram for ClosableObject:

List of all members.

Public Member Functions
virtual ~ClosableObject ()
Destructor.
bool isClosed () const
**Returns:**whether the object has been closed
void close ()
Closes this object, releasing any unallocated resources.
Protected Member Functions
virtual void closeImpl ()=0
Must be implemented by derived class to release any resources.
ClosableObject ()
Protected Attributes
bool needsClose

Detailed Description

ClosableObject is a common base for all classes which require a close() method to be called before destruction (e.g.

to avoid the error of calling virtual methods from a base class destructor). Deriving from ClosableObject makes it easier to instantiate a shared_ptr which takes care of automatic close on destruction (see ClosableObjectDestructor).

Definition at line 36 of file ClosableObject.h.


Constructor & Destructor Documentation

| ClosableObject::ClosableObject | ( | | ) | [explicit, protected] | | ------------------------------ | - | | - | ----------------------- |

| ClosableObject::~ClosableObject | ( | | ) | [virtual] | | -------------------------------- | - | | - | ----------- |

Destructor.

An assertion violation will result if the object has not yet been closed.

Definition at line 34 of file ClosableObject.cpp.

References needsClose.


Member Function Documentation

| virtual void ClosableObject::closeImpl | ( | | ) | [protected, pure virtual] | | -------------------------------------- | - | | - | --------------------------- |

Must be implemented by derived class to release any resources.

Implemented in CacheImpl< PageT, VictimPolicyT >, ByteArrayInputStream, ByteArrayOutputStream, ByteOutputStream, CheckpointThread, Database, BarrierExecStream, DoubleBufferExecStream, ExecStream, ExecStreamGraphImpl, MockResourceExecStream, ReshapeExecStream, ScratchBufferExecStream, SegBufferExecStream, SegBufferReader, SegBufferReaderExecStream, SegBufferWriter, SegBufferWriterExecStream, JavaSinkExecStream, JavaTransformExecStream, FlatFileBuffer, FlatFileExecStreamImpl, BTreeExecStream, BTreeInsertExecStream, BTreePrefetchSearchExecStream, BTreeReadExecStream, BTreeSearchExecStream, FtrsTableWriterExecStream, LhxAggExecStream, LhxJoinExecStream, LbmBitOpExecStream, LbmChopperExecStream, LbmGeneratorExecStream, LbmIntersectExecStream, LbmMinusExecStream, LbmSplicerExecStream, LbmUnionExecStream, LcsClusterAppendExecStream, LcsRowScanBaseExecStream, LcsRowScanExecStream, DelegatingSegment, DynamicDelegatingSegment, ScratchSegment, SegInputStream, Segment, SegOutputStream, SegPageBackupRestoreDevice, SegStream, SegStreamAllocation, SpillOutputStream, and ExternalSortExecStreamImpl.

Referenced by close().

| bool ClosableObject::isClosed | ( | | ) | const [inline] | | ----------------------------- | - | | - | ---------------- |

Returns:

whether the object has been closed

Definition at line 58 of file ClosableObject.h.

| void ClosableObject::close | ( | | ) | | -------------------------- | - | | - |

Closes this object, releasing any unallocated resources.

Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.

Definition at line 39 of file ClosableObject.cpp.

References closeImpl(), and needsClose.

Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().


Member Data Documentation


The documentation for this class was generated from the following files:


Generated on Mon Jun 22 04:00:28 2009 for Fennel by doxygen 1.5.1