// $Revision: 1.10 $ // RemoteStockData.C // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_REMOTESTOCKDATA #include "RemoteStockData.h" #endif #ifndef TaligentSamples_STOCKCALLER #include "StockCaller.h" #endif //============================================================================== // TRemoteStockData TaligentTypeExtensionMacro(TRemoteStockData); TRemoteStockData::TRemoteStockData() : TStockData(), fCaller(NIL) { } TRemoteStockData::TRemoteStockData(const TRemoteStockData& source) : TStockData(source), fCaller(NIL) { fCaller = ::CopyPointer(source.fCaller.GetObject()); } TRemoteStockData::TRemoteStockData(const TStandardText& name, const TStockCaller& callerToCopy) : TStockData(name), fCaller(NIL) { fCaller = ::Copy(callerToCopy); } TRemoteStockData::~TRemoteStockData() { } TRemoteStockData& TRemoteStockData::operator=(const TRemoteStockData& source) { if (&source != NIL) { TStockData::operator=(source); fCaller = ::CopyPointer(source.fCaller.GetObject()); } return *this; } TStream& TRemoteStockData::operator>>=(TStream& toStream) const { ::WriteVersion(toStream, kOriginalVersion); TStockData::operator>>=(toStream); ::Flatten(fCaller.GetObject(), toStream); return toStream; } TStream& TRemoteStockData::operator<<=(TStream& fromStream) { ::ReadVersion(fromStream, kOriginalVersion, kOriginalVersion); TStockData::operator<<=(fromStream); TStockCaller* caller = NIL; ::Resurrect(caller, fromStream); fCaller = caller; return fromStream; } bool TRemoteStockData::CopyData(TCollectionOf& fill, const TRangeOfDays& range) const { bool success = false; if (fCaller != NIL) { success = fCaller->CopyStockData(GetName(), fill); } return success; }