Class: TStorageBin

Declaration: BasicDocumentStorage.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TCommandLogBin TModelBin TModelMetaDataBin TPresenterStateBin TDocumentBin TDocumentMetaDataBin

Purpose:

TStorageBin provides an abstraction to identify a storage bin for the purpose of creating, deleting, opening, and closing it.

Instantiation:

Always allocate on the stack.

Deriving Classes:

There are predefined bins for document, document attribute, command log, presenter state, and model. Additional bins can be defined by deriving from TStorageBin. The bins would be required as arguments of TMultiBinStorageMechanism functions to create/delete/open/close a storage bin.

Concurrency:

Not multithread safe.

Resource Use:

TStorageBin manages its own resources.

Invariants:

Assertion (fName != kNullText). Assertion (fStorageMechanism != NIL).

Member Function: TStorageBin::TStorageBin

TStorageBin (const TText &, TMultiBinStorageMechanism *, EBinType type =kData)

Interface Category:

API.

Purpose:

Creates a storage bin with the specified name, storage mechanism, and type.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TStorageBin is an abstract base class--all the constructors are protected. Do not instantiate this class.

Member Function: TStorageBin::~TStorageBin

virtual ~ TStorageBin ()

Interface Category:

API.

Purpose:

Destructor. This function closes the bin if it's open.

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: TStorageBin::GetNameAsText

const TText* GetNameAsText () const

Interface Category:

API.

Purpose:

Retrieves the textual name of the bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the textual name of the bin.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStorageBin::Create

void Create ()

Interface Category:

API.

Purpose:

Creates an underlying physical storage implementation of the storage bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreBinAlreadyExists.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation of the storage mechanism exists). Assertion (an underlying physical storage implementation of the named storage bin does not exist). Postconditions: Assertion (an underlying physical storage implementation of the named storage bin exists).

Member Function: TStorageBin::Delete

void Delete ()

Interface Category:

API.

Purpose:

Deletes an underlying physical storage implementation of the storage bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreBinDoesNotExist.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation of the storage mechanism exists). Assertion (an underlying physical storage implementation of the named storage bin exists). Postconditions: Assertion (an underlying physical storage implementation of the named storage bin no longer exists).

Member Function: TStorageBin::DoesExist

bool DoesExist () const

Interface Category:

API.

Purpose:

Checks whether or not an underlying physical storage implementation of the named storage bin exists.

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:

Not multithread safe.

Other Considerations:

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

Member Function: TStorageBin::Close

void Close ()

Interface Category:

API.

Purpose:

Closes a random-access stream on the named storage bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kDocumentStoreBinDoesNotExist.

Concurrency:

Not multithread safe.

Other Considerations:

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

Member Function: TStorageBin::IsOpened

bool IsOpened () const

Interface Category:

API.

Purpose:

Returns open state of bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the storage bin is open; false otherwise.

Exceptions:

Throws no exceptions. Passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStorageBin::GetAccessMode

EAccessMode GetAccessMode() const

Interface Category:

API.

Purpose:

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

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the access mode.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStorageBin::GetBinType

EBinType GetBinType() const

Interface Category:

API.

Purpose:

Returns the type of the bin. This value is not meaningful unless the bin is opened.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the bin type.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TStorageBin::Open

TRandomAccessStream * Open (EAccessMode)

Interface Category:

API.

Purpose:

Opens a random-access stream on the named storage bin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the random-access stream for accessing the storage bin.

Exceptions:

Throws TDocumentException::kDocumentStoreBinAccessDenied.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (an underlying physical storage implementation of the storage mechanism exists). Assertion (an underlying physical storage implementation of the named storage bin exists). Postconditions: Assertion (named storage bin is opened with specified access mode).
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.