Class: TPolymorphicValueAccessorFor

Declaration: HeteroDiskDictionary.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TValueAccessor

Inherited By:

None.

Purpose:

Like TValueAccessorFor<AValue> but explicitly calls Flatten(AValue,..) and Resurrect(AValue,...).

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

The client must call the SetKey member function of THeterogenousDiskDictionaryOf using the TPolymorphicValueAccessorFor as a parameter, prior to adding or copying using a TPolymorphicValueAccessorFor.

Member Function: TPolymorphicValueAccessorFor::TPolymorphicValueAccessorFor

  1. TPolymorphicValueAccessorFor ()
  2. TPolymorphicValueAccessorFor (const TPolymorphicValueAccessorFor < AValue > & copy)
  3. TPolymorphicValueAccessorFor (const TValueAccessor & copy)

Interface Category:

API.

Purpose:

  1. Default constructor. Creates a TPolymorphicValueAccessorFor.
  2. Copy constructor. Creates a TPolymorphicValueAccessorFor given a TPolymorphicValueAccessorFor.
  3. Copy constructor. Initializes an instance of this class given a TValueAccessor. No type checking is performed so, caveat emptor.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy a TPolymorphicValueAccessorFor.
  3. Called to copy a TPolymorphicValueAccessorFor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicValueAccessorFor::operator=

  1. TPolymorphicValueAccessorFor < AValue > & operator =(const TPolymorphicValueAccessorFor < AValue > & right)
  2. TPolymorphicValueAccessorFor < AValue > & operator =(const TValueAccessor & right)

Interface Category:

API.

Purpose:

  1. Returns a dereferenced copy of the TPolymorphicValueAccessorFor.
  2. Returns a dereferenced copy of the TPolymorphicValueAccessorFor, given a TValueAccessor. No type checking is done.

Calling Context:

  1. Called to return a dereferenced copy of the TPolymorphicValueAccessorFor.
  2. Called to return a dereferenced copy of the TPolymorphicValueAccessorFor given a TValueAccessor. No type checking is done.

Parameters:

Return Value:

Returns a dereferenced copy of the TPolymorphicValueAccessorFor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicValueAccessorFor::~TPolymorphicValueAccessorFor

~ TPolymorphicValueAccessorFor ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicValueAccessorFor::Add

bool Add (const AValue & theValue, bool replaceExistingValue =false) const

Interface Category:

API.

Purpose:

Adds a value to the disk dictionary.

Calling Context:

Called to add a value to the disk dictionary.

Parameters:

Return Value:

Returns true if an add/replace operation is actually performed.

Exceptions:

Throws TDiskDictionaryPermissionsException::kReadOnly if the TDiskDictionaryOf was instantiated ReadOnly. Throws a derived class of TPersistentStorageException if an internal failure occurred. Throws TDiskDictionaryInvalidArgumentsException if SetKey has not been called.

Concurrency:

Not multithread safe.

Other Considerations:

This member function must be used in conjunction with MAccessorHelperFor<AKey>::SetKey(...).

Member Function: TPolymorphicValueAccessorFor::Copy

AValue * Copy () const

Interface Category:

API.

Purpose:

Retrieves a value object from the disk dictionary according to the previously specified key. The returned object is allocated on the same heap as this accessor.

Calling Context:

Called to copy a value object from the disk dictionary.

Parameters:

Return Value:

Returns the value object associated with the key, or NIL if no value is found.

Exceptions:

Throws a derived class of TPersistentStorageException if an internal failure occurred. Throws TDiskDictionaryInvalidArgumentsException if SetKey has not been called.

Concurrency:

Not multithread safe.

Other Considerations:

Use this member function when the associated Add member function was used to store the value. If any other member function was used to add the value, a TInvalidStreamData exception is thrown. The returned object is allocated on the same heap as this accessor. If the value does not exist, this function returns NIL. This member function must be used in conjunction with MAccessorHelperFor<AKey>::SetKey(...).
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.