// $Revision: 1.4 $ //------------------------------------------------------------------------------ // // Copyright (C) 1995 Taligent, Inc. All rights reserved. // // Project: StockBrowser // File: StockCaller.h // Build/Version: 1.0.0 // // Description: TStockCaller is derived from MRemoteCaller and is the "sender" // in any remote procedure call involving the Stock Server. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_STOCKCALLER #define TaligentSamples_STOCKCALLER class TStockCaller; #ifndef TaligentSamples_STOCKDATABASE #include "StockDatabase.h" #endif #ifndef Taligent_REMOTECALLER #include #endif #ifndef Taligent_MESSAGESTREAMSTRANSPORT #include #endif #ifndef Taligent_SERVICEACCESS #include #endif class TStockDay; class TLocalServiceReference; class TNetworkServiceReference; class TNetworkName; //============================================================================== // TStockCaller class TStockCaller : public TStockDatabase, public MRemoteCaller { public: TaligentTypeExtensionDeclarationsMacro(TStockCaller) public: // CreateLocalServiceReference creates a local reference to the service // provided by this dispatcher. Since MRemoteCallers have knowledge of the // type of dispatcher they connect to, it is not unreasonable to have the // dispatcher return an appropriate service reference. static TLocalServiceReference* CreateLocalServiceReference(); // CreateNetworkServiceReference creates a network reference to the service // provided by this dispatcher. Since MRemoteCallers have knowledge of the // type of dispatcher they connect to, it is not unreasonable to have the // dispatcher return an appropriate service reference. static TNetworkServiceReference* CreateNetworkServiceReference( const TNetworkName& netName); TStockCaller(TServiceReference* adoptedReference); TStockCaller(const TStockCaller& source); virtual ~TStockCaller(); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); //.......................................................................... // MStockDatabase overrides virtual void CopyAvailableNames(TCollectionOf& collectionToFill); virtual void CopyAllStocks(TCollectionOf& collectionToFill); virtual TStockData* CopyStock(const TStandardText& stockName); virtual bool CopyStockData(const TStandardText& stockName, TCollectionOf& collectionToFill, const TRangeOfDays& range = TRangeOfDays::kAllDays); virtual TPseudoTimeStamp GetTimeStamp(); protected: TStockCaller(); private: void Init(TServiceReference* adopted); TStockCaller& operator=(const TStockCaller& source); enum {kOriginalVersion}; TDeleterFor fServiceReference; TDeleterFor fTransport; MRemoteCallerDeclarationsMacro(TStockDispatcher) }; #endif