Class: TDocumentSurrogate

Declaration: BasicDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAbstractDocument

Inherited By:

TCompoundDocumentSurrogate

Purpose:

The document surrogate provides a stand-in for the document. Clients of the document surrogate can use it to manipulate the real document regardless as to whether the document is in the same address space or in a remote address space.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derived classes can add interfaces specific to a derived class of TDocumentState. All member functions should be implemented as TDocumentFunctors, allowing both remote and local access.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TDocumentSurrogate::TDocumentSurrogate

  1. TDocumentSurrogate (const TDocumentSurrogate &) ;
  2. TDocumentSurrogate (const TDocumentReference &, TStore::EAccessMode aMode =TStore::kReadWrite, TDocumentStore::ESharingMode sMode =TDocumentStore::kNonShared ) ;
  3. TDocumentSurrogate ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Creates a surrogate to stand in for the document referred to by the document reference.
  3. Default constructor. For streaming only.

Calling Context:

  1. Called to copy an object. Call this function directly.
  2. Call this function directly.
  3. Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException(kStoreDoesNotExist) if the store for the document does not exist. Throws TDocumentException(kConnectToDocumentFailed) if the attempt to connect to a remote document fails.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentSurrogate::~TDocumentSurrogate

virtual ~ TDocumentSurrogate ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentSurrogate::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.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentSurrogate::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: TDocumentSurrogate::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: TDocumentSurrogate::AdoptAndDo

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 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: TDocumentSurrogate::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:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentSurrogate::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:

Multithread safe.

Other Considerations:

None.

Member Function: TDocumentSurrogate::operator=

TDocumentSurrogate & operator =(const TDocumentSurrogate &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

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

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.