Class: THeterogenousDiskDictionaryOf

Declaration: HeteroDiskDictionary.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MAccessorHelperFor

Inherited By:

None.

Purpose:

A THeterogenousDiskDictionaryOf is used for the storage of objects on the disk. It works like a TDiskDictionaryOf. You can have arbitrary keys and arbitrary values. Objects that are placed in disk dictionaries should specify how hashing and comparison will be done via a comparator. When using a THeterogenousDiskDictionaryOf, clients must use a TKeyValueAccessorFor<AKey,AValue> or a TValueAccessorFor<AValue> to store and retrieve values

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

When using a THeterogenousDiskDictionaryOf, clients must use a TKeyValueAccessorFor<AKey,AValue> or a TValueAccessorFor<AValue> to store and retrieve values.

Member Function: THeterogenousDiskDictionaryOf::~THeterogenousDiskDictionaryOf

~ THeterogenousDiskDictionaryOf ()

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

  1. THeterogenousDiskDictionaryOf (const TDirectory & theDirectory, const TText & theDictionaryName, TComparator < AKey > * adoptedComparator, TStreamer < AKey > * adoptedKeyStreamer)
  2. THeterogenousDiskDictionaryOf (const TDirectory & theDirectory, const TText & theDictionaryName, EOpenPermissions permissions =kReadWrite)

Interface Category:

API.

Purpose:

  1. Creation Constructor. Creates a new THeterogenousDiskDictionaryOf, creating and opening the associated disk files.
  2. Open Constructor. Creates a new THeterogenousDiskDictionaryOf, opening the associated disk files.

Calling Context:

  1. Called at construction to create and open the associated disk files.
  2. Called at construction to open the associated disk files.

Parameters:

Return Value:

None.

Exceptions:

Throws TRecordManagerStoreDoesNotExistException::kDoesNotExist if a recordfile could not be found in theDirectory and you were trying to open it. Throws TRecordManagerStoreAlreadyExistsException::kAlreadyExists if a recordfile already existed in theDirectory, when you wanted to create it. Throws TRecordManagerPermissionsException::kWrongPermissions if a recordfile is being accessed with an invalid permission. Throws TStandardRecordManagerException if an internal error occurred. Throws TDiskDictionaryInvalidArgumentsException::kInvalidArguments if bad parameters were used in the constructor. Throws TDiskDictionaryInvalidArgumentsException::kTypeMismatchForKeyOrValue if the open constructor detects a type mismatch for the key or value. Throws TStandardDiskDictionaryException if an internal error occurs.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THeterogenousDiskDictionaryOf::Member

bool Member (const AKey & key) const

Interface Category:

API.

Purpose:

Checks if a key is in the disk dictionary.

Calling Context:

Called to check if a key is in the disk dictionary.

Parameters:

Return Value:

Returns true if the specified key exists in the dictionary.

Exceptions:

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

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THeterogenousDiskDictionaryOf::CopyKey

AKey * CopyKey (const AKey & key) const

Interface Category:

API.

Purpose:

Retrieves a key object from the disk dictionary according to the specified key.

Calling Context:

Called to retrieve a key object from the disk dictionary.

Parameters:

Return Value:

Returns the stored key object if the specified key is in the disk dictionary.

Exceptions:

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

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THeterogenousDiskDictionaryOf::Remove

bool Remove (const AKey & key)

Interface Category:

API.

Purpose:

Removes an object from the disk dictionary.

Calling Context:

Called to remove an object from the disk dictionary.

Parameters:

Return Value:

Returns true if the key and value objects were actually in the disk dictionary.

Exceptions:

Throws TDiskDictionaryPermissionsException::kReadOnly if the TDiskDictionaryOf was instantiated ReadOnly. Throws TPersistentStoreInvalidArgumentsException if the parameter is bad. Throws a derived class of TPersistentStorageException if an internal failure occurred.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THeterogenousDiskDictionaryOf::Count

unsigned long Count () const

Interface Category:

API.

Purpose:

Obtains the number of records that are in the disk dictionary.

Calling Context:

Called to get the number of records that are stored in the disk dictionary.

Parameters:

Return Value:

Returns the number of records that are in the disk dictionary.

Exceptions:

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

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THeterogenousDiskDictionaryOf::SetDestroyFileOnDelete

void SetDestroyFileOnDelete (bool doIt =false)

Interface Category:

API.

Purpose:

Specifies if the THeterogenousDiskDictionaryOf should remove all associated disk files and stored objects after it is no longer used in the current task.

Calling Context:

Called to determine if the THeterogenousDiskDictionaryOf should remove all associated disk files and stored objects after it is no longer used in the current task.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

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.