Class: TPolymorphicKeyValueAccessorFor

Declaration: HeteroDiskDictionary.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TValueAccessor

Inherited By:

None.

Purpose:

A value accessor that is aware of the key type.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TPolymorphicKeyValueAccessorFor::TPolymorphicKeyValueAccessorFor

  1. TPolymorphicKeyValueAccessorFor (const MAccessorHelperFor < AKey > & helper)
  2. TPolymorphicKeyValueAccessorFor (const TPolymorphicKeyValueAccessorFor < AKey, AValue >& copy)

Interface Category:

API.

Purpose:

  1. Constructor. Creates a TPolymorphicKeyValueAccessorFor given a MAccessorHelperFor<AKey > (for example, THeterogenousDiskDictionaryOf<AKey>).
  2. Copy constructor. Creates a TPolymorphicKeyValueAccessorFor given a TPolymorphicKeyValueAccessorFor.

Calling Context:

  1. Called at construction to create an accessor for adding and retrieving values from a THeterogenousDiskDictionaryOf.
  2. Called to copy a TPolymorphicKeyValueAccessorFor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicKeyValueAccessorFor::operator=

TPolymorphicKeyValueAccessorFor < AKey , AValue >& operator =(const TPolymorphicKeyValueAccessorFor < AKey, AValue >& right)

Interface Category:

API.

Purpose:

Returns a dereferenced copy of the TPolymorphicKeyValueAccessorFor.

Calling Context:

Called to return a dereferenced copy of the TPolymorphicKeyValueAccessorFor.

Parameters:

Return Value:

Returns a dereferenced copy of the TMonomorphicKeyValueAccessorFor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicKeyValueAccessorFor::~TPolymorphicKeyValueAccessorFor

~ TPolymorphicKeyValueAccessorFor ()

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: TPolymorphicKeyValueAccessorFor::Add

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

Interface Category:

API.

Purpose:

Adds objects by calling Flatten(AValue,...).

Calling Context:

Called to add a key-value pair 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.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPolymorphicKeyValueAccessorFor::Copy

AValue * Copy (const AKey & theKey) const

Interface Category:

API.

Purpose:

Copies a value object from the disk dictionary according to the specified key. Use this function when the Add function was used to store the value. If any other function was used to add the value, a TInvalidStreamData exception is thrown. 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 this key, or NIL if no value is found.

Exceptions:

Throws a derived class of TPersistentStorageException if an internal failure occurred.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.