![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TAbstractDocument
Inherited By:
TCompoundDocument
Purpose:
A document is a CommonPoint Workspace manageable entity. All such entities have some persistent state associated with them. At the minimum, this is their ID and any client can define and attach document attributes. Each document is generally run in a separate document server task.
Most developers will want to use the TCompoundDocument class rather than the TDocument class.
Instantiation:
Allocate on the heap or the stack. Generally a document is allocated on the heap by the document store at the request of the document session.
Deriving Classes:
Do not derive from TDocument.
Specialized documents such as compound document derive from TDocument.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
Invariants:
The name is always valid.
The ID is always globally unique.
IsLocal always returns true for a document.
- TDocument (TDocumentState*)
- TDocument ()
- TDocument ( const TDocument& )
Interface Category:
API.
Purpose:
- Creates a new document using the specified document state.
- Default constructor. For streaming only.
- Copy constructor. For cloning only.
Calling Context:
- Call this function directly. Generally called by the document creator.
- Called by the stream-in operators only. Generally called by the store during the resurrection of the document.
- Called by the cloning operation.
Parameters:
- TDocumentState* -The document state used to manage the document's data.
- Takes no parameters.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
The default and copy constructors are protected.
~ TDocument ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object. Call this function directly, although, generally this is done by the document session object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::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 as the client; false otherwise. TDocument always returns true, because if you can call it, it must be local.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::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:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::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:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::GetAccessMode
TStorageMechanism::EAccessMode GetAccessMode () const
Interface Category:
API.
Purpose:
Returns the associated document store's open access mode.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the associated document store's open access mode.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::CreatePresenter
virtual TDocumentPresenter * CreatePresenter (const TPlaceReference &) const
Interface Category:
API.
Purpose:
Creates a presenter on the document. This function delegates to the document state to allow the state to create the appropriate presenter.
This member function is used by the workspace libraries to open up a presentation on a document in a given place. Developers can override the CreateDocumentPresenter in the TDocumentReference class to provide their special presentation behavior.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the new presenter.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::GetDefaultPageDescription
virtual const TPageDescription * GetDefaultPageDescription () const
Interface Category:
API.
Purpose:
Returns the default page description for this document.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the default page description for this document.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDocument::AdoptAndDo
void AdoptAndDo (TCommandBinding *) const
Interface Category:
API.
Purpose:
Adopts and executes the simple command binding. The binding is deleted after it is executed.
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: TDocument::AdoptDocumentState
virtual void AdoptDocumentState (TDocumentState *)
Interface Category:
API.
Purpose:
Adopts the specified document state. This function deletes the old document state. There is no OrphanDocumentState, all documents must have a document state.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws TDocumentException(kNILDocumentState) if the specified document state is NIL.
Concurrency:
Multithread safe.
Other Considerations:
Preconditions:
Assertion (TDocumentState* != NIL).
Member Function: TDocument::GetDocumentState
- TDocumentState * GetDocumentState ()
- const TDocumentState * GetDocumentState () const
Interface Category:
API.
Purpose:
Returns the document state.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the document state for the document.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
Post Conditions:
Assertion (TDocumentState* != NIL).
Member Function: TDocument::GetNotifier
static MNotifier * GetNotifier ()
Interface Category:
API.
Purpose:
Returns the notifier to be used for notification of any changes to the document contents.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the document's notifier.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
Post Conditions:
Assertion (MNotifier* != NIL).
Member Function: TDocument::operator>>=
virtual TStream & operator >>=(TStream & to) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & to -The stream the object streams itself out to.
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: TDocument::operator<<=
virtual TStream & operator <<= (TStream & from)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & from -The stream the object streams itself in from.
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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.