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.
- TPolymorphicValueAccessorFor ()
- TPolymorphicValueAccessorFor (const TPolymorphicValueAccessorFor < AValue > & copy)
- TPolymorphicValueAccessorFor (const TValueAccessor & copy)
Interface Category:
API.
Purpose:
- Default constructor. Creates a TPolymorphicValueAccessorFor.
- Copy constructor. Creates a TPolymorphicValueAccessorFor given a TPolymorphicValueAccessorFor.
- Copy constructor. Initializes an instance of this class given a TValueAccessor. No type checking is performed so, caveat emptor.
Calling Context:
- Called by the stream-in operators.
- Called to copy a TPolymorphicValueAccessorFor.
- Called to copy a TPolymorphicValueAccessorFor.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- TPolymorphicValueAccessorFor < AValue > & operator =(const TPolymorphicValueAccessorFor < AValue > & right)
- TPolymorphicValueAccessorFor < AValue > & operator =(const TValueAccessor & right)
Interface Category:
API.
Purpose:
- Returns a dereferenced copy of the TPolymorphicValueAccessorFor.
- Returns a dereferenced copy of the TPolymorphicValueAccessorFor, given a TValueAccessor. No type checking is done.
Calling Context:
- Called to return a dereferenced copy of the TPolymorphicValueAccessorFor.
- 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.
~ 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.
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:
- const AValue & theValue -Specifies the value object to be added.
- bool replaceExistingValue =false -If the replace flag is false and there is a key that is equal to the passed-in key, then returns false. If the replace flag is true and there is a key that is equal to the passed-in key, then replaces the value with the passed-in value. If there is no existing record, then adds the record regardless of the replace flag. The default is set to false.
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(...).
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.