Annotation of parser3/src/classes/classes.h, revision 1.23.2.9
1.2 paf 1: /** @file
2: Parser: @b Methoded class decl.
3:
1.23.2.7 paf 4: Copyright (c) 2001-2003 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.23.2.3 paf 7:
1.5 paf 8: #ifndef CLASSES_H
9: #define CLASSES_H
1.20 paf 10:
1.23.2.9! paf 11: static const char* IDENT_CLASSES_H="$Date: 2003/02/17 16:44:56 $";
1.23.2.3 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.23.2.3 paf 21: class Methoded: public VStateless_class {
1.22 paf 22: public: // Value
23:
1.23.2.3 paf 24: override bool put_element(const String& /*name*/, Value * /*value*/, bool /*replace*/) {
1.22 paf 25: return false; // fewer useless Exceptions
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.23.2.7 paf 45: Methoded(const char* aname, VStateless_class* abase=0):
1.23.2.6 paf 46: VStateless_class(StringPtr(new String(aname)), abase) {
1.11 parser 47: }
1.2 paf 48:
49: void register_directly_used(Request& r);
50:
51: };
1.23.2.5 paf 52: DECLARE_OBJECT_PTR(Methoded);
1.23.2.3 paf 53:
1.8 parser 54: /// all Methoded registered here in autogenerated classes.C
1.23.2.3 paf 55: class Methoded_array: public Array<MethodedPtr> {
1.2 paf 56: public:
1.23.2.1 paf 57: Methoded_array();
1.2 paf 58:
59: public: // Methoded for_each-es
1.7 paf 60: /// @see Methoded::configure_admin
1.3 paf 61: void configure_admin(Request& r);
1.7 paf 62: /// @see Methoded::configure_user
1.3 paf 63: void configure_user(Request& r);
1.7 paf 64: /// @see Methoded::register_directly_used
1.2 paf 65: void register_directly_used(Request& r);
66: };
1.23.2.8 paf 67: DECLARE_OBJECT_PTR(Methoded_array);
1.2 paf 68:
1.23.2.8 paf 69: // globals
70:
71: Methoded_array& methoded_array();
1.23.2.9! paf 72:
! 73: // defines
! 74:
! 75: #define DECLARE_CLASS_VAR(name, self, base) \
! 76: MethodedPtr name##_class(self); \
! 77: MethodedPtr name##_base_class(base)
1.2 paf 78:
79: #endif
E-mail: