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

1.1     ! paf         1: /*
        !             2:        Parser
        !             3:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
        !             4:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
        !             5: 
        !             6:        $Id: pa_vobject.h,v 1.2 2001/03/11 08:16:38 paf Exp $
        !             7: */
        !             8: 
        !             9: #ifndef PA_VSTATELESS_OBJECT_H
        !            10: #define PA_VSTATELESS_OBJECT_H
        !            11: 
        !            12: #include "pa_valiased.h"
        !            13: #include "pa_vjunction.h"
        !            14: #include "pa_vclass.h"
        !            15: 
        !            16: class VStateless_object : public VAliased {
        !            17: public: // Value
        !            18:        
        !            19:        // object_base: (CLASS)=vclass;(BASE)=base;(method)=method_ref
        !            20:        Value *get_element(const String& name) {
        !            21:                // $CLASS=my class
        !            22:                if(name==CLASS_NAME)
        !            23:                        return fclass_alias;
        !            24:                // $BASE=my parent
        !            25:                if(name==BASE_NAME)
        !            26:                        return fclass_alias->base();
        !            27:                // $method=junction(self+class+method)
        !            28:                if(Junction *junction=fclass_real.get_junction(*this, name))
        !            29:                        return NEW VJunction(*junction);;
        !            30:                return 0;
        !            31:        }
        !            32: 
        !            33:        // object_class, object_instance: object_class
        !            34:        VClass *get_class() { return &fclass_real; }
        !            35: 
        !            36: public: // creation
        !            37: 
        !            38:        VStateless_object(Pool& apool, VClass& aclass_real) : VAliased(apool, aclass_real), 
        !            39:                fclass_real(aclass_real) {
        !            40:        }
        !            41: 
        !            42: private:
        !            43: 
        !            44:        VClass& fclass_real;
        !            45: };
        !            46: 
        !            47: #endif

E-mail: