Annotation of parser3/src/classes/classes.h, revision 1.38

1.2       paf         1: /** @file
                      2:        Parser: @b Methoded class decl.
                      3: 
1.35      moko        4:        Copyright (c) 2001-2015 Art. Lebedev Studio (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.38    ! moko       11: #define IDENT_CLASSES_H "$Id: classes.h,v 1.37 2016/04/01 16:27:31 moko Exp $"
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.38    ! moko       22: public: // Value
        !            23:        
        !            24:        override const char* type() const { return ftype; }
        !            25: 
1.2       paf        26: public: // Methoded
                     27: 
1.6       paf        28:        /** should Methoded_array::register_directly_used register this class in
                     29:                Request::classes() or not. 
                     30:                if not - global variable with Methoded descendant 
                     31:                is used in VStateless_class parameter
                     32:        */
1.33      moko       33:        virtual bool used_directly() { return true; }
1.6       paf        34:        /// use this method to read parameters from root "auto.p"; access r.main_class
1.13      parser     35:        virtual void configure_admin(Request& ) {}
1.6       paf        36:        /// use this method to read parameters from 'MAIN' class; access r.main_class
1.13      parser     37:        virtual void configure_user(Request& ) {}
1.9       parser     38:        /// use it to construct static variables. check some static so that would be only ONCE!
                     39:        virtual void construct_statics() {}
1.2       paf        40: 
1.38    ! moko       41: private:
        !            42: 
        !            43:        const char* ftype;
        !            44: 
1.2       paf        45: public: // usage
                     46: 
1.38    ! moko       47:        Methoded(const char* atype): ftype(atype){}
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: 
1.36      moko       73: #define DECLARE_CLASS_VAR(name, self) \
                     74:        Methoded* name##_class=self
1.2       paf        75: 
                     76: #endif

E-mail: