Class: TViewCore

Declaration: ViewCore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TViewRootCore

Purpose:

The TViewCore class allows a view to obtain information about its parent. Normally, the View system does not allow a view to hold a reference to its parent in a hierarchy. However, there is some information that a view needs to acquire from its parent, such as the device on which the view's hierarchy is displayed. To enable a view to obtain information from its parent, every view holds a view core object. A view core object is the instance of the TViewCore class. This view core object holds a reference to the parent view. The TViewCore object provides a limited interface that allows a view to obtain reliable information from its parent, without providing a direct reference to the parent. When a view requires information from the parent, it calls the appropriate TViewCore member function. The TViewCore object obtains the information using private member functions. This hides the parent reference from the child view. TViewCore is defined as a mechanism for upward-directed requests. It avoids concurrency cycles with TView, which points downward. All TViewCore member functions that can be called have an external and an internal version. The internal version has the same name as the external one, with the prefix Internal. The external member function takes care of the locking issues, and it calls the corresponding internal member function, which actually executes the operation. When there are corresponding internal and external member functions, the internal functions are pure virtual functions. TViewCore is responsible for the data, but the data itself is stored in the TView derived class

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

The TViewCore class defines a standard system-internal protocol that is common to all views. Deriving classes may specify their own particular behavior and state to maintain, but the protocol remains constant. Derived classes that override TViewCore internal member functions should always keep in mind the direction of information flow, which is from the custom TView downwards, then across to TViewCore, and up from there. A TViewCore member function should not directly access custom TView information.

Concurrency:

Multithread safe.

Resource Use:

All the TViewCore member functions that can be called have an external and internal version. Objects call the external versions of these member functions, as they handle locking for the referenced TViewCore object. The external versions then call the corresponding internal versions. However, the internal versions should not be called directly, as this would bypass the locking safety mechanisms. In addition, a TViewCore object must never call an external member function from within an internal member function. This risks a deadlock situation.

Member Function: TViewCore::TViewCore

TViewCore ()

Interface Category:

API.

Purpose:

Default constructor.

Calling Context:

Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TViewCore::~TViewCore

virtual ~ TViewCore ()

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: TViewCore::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: TViewCore::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 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.