// $Revision: 1.3 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | MAtomicModelOn > Taxonomy Category: | Enablers:Atomic Model > Interface Category: | Sample Code. > Purpose: | Serves an abstract base class for model objects that hold one, atomic piece of data. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | Override all the pure virtual functions. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::~ MAtomicModelOn ; | virtual ~ MAtomicModelOn () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::GetValueForReading ; | virtual const AType * GetValueForReading () const > Interface Category: | Sample. > Purpose: | Pure virtual function. Provides read-only access to this object's value. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A const pointer to this object's value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::GetValueForWriting ; | virtual AType * GetValueForWriting () > Interface Category: | Sample. > Purpose: | Pure virtual function. Provides read-write access to this object's value. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A non-const pointer to this object's value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::SetValue ; | virtual void SetValue (const AType & newValue) > Interface Category: | Sample. > Purpose: | Pure virtual function. Adopts a copy of the new value object passed in, deleting this object's old value. > Calling Context: | Called at any time. > Parameters: = const AType & newValue -The new value object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::CopyValue ; | virtual AType * CopyValue () const > Interface Category: | Sample. > Purpose: | Pure virtual function. Returns a copy of this object's value object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a new copy of the value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::AdoptValue ; | virtual void AdoptValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Pure virtual function. Deletes the old value object and adopts a new one. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the new value object to adopt. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::SwapValue ; | virtual AType * SwapValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Pure virtual function. Orphans this object's value and adopts a new one. Returns the orphaned value object. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the new value object to adopt. > Return Value: | A pointer to this object's old, orphaned value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::SwapContents ; | virtual void SwapContents (MAtomicModelOn < AType > & other) > Interface Category: | Sample. > Purpose: | Pure virtual function. Trades value objects with the source object. > Calling Context: | Called at any time. > Parameters: = MAtomicModelOn < AType > & other -The source object to trade value objects with. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::CreateAtomicSelectionOn ; | virtual MAtomicSelectionOn < AType > * CreateAtomicSelectionOn () const > Interface Category: | Sample. > Purpose: | Pure virtual function. Creates a selection object specifying this object's value (a whole-model selection). > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a new atomic selection object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::NotifyValueChanged ; | virtual void NotifyValueChanged () > Interface Category: | Sample. > Purpose: | Pure virtual function. Sends a notification that this object's value changed. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::LookupForReading ; | static const MAtomicModelOn < AType > * LookupForReading (const TModelReference & model) > Interface Category: | Sample. > Purpose: | Looks up, and returns a read-only pointer to, the specified model. > Calling Context: | Called at any time. > Parameters: = const TModelReference & model -A reference to the model to look up. > Return Value: | A const pointer to the specified model. > Exceptions: | Throws TCompoundDocumentException::kModelDoesNotExist if the model lookup failed. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::LookupForWriting ; | static MAtomicModelOn < AType > * LookupForWriting (const TModelReference & model) > Interface Category: | Sample. > Purpose: | Looks up, and returns a read-write pointer to, the specified model. > Calling Context: | Called at any time. > Parameters: = const TModelReference & model -A reference to the model to look up. > Return Value: | A non-const pointer to the specified model. > Exceptions: | Throws TCompoundDocumentException::kModelDoesNotExist if the model lookup failed. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicModelOn::MAtomicModelOn ; | MAtomicModelOn () > Interface Category: | Sample. > Purpose: | Default constructor. > Calling Context: | Called by derived classes. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | MAtomicSelectionOn > Taxonomy Category: | Enablers:Atomic Model > Interface Category: | Sample Code. > Purpose: | Serves as abstract base class for selection objects that specify the entire value object owned by an atomic model object. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | Override all the pure virtual functions. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::~ MAtomicSelectionOn ; | virtual ~ MAtomicSelectionOn () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::GetAtomicModelOnForReading ; | virtual const MAtomicModelOn < AType > * GetAtomicModelOnForReading () const > Interface Category: | Sample. > Purpose: | Pure virtual function. Provides read-only access to the model. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A const pointer to the model. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::GetAtomicModelOnForWriting ; | virtual MAtomicModelOn < AType > * GetAtomicModelOnForWriting () > Interface Category: | Sample. > Purpose: | Pure virtual function. Provides read-write access to the model. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A non-const pointer to the model. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::GetValueForReading ; | virtual const AType * GetValueForReading () const > Interface Category: | Sample. > Purpose: | Provides read-only access to the model's value object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A const pointer to the model's value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::GetValueForWriting ; | virtual AType * GetValueForWriting () > Interface Category: | Sample. > Purpose: | Provides read-write access to the model's value object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A non-const pointer to the model's value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::SetValue ; | virtual void SetValue (const AType & newValue) > Interface Category: | Sample. > Purpose: | Calls the model's SetValue function, passing in newValue. See MAtomicModelOn::SetValue. > Calling Context: | Called at any time. > Parameters: = const AType & newValue -The new value object to set. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::CopyValue ; | virtual AType * CopyValue () const > Interface Category: | Sample. > Purpose: | Calls the model's CopyValue, returning the result. See MAtomicModelOn::CopyValue. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a copy of the model's value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::AdoptValue ; | virtual void AdoptValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Calls the model's AdoptValue function, passing in adoptedNewValue. See MAtomicModelOn::AdoptValue. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the value object for the model to adopt. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::SwapValue ; | virtual AType * SwapValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Calls the model's SwapValue function, passing in adoptedNewValue. See MAtomicModelOn::SwapValue. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the value object for the model to adopt. > Return Value: | A pointer to the model's old, orphaned value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::SwapContents ; | virtual void SwapContents (MAtomicModelOn < AType > & other) > Interface Category: | Sample. > Purpose: | Calls the model's SwapContents function, passing in other. See MAtomicModelOn::SwapContents. > Calling Context: | Called at any time. > Parameters: = MAtomicModelOn < AType > & other -The source atomic model object to swap values with. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls CheckValueSelected, which throws an exception if the selection is empty or undefined. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::MAtomicSelectionOn ; | MAtomicSelectionOn () > Interface Category: | Sample. > Purpose: | Default constructor. > Calling Context: | Called by derived classes. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: MAtomicSelectionOn::CheckValueSelected ; | void CheckValueSelected () const > Interface Category: | Sample. > Purpose: | Makes certain that the selection is defined and not empty. Throws an exception if those conditions aren't met. > Calling Context: | Called internally by MAtomicSelectionOn and can be called by derived classes. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws TAtomicModelException::kNoValueSelected if the selection is empty or undefined. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TAtomicModelOn > Taxonomy Category: | Enablers:Atomic Model > Interface Category: | Sample Code. > Purpose: | Concrete model class derived from MAtomicModelOn and TModel. Wraps a model around a value object of any type. > Instantiation: | Always allocate on the heap. > Deriving Classes: | No instructions. It should not be necessary to derive from this class. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::LookupForReading ; | static const TAtomicModelOn < AType > * LookupForReading (const TModelReference & model) > Interface Category: | Sample. > Purpose: | Standard static model lookup function. Looks up, and provides read-only access to, the specified model. > Calling Context: | Called at any time. > Parameters: = const TModelReference & model -A reference to the model to look up. > Return Value: | A const pointer to the specified model. > Exceptions: | Throws TCompoundDocumentException::kModelDoesNotExist if the lookup fails. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::LookupForWriting ; | static TAtomicModelOn < AType > * LookupForWriting (const TModelReference & model) > Interface Category: | Sample. > Purpose: | Standard static model lookup function. Looks up, and provides read-write access to, the specified model. > Calling Context: | Called at any time. > Parameters: = const TModelReference & model -A reference to the model to look up. > Return Value: | A non-const pointer to the specified model. > Exceptions: | Throws TCompoundDocumentException::kModelDoesNotExist if the lookup fails. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::TAtomicModelOn ; | 1. TAtomicModelOn (AType * adopt) | 2. TAtomicModelOn (const AType & copy) | 3. TAtomicModelOn (const TAtomicModelOn < AType > & source) | 4. TAtomicModelOn () > Interface Category: | Sample. > Purpose: | 1. Constructor that adopts a value. | 2. Constructor that copies a value. | 3. Copy constructor. | 4. Default constructor. > Calling Context: | 1. Called to construct a valid atomic model object. | 2. Called to construct a valid atomic model object. | 3. Called to copy an object. | 4. Called by derived classes and to construct an object. > Parameters: = 1. AType * adopt -A pointer to the value object to adopt. = 2. const AType & copy -A pointer to the value object to copy. = 3. const TAtomicModelOn < AType > & source -A reference to the atomic model object to copy. = 4. Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | The value must not be NIL. An assertion failure will occur on a NIL value. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::~ TAtomicModelOn ; | virtual ~ TAtomicModelOn () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::operator =; | TAtomicModelOn < AType > & operator =(const TAtomicModelOn < AType > & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TAtomicModelOn < AType > & source -The object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -The stream. > 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. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -The stream. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::CreateSelection ; | virtual TModelSelection * CreateSelection () const > Interface Category: | Sample. > Purpose: | Creates an atomic model selection object specifying this model's entire value object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a new selection object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::ContentHash ; | virtual HashResult ContentHash () const > Interface Category: | Sample. > Purpose: | Returns the value object's hash value. The value object must have a Hash function. > Calling Context: | Called by the Document framework. > Parameters: = Takes no parameters. > Return Value: | A hash value for this model's value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::IsContentEqual ; | virtual bool IsContentEqual (const TModel & other) const > Interface Category: | Sample. > Purpose: | Compares two atomic model objects' values for equality. > Calling Context: | Called by the Document framework. > Parameters: = const TModel & other -The atomic model object containing the value to compare this object's value with. > Return Value: | A boolean value of true if the values are equal, false if they're not. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::IsOrphanable ; | virtual bool IsOrphanable () const > Interface Category: | Sample. > Purpose: | Returns false to advertise that the value cannot be removed from this model object. It must be swapped or replaced. > Calling Context: | Called by the Document framework and can be called at any time. > Parameters: = Takes no parameters. > Return Value: | False. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::GetValueForReading ; | virtual const AType * GetValueForReading () const > Interface Category: | Sample. > Purpose: | Provides read-only access to this object's value. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A const pointer to this object's value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::GetValueForWriting ; | virtual AType * GetValueForWriting () > Interface Category: | Sample. > Purpose: | Provides read-write access to this object's value. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A non-const pointer to this object's value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::SetValue ; | virtual void SetValue (const AType & newValue) > Interface Category: | Sample. > Purpose: | Adopts a copy of the new value object passed in, deleting this object's old value. > Calling Context: | Called at any time. > Parameters: = const AType & newValue -The new value object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Indirectly calls SwapValue, which asserts that the new value != NIL. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::CopyValue ; | virtual AType * CopyValue () const > Interface Category: | Sample. > Purpose: | Returns a copy of this object's value object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a new copy of the value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::AdoptValue ; | virtual void AdoptValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Deletes the old value object and adopts a new one. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the new value object to adopt. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls SwapValue, which asserts that the new value != NIL. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::SwapValue ; | virtual AType * SwapValue (AType * adoptedNewValue) > Interface Category: | Sample. > Purpose: | Orphans this object's value and adopts a new one. Returns the orphaned value object. > Calling Context: | Called at any time. > Parameters: = AType * adoptedNewValue -A pointer to the new value object to adopt. > Return Value: | A pointer to this object's old, orphaned value object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Asserts that the new value != NIL. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::SwapContents ; | virtual void SwapContents (MAtomicModelOn < AType > & other) > Interface Category: | Sample. > Purpose: | Trades value objects with the source object. > Calling Context: | Called at any time. > Parameters: = MAtomicModelOn < AType > & other -The source object to trade value objects with. > Return Value: | None. > Exceptions: | Throws TAtomicModelException::kCannotStoreNIL on an attempt to set a NIL value. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Calls SwapValue, which asserts that the new value != NIL. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::CreateAtomicSelectionOn ; | virtual MAtomicSelectionOn < AType > * CreateAtomicSelectionOn () const > Interface Category: | Sample. > Purpose: | Creates a selection object specifying this object's value (a whole-model selection). > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | A pointer to a new atomic selection object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelOn::NotifyValueChanged ; | void NotifyValueChanged () > Interface Category: | Sample. > Purpose: | Sends a notification that this object's value changed. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TAtomicSelectionOn > Taxonomy Category: | Enablers:Atomic Model > Interface Category: | Sample Code. > Purpose: | A whole-model selection for an atomic model on a value object of any type. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | No instructions. It should not be necessary to derive from this class. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::TAtomicSelectionOn ; | 1. TAtomicSelectionOn (const TModelReference & theModel) | 2. TAtomicSelectionOn (const TAtomicSelectionOn < AType > & other) | 3. TAtomicSelectionOn () > Interface Category: | Sample. > Purpose: | 1. Constructor. | 2. Copy constructor. | 3. Default constructor. > Calling Context: | 1. Called to construct a valid object. | 2. Called to copy an object. | 3. Called by derived classes and to construct an object. > Parameters: = 1. const TModelReference & theModel -A reference to the model for which this is a selection. = 2. const TAtomicSelectionOn < AType > & other -The object to copy. = 3. Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::~ TAtomicSelectionOn ; | virtual ~ TAtomicSelectionOn () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::operator =; | TAtomicSelectionOn < AType > & operator =(const TAtomicSelectionOn < AType > & other) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TAtomicSelectionOn < AType > & other -The object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::GetAtomicModelOnForReading ; | virtual const MAtomicModelOn < AType > * GetAtomicModelOnForReading () const > Interface Category: | Sample. > Purpose: | Returns a read-only pointer to the selected model. > Calling Context: | Called at any time and by this object. > Parameters: = Takes no parameters. > Return Value: | A const pointer to the selected model. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::GetAtomicModelOnForWriting ; | virtual MAtomicModelOn < AType > * GetAtomicModelOnForWriting () > Interface Category: | Sample. > Purpose: | Returns a read-write pointer to the selected model. > Calling Context: | Called at any time and by this object. > Parameters: = Takes no parameters. > Return Value: | A non-const pointer to the selected model. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::HandleCopyData ; | virtual TModel * HandleCopyData (const TTypeDescription & type) const > Interface Category: | Sample. > Purpose: | Copies data of the specified type from the selected model. See MDataExchanger::HandleCopyData. > Calling Context: | Called by the Document framework. > Parameters: = const TTypeDescription & type -The desired type of data. > Return Value: | A pointer to a new model containing the copied data. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::HandleCopyDataInto ; | virtual void HandleCopyDataInto (TModel & otherModel) const > Interface Category: | Sample. > Purpose: | Copies the selected data into another model. See MDataExchanger::HandleCopyDataInto. > Calling Context: | Called by the Document framework. > Parameters: = TModel & otherModel -The model to copy data into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::HandleReplaceData ; | virtual TModel * HandleReplaceData (TModel * adoptedNewData) > Interface Category: | Sample. > Purpose: | Replaces the selected model's value with new data. See MDataExchanger::HandleReplaceData. > Calling Context: | Called by the Document framework. > Parameters: = TModel * adoptedNewData -The data with which to replace the selected data. > Return Value: | A pointer to the orphaned model containing the previous data. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicSelectionOn::HandleOrphanData ; | virtual TModel * HandleOrphanData () > Interface Category: | Sample. > Purpose: | Throws an exception, because data cannot be orphaned from an atomic model. See MDataExchanger::HandleOrphanData for a description of what would normally happen in this function. > Calling Context: | Called by the Document framework. > Parameters: = Takes no parameters. > Return Value: | N/A. This function throws an exception. See MDataExchanger::HandleOrphanData for a description of what would normally happen in this function. > Exceptions: | Throws TAtomicModelException::kCannotOrphanData. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TAtomicModelException > Taxonomy Category: | Enablers:Atomic Model > Interface Category: | Sample Code. > Purpose: | Represents the errors that can be generated by Atomic Model classes. > Instantiation: | Always allocate on the stack. > Deriving Classes: | No instructions. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Enumeration: | TAtomicModelException :: ErrorCode > Taxonomy Category: | Enablers:Atomic Model. > Interface Category: | Sample. > Purpose: | Defines the error codes that can be generated by Atomic Model classes. > Tags: = kCannotStoreNIL -Atomic models must represent a constructed object of a certain type. NIL has no type and therefore cannot be represented. = kCannotOrphanData -See kCannotStoreNIL. Removing data would result in an atomic model representing nothing. = kNoValueSelected -A selection on an atomic model must specify the entire value object. There is no concept of an insertion point for atomic models. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelException::TAtomicModelException ; | 1. TAtomicModelException (const TAtomicModelException & source) | 2. TAtomicModelException (ErrorCode error) | 3. TAtomicModelException () > Interface Category: | Sample. > Purpose: | 1. Copy constructor. | 2. Constructor. | 3. Default constructor. > Calling Context: | 1. Called to copy an object. | 2. Called to construct a valid object. | 3. Called by derived classes and to construct an object. > Parameters: = 1. const TAtomicModelException & source -The object to copy. = 2. ErrorCode error -The error code generated. = 3. Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelException::~ TAtomicModelException ; | virtual ~ TAtomicModelException () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | N/A. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelException::operator =; | TAtomicModelException & operator =(const TAtomicModelException & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TAtomicModelException & source -The object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelException::Throw ; | virtual void Throw () const > Interface Category: | Sample. > Purpose: | Throws this object. See TStandardException::Throw. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws this object. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAtomicModelException::GetReason ; | ErrorCode GetReason () const > Interface Category: | Sample. > Purpose: | Returns the error code associated with this exception object. > Calling Context: | Called at any time. > Parameters: = Takes no parameters. > Return Value: | An error code indicating why the exception was thrown. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif