Class: TMonomorphicKeyValueAccessorFor

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: TMonomorphicKeyValueAccessorFor::TMonomorphicKeyValueAccessorFor

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

Interface Category:

API.

Purpose:

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

Calling Context:

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

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMonomorphicKeyValueAccessorFor::operator=

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

Interface Category:

API.

Purpose:

Returns a dereferenced copy of the TMonomorphicKeyValueAccessorFor.

Calling Context:

Called to return a dereferenced copy of the TMonomorphicKeyValueAccessorFor.

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: TMonomorphicKeyValueAccessorFor::~TMonomorphicKeyValueAccessorFor

~ TMonomorphicKeyValueAccessorFor ()

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

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

Interface Category:

API.

Purpose:

Adds objects by calling the object's operator >>=.

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: TMonomorphicKeyValueAccessorFor::Copy

AValue * Copy (const AKey & theKey) const

Interface Category:

API.

Purpose:

Retrieves 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 retrieve 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.

Member Function: TMonomorphicKeyValueAccessorFor::Retrieve

bool Retrieve (const AKey & theKey, AValue & fillinValue) const

Interface Category:

API.

Purpose:

Retrieves a value from the disk dictionary into a preallocated value object.

Calling Context:

Called to retrieve a value from the disk dictionary into a preallocated value object.

Parameters:

Return Value:

Returns true if the value does exist and will call fillinValue <<=.

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.