Class: TAbstractDocument

Declaration: BasicDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TDocument TDocumentSurrogate

Purpose:

A document is the container for document state. All Workspace manageable entities are documents.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

TDocument and TDocument Surrogate as the only classes that derive from TAbsractDocument. Do not derive from this class directly.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TAbstractDocument::~TAbstractDocument

virtual ~ TAbstractDocument ()

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: TAbstractDocument::IsLocal

virtual bool IsLocal () const

Interface Category:

API.

Purpose:

Ascertains whether the document is in the same address space as the client.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the actual document is in the same address space; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TAbstractDocument. None.

Member Function: TAbstractDocument::IsWriteable

virtual bool IsWriteable () const

Interface Category:

API.

Purpose:

Ascertains whether the document has been opened for writing.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the document has been opened for writing; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TAbstractDocument. None.

Member Function: TAbstractDocument::IsAnnotatable

virtual bool IsAnnotatable () const

Interface Category:

API.

Purpose:

Ascertains whether the document has been opened for writing or for annotations.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the document has been opened for writing or annotations; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TAbstractDocument. None.

Member Function: TAbstractDocument::GetReference

TDocumentReference GetReference () const

Interface Category:

API.

Purpose:

Generates a document reference that refers to this document or document surrogate.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to this document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::AdoptAndDo

virtual void AdoptAndDo (TCommandBinding *)

Interface Category:

API.

Purpose:

Adopts and executes the simple command binding. If the document is remote, the command is sent to the remote document to execute. The disposition of the binding after executions depends on the derived classes' handling of the command. It might be placed in a history, or just deleted.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TAbstractDocument. None.

Member Function: TAbstractDocument::AddAttribute

void AddAttribute (const TDocumentAttribute & theAttribute)

Interface Category:

API.

Purpose:

Attaches an attribute to a document. This function makes a copy of the attribute and updates the document's attribute set. If an attribute of this type already exists, it is replaced.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::DeleteAttribute

void DeleteAttribute(const TDocumentAttribute& thePatternToMatch);

Interface Category:

API.

Purpose:

Removes an attribute from this document. This function compares the specified pattern to each of the document's attributes and deletes each matching attribute.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::CopyAttribute

TDocumentAttribute * CopyAttribute (const TDocumentAttribute & thePatternToMatch) const

Interface Category:

API.

Purpose:

Copies a document attribute. This function looks for an attribute that matches the pattern and returns the attribute, if found.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a copy of the attribute, or NIL if no match is found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::DeleteAllAttributes

void DeleteAllAttributes ()

Interface Category:

API.

Purpose:

Deletes all attributes that are attached to a document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::CopyAllAttributes

virtual void CopyAllAttributes(TCollectionOf<TDocumentAttribute> &) const

Interface Category:

API.

Purpose:

Gets a snapshot of all the document's attributes. This function returns the attributes in the collection provided by the caller.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::GetName

void GetName(TText &) const

Interface Category:

API.

Purpose:

Gets the name of the document. This function provides easy access to the document attribute that specifies the document's name. You can also retrieve the document's name with CopyAttribute.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::SetName

void SetName(const TText &) const

Interface Category:

API.

Purpose:

Sets the name of the document. This function provides easy access to the document attribute that specifies the document's name. You can also set the document's name with AddAttribute. The document's name is contained in an object of type TDocumentNameAttribute.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::operator==

bool operator ==(const TAbstractDocument &) const

Interface Category:

API.

Purpose:

Tests whether the two objects on either side of the ==symbol are equal. Called to verify whether the two documents and/or document surrogates are equal. The two objects are equal if they both are or refer to the same document.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two objects are equal; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::operator!=

bool operator != (const TAbstractDocument &) const

Interface Category:

API.

Purpose:

Tests whether the two objects on either side of the != symbol are different. Called to verify whether the two documents and/or document surrogates are different. The two objects are not equal if they both are or refer to the same document.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two objects are not equal; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::operator>>=

virtual TStream & operator >>=(TStream & towhere) 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:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash key for use by the collection classes.

Calling Context:

Called directly by any collection class.

Parameters:

Return Value:

Returns the hash key.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocument::TAbstractDocument

  1. TAbstractDocument ()
  2. TAbstractDocument (const TDocumentReference &)
  3. TAbstractDocument (const TAbstractDocument &)

Interface Category:

API

Purpose:

  1. Default constructor.
  2. Creates a new document whose ID matches the one specified by the the document reference.
  3. Copy constructor

Calling Context:

  1. Called by the stream-in operators and derived classes.
  2. Called directly by derived classes.
  3. Called directly by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The constructors for this class are protected.

Member Function: TAbstractDocument::operator=

TAbstractDocument & operator =(const TAbstractDocument & )

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement. Called by derived classes when another document is assigned to this document. The document reference then refers to the same document as the other document.

Parameters:

Return Value:

Returns a const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This operator is protected. Post Conditions: Assertion (document's ID is the same as the other document's ID).
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.