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

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: 
1.6     ! paf         7:        $Id: pa_vmath.h,v 1.5 2002/02/08 07:27:53 paf Exp $
1.1       parser      8: */
                      9: 
                     10: #ifndef PA_VMATH_H
                     11: #define PA_VMATH_H
                     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.1       parser     29:        Value *get_element(const String& aname) {
1.2       parser     30:                // $CLASS,$method
1.1       parser     31:                if(Value *result=VStateless_class::get_element(aname))
                     32:                        return result;
                     33: 
                     34:                // $const
                     35:                return static_cast<Value *>(fconsts.get(aname));
                     36:        }
                     37: 
                     38: public: // usage
                     39: 
                     40:        VMath(Pool& apool) : VStateless_class(apool, math_base_class),
                     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: