// $Revision: 1.7 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TPickerModel > Taxonomy Category: | Documented Samples | Stock Browser:Picker > Interface Category: | Sample. > Inherits From: | TModel > Inherited By: | None. > Purpose: | This model contains a collection of stocks, each identified by a unique name. > Instantiation: | Always allocate on the heap. > Deriving Classes: | No special instructions. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::TPickerModel ; | 1. TPickerModel () | 2. TPickerModel (const TPickerModel & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. > Calling Context: | 1. Called by derived classes and to construct an object. | 2. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TPickerModel & source -The 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: TPickerModel::~ TPickerModel ; | virtual ~ TPickerModel () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > 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: TPickerModel::operator =; | TPickerModel & operator =(const TPickerModel & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TPickerModel & 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: TPickerModel::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 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: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::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 the object streams itself in from. > 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: TPickerModel::operator ==; | virtual bool operator ==(const TPickerModel & other) const > Interface Category: | Sample. > Purpose: | Test the equality of two objects. > Calling Context: | Called by a comparator object. > Parameters: = const TPickerModel & other -The object to compare this one to. > Return Value: | A Boolean value of true if this object is equal to another, false if not. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::Hash ; | virtual long Hash () const > Interface Category: | Sample. > Purpose: | Returns a hash value for this object. > Calling Context: | Called by a comparator object. > Parameters: = Takes no parameters. > Return Value: | A long hash value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::CreateSelection ; | virtual TModelSelection * CreateSelection () const > Interface Category: | Sample. > Purpose: | Creates and returns a model selection for this object. > Calling Context: | Call this function directly. > 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: TPickerModel::AdoptStocks ; | virtual void AdoptStocks (TCollectionOf < TStockData > & adoptEach) > Interface Category: | Sample. > Purpose: | Adopts each stock in the given collection. Does not adopt the collection. > Calling Context: | Called by TStandardPickerPresenter::HandleOpen and directly. > Parameters: = TCollectionOf < TStockData > & adoptEach -A collection of stocks. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::AdoptStock ; | virtual void AdoptStock (TStockData * adoptee) > Interface Category: | Sample. > Purpose: | Adopts a stock object, replacing the previous one of the same name (if there was one). > Calling Context: | Called during data exchange. > Parameters: = TStockData * adoptee -The stock 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: TPickerModel::OrphanStock ; | virtual TStockData * OrphanStock (const TStandardText & name) > Interface Category: | Sample. > Purpose: | Releases ownership of the specified stock object. > Calling Context: | Called during data exchange. > Parameters: = const TStandardText & name -The name of the stock to orphan. > Return Value: | A pointer to the orphaned stock object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::CopyNames ; | virtual void CopyNames (TCollectionOf < TStandardText > & fillWithNames) const > Interface Category: | Sample. > Purpose: | Copies the names of the stocks owned by the model. The caller accepts responsibility for the storage of these names. > Calling Context: | Call this function directly. > Parameters: = TCollectionOf < TStandardText > & fillWithNames -The collection to copy stock names into. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::GetStock ; | const TStockData * GetStock (const TStandardText & name) const > Interface Category: | Sample. > Purpose: | Returns a pointer to the stock object specified by the given stock name. > Calling Context: | Called during data exchange and directly. > Parameters: = const TStandardText & name -The name of the desired stock. > Return Value: | A pointer to the stock object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::GetNames ; | virtual void GetNames (TCollectionOf < TStandardText > & fillWithNames) const > Interface Category: | Sample. > Purpose: | Puts pointers to the model's stock name into the collection. > Calling Context: | Call this function directly. > Parameters: = TCollectionOf < TStandardText > & fillWithNames -The collection to put the pointers in. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::GetStockTimeStamp ; | TPseudoTimeStamp GetStockTimeStamp () const > Interface Category: | Sample. > Purpose: | Gets the time stamp for the stocks in the model. This is a TPseudoTimeStamp used to judge how recent the stock data is. > Calling Context: | Called by TStandardPickerPresenter::HandleOpen. > Parameters: = Takes no parameters. > Return Value: | The time stamp of the model's stocks. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerModel::SetStockTimeStamp ; | virtual void SetStockTimeStamp (const TPseudoTimeStamp & timestamp) > Interface Category: | Sample. > Purpose: | Updates the model's stock data time stamp. TStandardPickerPresenter calls this after getting the server's stock time stamp to indicate that the model's data is _as_ _recent_ as the server's data. > Calling Context: | Called by TStandardPickerPresenter::HandleOpen. > Parameters: = const TPseudoTimeStamp & timestamp -The new time stamp. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TPickerSelection > Taxonomy Category: | Documented Samples | Stock Browser:Picker > Interface Category: | Sample. > Inherits From: | TModelSelection, MDataExchanger > Inherited By: | None. > Purpose: | A selection for a TPickerModel object. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | No special instructions. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::TPickerSelection ; | 1. TPickerSelection () | 2. TPickerSelection (const TPickerSelection & source) | 3. TPickerSelection (const TModelReference & theModel) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. | 3. Constructor. > Calling Context: | 1. Called by derived classes and to construct an object. | 2. Called to copy an object. | 3. Called to construct a valid object. > Parameters: = 1. Takes no parameters. = 2. const TPickerSelection & source -The object to copy. = 3. const TModelReference & theModel -The model that this is a selection on. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::~ TPickerSelection ; | virtual ~ TPickerSelection () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > 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: TPickerSelection::operator =; | TPickerSelection & operator =(const TPickerSelection & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TPickerSelection & 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: TPickerSelection::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 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: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::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 the object streams itself in from. > 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: TPickerSelection::DeselectAll ; | virtual void DeselectAll () > Interface Category: | Sample. > Purpose: | Deselects all of the model's stocks. Sets the selection to empty. > Calling Context: | Call this function directly. > 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: TPickerSelection::SelectWholeModel ; | virtual void SelectWholeModel () > Interface Category: | Sample. > Purpose: | Selects all of the model's stocks. > Calling Context: | Call this function directly. > 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: TPickerSelection::CreateAvailableTypesList ; | virtual void CreateAvailableTypesList (TSequenceOf < TTypeDescription > & theTypes) const > Interface Category: | Sample. > Purpose: | Creates and adds to the given collection a TTypeDescription for each type object this selection can export. > Calling Context: | Called during data exchange. > Parameters: = TSequenceOf < TTypeDescription > & theTypes -The collection in which to place TTypeDescription objects. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::ChooseTypes ; | virtual void ChooseTypes (const TSequenceOf < TTypeDescription > & theChoices, TSequenceOf < TTypeDescription > & theChosenTypes) const > Interface Category: | Sample. > Purpose: | Chooses TTypeDescription objects to indicate which objects this selection can deal with. > Calling Context: | Called during data exchange. > Parameters: = const TSequenceOf < TTypeDescription > & theChoices -The available types. = TSequenceOf < TTypeDescription > & theChosenTypes -The types this selection object will deal with. This selection picks from theChoices and adds to theChosenTypes. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::SelectStock ; | virtual void SelectStock (const TStandardText & name) > Interface Category: | Sample. > Purpose: | Adds the given stock to the selection. > Calling Context: | Call this function directly. > Parameters: = const TStandardText & name -The name of the stock to select. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::DeselectStock ; | virtual void DeselectStock (const TStandardText & name) > Interface Category: | Sample. > Purpose: | Removes the given stock from the selection. > Calling Context: | Call this function directly. > Parameters: = const TStandardText & name -The name of the stock to deselect. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::ExtendTo ; | virtual void ExtendTo (const TPickerSelection & other) > Interface Category: | Sample. > Purpose: | Changes this selection to be the union of itself and the other selection. > Calling Context: | Call this function directly. > Parameters: = const TPickerSelection & other -The other selection. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::GetSelectedStocks ; | virtual void GetSelectedStocks (TCollectionOf < TStockData > & fill) const > Interface Category: | Sample. > Purpose: | Puts pointers to each of the selected stock objects into the given collection. > Calling Context: | Call this function directly. > Parameters: = TCollectionOf < TStockData > & fill - The collection to add the selected stocks to. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::GetSelectedNames ; | virtual void GetSelectedNames (TCollectionOf < TStandardText > & fill) const > Interface Category: | Sample. > Purpose: | Puts pointers to the names of each of the selected stock objects into the given collection. > Calling Context: | Call this function directly. > Parameters: = TCollectionOf < TStandardText > & fill - The collection to add the selected stock names to. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::HandleCopyData ; | virtual TModel * HandleCopyData (const TTypeDescription & theType) const > Interface Category: | Sample. > Purpose: | Copies the selected data from the model. > Calling Context: | Called during data exchange. > Parameters: = const TTypeDescription & theType -The type of data to copy from the model. > Return Value: | A 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: TPickerSelection::HandleCopyDataInto ; | virtual void HandleCopyDataInto (TModel & theModel) const > Interface Category: | Sample. > Purpose: | Copies the selected data from the model into another model. > Calling Context: | Called during data exchange. > Parameters: = TModel & theModel -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: TPickerSelection::HandleOrphanData ; | virtual TModel * HandleOrphanData () > Interface Category: | Sample. > Purpose: | Removes the selected data from the model and returns it. > Calling Context: | Called during data exchange. > Parameters: = Takes no parameters. > Return Value: | A model containing the orphaned data. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::HandleReplaceData ; | virtual TModel * HandleReplaceData (TModel * adoptedData) > Interface Category: | Sample. > Purpose: | Replaces the selected data with new data. > Calling Context: | Called during data exchange. > Parameters: = TModel * adoptedData -A model to adopt that contains the new data. > Return Value: | The selected data removed before replacing it with the new data. The old data must be returned in an object of the native model type (in this case, TPickerModel). > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TPickerSelection::CreateEmptyModel ; | virtual TPickerModel * CreateEmptyModel () const > Interface Category: | Sample. > Purpose: | Returns an empty TPickerModel object for use during data exchange. > Calling Context: | Called by HandleCopyData and HandleOrphanData. > Parameters: = Takes no parameters. > Return Value: | A pointer to an empty TPickerModel object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif