Annotation of parser3/src/types/pa_vmath.h, revision 1.10

1.1       parser      1: /** @file
                      2:        Parser: @b math class decls.
                      3: 
1.5       paf         4:        Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
1.6       paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       parser      6: */
                      7: 
                      8: #ifndef PA_VMATH_H
                      9: #define PA_VMATH_H
1.8       paf        10: 
1.10    ! paf        11: static const char* IDENT_VMATH_H="$Date: 2002/08/01 11:41:24 $";
1.1       parser     12: 
                     13: #include "classes.h"
                     14: #include "pa_common.h"
                     15: 
                     16: extern Methoded *math_base_class;
                     17: extern Hash *math_consts;
                     18: 
                     19: class Request;
                     20: 
                     21: /**
                     22: */
                     23: class VMath : public VStateless_class {
                     24: public: // Value
                     25:        
                     26:        const char *type() const { return "math"; }
                     27: 
1.2       parser     28:        // math: CLASS,method,field
1.10    ! paf        29:        Value *get_element(const String& aname, Value *aself) {
1.2       parser     30:                // $CLASS,$method
1.10    ! paf        31:                if(Value *result=VStateless_class::get_element(aname, aself))
1.1       parser     32:                        return result;
                     33: 
                     34:                // $const
                     35:                return static_cast<Value *>(fconsts.get(aname));
                     36:        }
                     37: 
                     38: public: // usage
                     39: 
1.7       paf        40:        VMath(Pool& apool) : VStateless_class(apool, 0, math_base_class),
1.1       parser     41:                fconsts(*math_consts) {
                     42:        }
                     43: 
                     44:        Hash& consts() { return fconsts; }
                     45: 
                     46: private:
                     47: 
                     48:        Hash& fconsts;
                     49: 
                     50: };
                     51: 
                     52: #endif

E-mail: