--- parser3/src/classes/classes.h 2005/08/08 08:41:50 1.30 +++ parser3/src/classes/classes.h 2020/12/15 17:10:27 1.41 @@ -1,14 +1,14 @@ /** @file Parser: @b Methoded class decl. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef CLASSES_H #define CLASSES_H -static const char * const IDENT_CLASSES_H="$Date: 2005/08/08 08:41:50 $"; +#define IDENT_CLASSES_H "$Id: classes.h,v 1.41 2020/12/15 17:10:27 moko Exp $" // include @@ -20,10 +20,8 @@ static const char * const IDENT_CLASSES_ */ class Methoded: public VStateless_class { public: // Value - - override const VJunction* put_element(Value& /*self*/, const String& /*name*/, Value * /*value*/) { - return 0; // fewer useless Exceptions - } + + override const char* type() const { return ftype; } public: // Methoded @@ -32,19 +30,19 @@ public: // Methoded if not - global variable with Methoded descendant is used in VStateless_class parameter */ - virtual bool used_directly() =0; + virtual bool used_directly() { return true; } /// use this method to read parameters from root "auto.p"; access r.main_class virtual void configure_admin(Request& ) {} /// use this method to read parameters from 'MAIN' class; access r.main_class virtual void configure_user(Request& ) {} - /// use it to construct static variables. check some static so that would be only ONCE! - virtual void construct_statics() {} + +private: + + const char* ftype; public: // usage - Methoded(const char* aname, VStateless_class* abase=0): - VStateless_class(new String(aname), abase) { - } + Methoded(const char* atype): ftype(atype){} void register_directly_used(Request& r); @@ -70,8 +68,7 @@ Methoded_array& methoded_array(); // defines -#define DECLARE_CLASS_VAR(name, self, base) \ - Methoded* name##_class=self; \ - Methoded* name##_base_class=base +#define DECLARE_CLASS_VAR(name, self) \ + Methoded* name##_class=self #endif