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.
~ 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.
- THeterogenousDiskDictionaryOf (const TDirectory & theDirectory, const TText & theDictionaryName, TComparator < AKey > * adoptedComparator, TStreamer < AKey > * adoptedKeyStreamer)
- THeterogenousDiskDictionaryOf (const TDirectory & theDirectory, const TText & theDictionaryName, EOpenPermissions permissions =kReadWrite)
Interface Category:
API.
Purpose:
- Creation Constructor. Creates a new THeterogenousDiskDictionaryOf, creating and opening the associated disk files.
- Open Constructor. Creates a new THeterogenousDiskDictionaryOf, opening the associated disk files.
Calling Context:
- Called at construction to create and open the associated disk files.
- Called at construction to open the associated disk files.
Parameters:
- const TDirectory & theDirectory -Specifies the TDirectory in which to locate the theDictionaryName.
- const TText & theDictionaryName -Specifies the TText that contains the name of the file to locate in theDirectory.
- TComparator < AKey > * adoptedComparator -Specifies an object that can perform comparison operations with the key object.
- TStreamer < AKey > * adoptedKeyStreamer -Specifies an object that can perform streaming operations with the key object.
- const TDirectory & theDirectory -Specifies the TDirectory in which to locate the theDictionaryName.
- const TText & theDictionaryName -Specifies the TText that contains the name of the file to locate in theDirectory.
- EOpenPermissions permissions =kReadWrite -Specifies the TDiskDictionaryOf's opening permission. The default is read/write access.
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.
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:
- const AKey & key -Specifies the key to be checked for existence.
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.
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:
- const AKey & key -Specifies the key of the record to be retrieved.
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.
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:
- const AKey & key -Specifies the key of the object to be removed.
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.
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.
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:
- bool doIt =false -If the doIt flag is set to true, the disk dictionary removes all stored value objects when the destructor is called; otherwise it does not. The default is set to false.
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.