//////////////////////////////////////////////////////////////////////////////// /*! @file PhysMath.h Expression interpreter with physvalues. - Part of RANet - Research Assistant Net Library. - Copyright(C) 2014, Viktor E. Bursian, St.Petersburg, Russia. Viktor.Bursian@mail.ioffe.ru */////////////////////////////////////////////////////////////////////////////// #ifndef PhysMath_H #define PhysMath_H #include "BasicMath.h" #include "PhysValue.h" namespace RA { //------------------------------------------------------------------------------ ANNOUNCE_CLASS(sPhysMath) //---------------------------------------------------------------- sPhysMath --- /*! Performs calculation of an expression with integers, reals and physvalues. */ class RANet_EXPORT sPhysMath : public sMath { public://static static void AddConstant (rcsPhysValue value ,rcsString identifier); public: sPhysMath (rcsString source) :sMath(source) {} protected: virtual psMathValue Constant (rcsString identifier ,int start_pos ) const; virtual psMathValue Value (); virtual psMathValue Call (rcsString identifier ,int start_pos ,psMathValue arg1 ) const; virtual psMathValue Call (rcsString identifier ,int start_pos ,psMathValue arg1 ,psMathValue arg2 ) const; virtual psMathValue Call (rcsString identifier ,int start_pos ,psMathValue arg1 ,psMathValue arg2 ,psMathValue arg3 ) const; virtual psMathValue Call (rcsString identifier ,int start_pos ,psMathValue arg1 ,psMathValue arg2 ,psMathValue arg3 ,psMathValue arg4 ) const; private: //types class sMathOpRegistrator { public: sMathOpRegistrator(); }; private: //static field static sMathOpRegistrator MathOpRegistrator; private: static psMathValue UnaryMinusPhysValue (pcsMathValue); static psMathValue PhysValuePlusPhysValue (pcsMathValue,pcsMathValue); static psMathValue PhysValueMinusPhysValue (pcsMathValue,pcsMathValue); static psMathValue PhysValueMultPhysValue (pcsMathValue,pcsMathValue); static psMathValue PhysValueDivPhysValue (pcsMathValue,pcsMathValue); static psMathValue PhysValuePowerInteger (pcsMathValue,pcsMathValue); static psMathValue sin (pcsMathValue); static psMathValue cos (pcsMathValue); static psMathValue tg (pcsMathValue); static psMathValue ctg (pcsMathValue); static psMathValue seven (); }; //------------------------------------------------------------------------------ } //namespace RA #endif