Annotation of parser3/src/types/pa_vstateless_object.h, revision 1.3
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:
1.3 ! paf 6: $Id: pa_vstateless_object.h,v 1.2 2001/03/13 13:43:33 paf Exp $
1.1 paf 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))
1.3 ! paf 29: return NEW VJunction(*junction);
1.1 paf 30: return 0;
31: }
32:
33: // object_class, object_instance: object_class
1.2 paf 34: VStateless_class *get_class() { return &fclass_real; }
1.1 paf 35:
36: public: // creation
37:
1.2 paf 38: VStateless_object(Pool& apool, VStateless_class& aclass_real) :
39: VAliased(apool, aclass_real),
40:
1.1 paf 41: fclass_real(aclass_real) {
42: }
43:
44: private:
45:
1.2 paf 46: VStateless_class& fclass_real;
1.1 paf 47: };
48:
49: #endif
E-mail: