Class: TStandardStorageMechanism

Declaration: BasicDocumentStorage.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMultiBinStorageMechanism

Inherited By:

None.

Purpose:

TStandardStorageMechanism is a TMultiBinStorageMechanism derived class which uses Pluto file system entities to maintain the data. Each storage bin may correspond to a Pluto file. The collection of storage bins within a storage mechanism corresponds to a Pluto directory.

Instantiation:

A standard storage mechanism should be allocated on the heap and given to its associated store in the constructor of the store.

Deriving Classes:

Do not derive from TStandardStorageMechanism.

Concurrency:

Multithread safe. Concurrency among threads within a team is provided by the shared hidden master. Concurrency between teams is provided by by Pluto file system entities. In both cases, the semantics of multiple readers, or single writer will be enforced.

Resource Use:

TStandardStorageMechanism is responsible for managing its resources.

Invariants:

Assertion (fHandle != NIL).

Member Function: TStandardStorageMechanism::TStandardStorageMechanism

  1. TStandardStorageMechanism (const TDirectory & parent, const TFileSystemEntityName & name)
  2. TStandardStorageMechanism (const TStandardStorageMechanism &)

Interface Category:

API.

Purpose:

  1. Creates a storage mechanism instance with the specified parent and name.
  2. Copy constructor.

Calling Context:

  1. Called to create a storage mechanism instance.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::~TStandardStorageMechanism

virtual ~ TStandardStorageMechanism ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::GetAccessMode

virtual EAccessMode GetAccessMode() const

Interface Category:

API.

Purpose:

Returns the open access mode. This value is not meaningful unless the mechanism is opened.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the access mode.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::Create

virtual void Create ()

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreAlreadyExists if the store already exists.

Concurrency:

Multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation does not exist). Postconditions: Assertion (an underlying physical storage implementation exists).

Member Function: TStandardStorageMechanism::CreateIn

virtual void CreateIn (TStorageMechanism & parent)

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TMultiBinStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::CopyInto

virtual TMultiBinStorageMechanism * CopyInto (TStorageMechanism & parent)

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TMultiBinStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the copy.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::MoveInto

virtual void MoveInto (TStorageMechanism & parent)

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TMultiBinStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::Delete

virtual void Delete ()

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreDoesNotExist.

Concurrency:

Multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation exists). Postconditions: Assertion (an underlying physical storage implementation no longer exists).

Member Function: TStandardStorageMechanism::DoesExist

virtual bool DoesExist () const

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if an underlying physical storage implementation exists; false otherwise

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::Open

virtual void Open (EAccessMode)

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreAccessDenied.

Concurrency:

Multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation exists). Postconditions: Assertion (storage mechanism is opened with specified access mode).

Member Function: TStandardStorageMechanism::Close

virtual void Close ()

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreDoesNotExist.

Concurrency:

Multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation exists). Postconditions: Assertion (storage mechanism is closed).

Member Function: TStandardStorageMechanism::CanBitWiseCopy

virtual bool CanBitWiseCopy ()

Interface Category:

API.

Purpose:

Provides concrete implementation of inherited TStorageMechanism function.

Calling Context:

Called to check whether or not a store supports bit-wise copying.

Parameters:

Return Value:

Returns true if a storage mechanism supports bit-wise copying; false otherwise.

Exceptions:

Throws TDocumentException::kDocumentStoreDoesNotExist.

Concurrency:

Multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation exists).

Member Function: TStandardStorageMechanism::AddAttribute

virtual void AddAttribute (const TDocumentAttribute & theAttribute)

Interface Category:

API.

Purpose:

Adds the attribute to the storage mechanism's attribute list replacing a matching attribute if one exists.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Postconditions: Assertion (CopyAttribute(const TDocumentAttribute) != NIL).

Member Function: TStandardStorageMechanism::DeleteAttribute

virtual void DeleteAttribute (const TDocumentAttribute & thePatternToMatch)

Interface Category:

API.

Purpose:

Deletes the attribute from the storage mechanism's attribute list if it exists.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Postconditions: Assertion (CopyDocumentAttribute(const TDocumentReference&, const TDocumentAttribute) ==NIL).

Member Function: TStandardStorageMechanism::CopyAttribute

virtual TDocumentAttribute * CopyAttribute (const TDocumentAttribute & thePatternToMatch) const

Interface Category:

API.

Purpose:

Copies a specific attribute from the storage mechanism if it exists.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the copied attribute or NIL if attribute did not exist for specified document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::DeleteAllAttributes

virtual void DeleteAllAttributes ()

Interface Category:

API.

Purpose:

Deletes all the attributes for the storage mechanism.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Postconditions: Assertion (CopyAttribute(TDocumentAttribute&) ==NIL) for all attributes.

Member Function: TStandardStorageMechanism::CopyAllAttributes

virtual void CopyAllAttributes (TCollectionOf<TDocumentAttribute> &) const

Interface Category:

API.

Purpose:

Copies all the attributes for the storage mechanism.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Overrides inherited MCollectible function to return hash value.

Calling Context:

Called by collection classes.

Parameters:

Return Value:

Returns hash value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::operator=

TStandardStorageMechanism & operator =(const TStandardStorageMechanism &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::GetDirectory

TDirectory GetDirectory () const

Interface Category:

API.

Purpose:

Returns the storage mechanism's directory. The directory is established during construction.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the storage mechanism's directory.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::GetParent

TDirectory GetParent () const

Interface Category:

API.

Purpose:

Returns the storage mechanism's parent. The parent is set during construction.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the storage mechanism's parent.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::GetName

void GetName (TFileSystemEntityName &) const

Interface Category:

API.

Purpose:

Gets the storage mechanism's name. The name is set during construction.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::IsOpened

virtual bool IsOpened () const

Interface Category:

API.

Purpose:

Checks whether the storage mechanism is opened.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the mechanism is opened; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardStorageMechanism::DoesExistIn

virtual bool DoesExistIn (const TStorageMechanism & parent) const

Interface Category:

API.

Purpose:

Determines whether or not this storage mechanism exists in the specified parent.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if this storage mechanism exists in the specified parent; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Precondition: Assertion( GetStorageMechanism() != NIL ). Assertion( parent.GetStorageMechanism() != NIL ).

Member Function: TStandardStorageMechanism::IsEqual

virtual bool IsEqual (const MCollectible *) const

Interface Category:

API.

Purpose:

Tests two objects for equality. Overrides inherited MCollectible function.

Calling Context:

Called by collection classes.

Parameters:

Return Value:

Returns true if the objects are equal; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.