Annotation of parser3/src/classes/classes.h, revision 1.29
1.2 paf 1: /** @file
2: Parser: @b Methoded class decl.
3:
1.26 paf 4: Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com)
1.16 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.2 paf 6: */
1.24 paf 7:
1.5 paf 8: #ifndef CLASSES_H
9: #define CLASSES_H
1.20 paf 10:
1.29 ! paf 11: static const char * const IDENT_CLASSES_H="$Date: 2005/07/27 10:57:52 $";
1.24 paf 12:
13: // include
1.2 paf 14:
15: #include "pa_vstateless_class.h"
16: #include "pa_array.h"
17:
18: /** Pure virtual base for configurable Methoded descendants
1.7 paf 19: @see Methoded_array
1.2 paf 20: */
1.24 paf 21: class Methoded: public VStateless_class {
1.22 paf 22: public: // Value
23:
1.29 ! paf 24: override const Junction* put_element(Value& /*self*/, const String& /*name*/, Value * /*value*/) {
! 25: return 0; // fewer useless Exceptions
1.22 paf 26: }
27:
1.2 paf 28: public: // Methoded
29:
1.6 paf 30: /** should Methoded_array::register_directly_used register this class in
31: Request::classes() or not.
32: if not - global variable with Methoded descendant
33: is used in VStateless_class parameter
34: */
1.2 paf 35: virtual bool used_directly() =0;
1.6 paf 36: /// use this method to read parameters from root "auto.p"; access r.main_class
1.13 parser 37: virtual void configure_admin(Request& ) {}
1.6 paf 38: /// use this method to read parameters from 'MAIN' class; access r.main_class
1.13 parser 39: virtual void configure_user(Request& ) {}
1.9 parser 40: /// use it to construct static variables. check some static so that would be only ONCE!
41: virtual void construct_statics() {}
1.2 paf 42:
43: public: // usage
44:
1.24 paf 45: Methoded(const char* aname, VStateless_class* abase=0):
46: VStateless_class(new String(aname), abase) {
1.11 parser 47: }
1.2 paf 48:
49: void register_directly_used(Request& r);
50:
51: };
52:
1.8 parser 53: /// all Methoded registered here in autogenerated classes.C
1.24 paf 54: class Methoded_array: public Array<Methoded*> {
1.2 paf 55: public:
1.24 paf 56: Methoded_array();
1.2 paf 57:
58: public: // Methoded for_each-es
1.7 paf 59: /// @see Methoded::configure_admin
1.3 paf 60: void configure_admin(Request& r);
1.7 paf 61: /// @see Methoded::configure_user
1.3 paf 62: void configure_user(Request& r);
1.7 paf 63: /// @see Methoded::register_directly_used
1.2 paf 64: void register_directly_used(Request& r);
65: };
66:
1.24 paf 67: // globals
68:
69: Methoded_array& methoded_array();
70:
71: // defines
72:
73: #define DECLARE_CLASS_VAR(name, self, base) \
74: Methoded* name##_class=self; \
75: Methoded* name##_base_class=base
1.2 paf 76:
77: #endif
E-mail: