// $Revision: 1.4 $ // Copyright (C) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_CALCFUNCTORS #define TaligentSamples_CALCFUNCTORS #ifndef TaligentSamples_STANDARDFUNCTORON #include "StandardFunctorOn.h" #endif #ifndef TaligentSamples_RPNCALC #include "RPNCalc.h" #endif //---- TPushFunctor ----------------------------------------------------------- class TPushFunctor : public TStandardFunctorOn { public: TaligentTypeExtensionDeclarationsMacro(TPushFunctor) public: TPushFunctor(long num); TPushFunctor(const TPushFunctor& source); virtual ~TPushFunctor(); TPushFunctor& operator=(const TPushFunctor& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); virtual void operator()(TRPNCalc& calc); private: TPushFunctor(); private: enum {kOriginalVersion}; long fValue; }; //---- TPlusFunctor ----------------------------------------------------------- class TPlusFunctor : public TStandardFunctorOn { public: TaligentTypeExtensionDeclarationsMacro(TPlusFunctor) public: TPlusFunctor(); TPlusFunctor(const TPlusFunctor& source); virtual ~TPlusFunctor(); TPlusFunctor& operator=(const TPlusFunctor& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); virtual void operator()(TRPNCalc& calc); long GetResult() const; private: enum {kOriginalVersion}; long fResult; }; #endif