Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.3.0)

E80355-01

FinalizableBlock Class Reference

#include <coherence/lang/FinalizableBlock.hpp>

Inherited by SynchronizedMemberReadBlock.

List of all members.


Detailed Description

A finalizable block which runs a series of chained Finalizers as part of its destruction.

FinalizableBlocks are useful for cases where a series of finalization routines need to be run from a nested function calls. For non-nested finalization the use of a FinalizableBlock is unnecessary, and a disposable or local class should be used.

Public Member Functions

void pushFinalizer (Finalizer *pFinalizer)
 Push a custom finalizer onto the FinalizableBlock's finalization stack.

Protected Member Functions

 FinalizableBlock (FinalizableBlock *pDelegate=NULL)
 Construct a FinalizableBlock object.
 FinalizableBlock (const FinalizableBlock &that)
 Copy constructor.
 ~FinalizableBlock ()
 Destroy a FinalizableBlock object.
bool isTerminal () const
 Return true if the FinalizableBlock is not delegating to another FinalizableBlock.
void initialize (FinalizableBlock *pDelegate=NULL)
 Initialize a FinalizableBlock object.

Classes

class  Finalizer
 Interface for custom automatic cleanup operations. More...


Constructor & Destructor Documentation

FinalizableBlock ( FinalizableBlock pDelegate = NULL  )  [inline, protected]

Construct a FinalizableBlock object.

Parameters:
pDelegate FinalizableBlock to delegate to, or NULL for no delegate

FinalizableBlock ( const FinalizableBlock that  )  [inline, protected]

Copy constructor.

The new block takes over the ownership of the finalization, the supplied block is invalidated, and is not longer usable.

Parameters:
that the source block
See also:
COH_FINALIZABLE

~FinalizableBlock (  )  [inline, protected]

Destroy a FinalizableBlock object.

In the case of delegating blocks the destructor has no effect, otherwise the finalizer stack is popped, until until all finalizers have been deleted.


Member Function Documentation

void pushFinalizer ( Finalizer pFinalizer  )  [inline]

Push a custom finalizer onto the FinalizableBlock's finalization stack.

If the FinalizableBlock was constructed with a delegate, then the finalizer is pushed on the delegates finalizer stack.

The finalizer will then be owned by the FinalizableBlock and will be automatically deleted with the top-most FinalizableBlock is destroyed.

Parameters:
pFinalizer finalizer to add to the finalization stack

bool isTerminal (  )  const [inline, protected]

Return true if the FinalizableBlock is not delegating to another FinalizableBlock.

Returns:
return true if the FinalizableBlock is not delegating to another FinalizableBlock

void initialize ( FinalizableBlock pDelegate = NULL  )  [inline, protected]

Initialize a FinalizableBlock object.

A block may be re-initialized so long as it has not been assigned a delegate, and has no finalization stack.

Parameters:
pDelegate FinalizableBlock to delegate to, or NULL for no delegate


The documentation for this class was generated from the following file:
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.