Annotation of parser3/src/types/pa_vstateless_object.h, revision 1.9
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.9 ! paf 8: $Id: pa_vstateless_object.h,v 1.8 2001/04/26 15:01:52 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.9 ! paf 33:
1.1 paf 34: // $method=junction(self+class+method)
35: if(Junction *junction=fclass_real.get_junction(*this, name))
1.3 paf 36: return NEW VJunction(*junction);
1.9 ! paf 37:
1.1 paf 38: return 0;
39: }
40:
41: public: // creation
42:
1.2 paf 43: VStateless_object(Pool& apool, VStateless_class& aclass_real) :
44: VAliased(apool, aclass_real),
45:
1.1 paf 46: fclass_real(aclass_real) {
47: }
48:
49: private:
50:
1.2 paf 51: VStateless_class& fclass_real;
1.1 paf 52: };
53:
54: #endif
E-mail: