// $Revision: 1.4 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_LONGINTEREST #include "LongInterest.h" #endif MCollectibleDefinitionsMacro(TLongInterest, kOriginalVersion); TLongInterest::TLongInterest(MNotifier* notifier, const TToken& token, long value) : TInterest(notifier, token), fLong(value) { } TLongInterest::TLongInterest(const TLongInterest& source) : TInterest(source), fLong(source.fLong) { } TLongInterest::~TLongInterest() { } TLongInterest& TLongInterest::operator=(const TLongInterest& source) { if (&source != this) { TInterest::operator=(source); fLong = source.fLong; } return *this; } long TLongInterest::GetLong() const { return fLong; } void TLongInterest::SetLong(long value) { fLong = value; } TStream& TLongInterest::operator>>=(TStream& toStream) const { ::WriteVersion(toStream, kOriginalVersion); TInterest::operator>>=(toStream); fLong >>= toStream; return toStream; } TStream& TLongInterest::operator<<=(TStream& fromStream) { ::ReadVersion(fromStream, kOriginalVersion, kOriginalVersion); TInterest::operator<<=(fromStream); fLong <<= fromStream; return fromStream; } long TLongInterest::Hash() const { return fLong; } // TInterest::IsEqual does the type check for us. bool TLongInterest::IsEqual(const MCollectible* other) const { return TInterest::IsEqual(other) && fLong == ((TLongInterest*)other)->fLong; } TLongInterest::TLongInterest() : TInterest() { }