Annotation of parser3/src/types/pa_vstateless_object.h, revision 1.15
1.5 paf 1: /** @file
1.8 paf 2: Parser: @b stateless_object class decl.
1.5 paf 3:
1.14 paf 4: Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
1.15 ! paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1 paf 6:
1.15 ! paf 7: $Id: pa_vstateless_object.h,v 1.14 2002/02/08 07:27:54 paf Exp $
1.1 paf 8: */
9:
10: #ifndef PA_VSTATELESS_OBJECT_H
11: #define PA_VSTATELESS_OBJECT_H
12:
13: #include "pa_valiased.h"
14: #include "pa_vjunction.h"
1.13 paf 15: #include "pa_vstateless_class.h"
1.1 paf 16:
1.6 paf 17: /** the object of some class.
1.5 paf 18:
1.6 paf 19: "of some class" means "with some set of methods".
1.5 paf 20: */
1.1 paf 21: class VStateless_object : public VAliased {
22: public: // Value
23:
1.4 paf 24: /// VStateless_object: fclass_real
25: VStateless_class *get_class() { return &fclass_real; }
26:
1.7 paf 27: /// VStateless_object: +$method
1.1 paf 28: Value *get_element(const String& name) {
1.10 parser 29: // $CLASS
1.7 paf 30: if(Value *result=VAliased::get_element(name))
31: return result;
1.9 paf 32:
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.9 paf 36:
1.1 paf 37: return 0;
38: }
39:
40: public: // creation
41:
1.2 paf 42: VStateless_object(Pool& apool, VStateless_class& aclass_real) :
43: VAliased(apool, aclass_real),
44:
1.1 paf 45: fclass_real(aclass_real) {
46: }
47:
48: private:
49:
1.2 paf 50: VStateless_class& fclass_real;
1.1 paf 51: };
52:
53: #endif
E-mail: