Advertisement
daniil_mironoff

calculate.hpp

Apr 1st, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1. #if !defined(DATABASE)
  2. #define DATABASE
  3.  
  4. ///////////////////////////////////////////////////////////
  5.  
  6. class num_culc {
  7.     private:
  8.         int32_t value;
  9.         bool init;
  10.  
  11.     public:
  12.         int8_t num_sys;
  13.  
  14. //---------------------------------------------------------
  15.  
  16.         num_culc() : value(0) , num_sys(10), init(false)
  17.             { /* ... */ }
  18.  
  19.         num_culc(int32_t vl, bool in) : value (vl) , num_sys(10), init(in)
  20.             { /* ... */ }
  21.  
  22. //---------------------------------------------------------
  23.  
  24.         num_culc operator+ (num_culc);
  25.         num_culc operator- (num_culc);
  26.         num_culc operator* (num_culc);
  27.         num_culc operator/ (num_culc);
  28.  
  29.         num_culc& operator= (int32_t);
  30.         num_culc& operator= (string);
  31.  
  32.         friend ostream& operator<< (ostream&, const num_culc&);
  33.  
  34.         num_culc& operator[] (int8_t);
  35.  
  36. //---------------------------------------------------------
  37.  
  38. };
  39.  
  40. ///////////////////////////////////////////////////////////
  41.  
  42. class calculate {
  43.     private:
  44.         // Хранит имена переменных и их значения  
  45.         unordered_map<string, num_culc> vars;
  46.  
  47.     public:
  48.         num_culc& operator[] (const string&);
  49. };
  50.  
  51. ///////////////////////////////////////////////////////////s
  52.  
  53. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement