Annotation of parser3/src/types/pa_vstateless_object.h, revision 1.8

1.5       paf         1: /** @file
1.8     ! paf         2:        Parser: @b stateless_object class decl.
1.5       paf         3: 
1.1       paf         4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.5       paf         5: 
1.1       paf         6:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
                      7: 
1.8     ! paf         8:        $Id: pa_vstateless_object.h,v 1.7 2001/03/19 22:38:11 paf Exp $
1.1       paf         9: */
                     10: 
                     11: #ifndef PA_VSTATELESS_OBJECT_H
                     12: #define PA_VSTATELESS_OBJECT_H
                     13: 
                     14: #include "pa_valiased.h"
                     15: #include "pa_vjunction.h"
                     16: #include "pa_vclass.h"
                     17: 
1.6       paf        18: /**    the object of some class. 
1.5       paf        19:        
1.6       paf        20:        "of some class" means "with some set of methods".
1.5       paf        21: */
1.1       paf        22: class VStateless_object : public VAliased {
                     23: public: // Value
                     24:        
1.4       paf        25:        /// VStateless_object: fclass_real
                     26:        VStateless_class *get_class() { return &fclass_real; }
                     27: 
1.7       paf        28:        /// VStateless_object: +$method
1.1       paf        29:        Value *get_element(const String& name) {
1.7       paf        30:                // $CLASS, $BASE
                     31:                if(Value *result=VAliased::get_element(name))
                     32:                        return result;
1.1       paf        33:                // $method=junction(self+class+method)
                     34:                if(Junction *junction=fclass_real.get_junction(*this, name))
1.3       paf        35:                        return NEW VJunction(*junction);
1.1       paf        36:                return 0;
                     37:        }
                     38: 
                     39: public: // creation
                     40: 
1.2       paf        41:        VStateless_object(Pool& apool, VStateless_class& aclass_real) : 
                     42:                VAliased(apool, aclass_real), 
                     43: 
1.1       paf        44:                fclass_real(aclass_real) {
                     45:        }
                     46: 
                     47: private:
                     48: 
1.2       paf        49:        VStateless_class& fclass_real;
1.1       paf        50: };
                     51: 
                     52: #endif

E-mail: