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

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

E-mail: