--- parser3/src/classes/classes.h 2003/01/29 11:06:42 1.23.2.4 +++ parser3/src/classes/classes.h 2015/10/26 01:21:53 1.35 @@ -1,14 +1,14 @@ /** @file Parser: @b Methoded class decl. - Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef CLASSES_H #define CLASSES_H -static const char* IDENT_CLASSES_H="$Date: 2003/01/29 11:06:42 $"; +#define IDENT_CLASSES_H "$Id: classes.h,v 1.35 2015/10/26 01:21:53 moko Exp $" // include @@ -19,12 +19,6 @@ static const char* IDENT_CLASSES_H="$Dat @see Methoded_array */ class Methoded: public VStateless_class { -public: // Value - - override bool put_element(const String& /*name*/, Value * /*value*/, bool /*replace*/) { - return false; // fewer useless Exceptions - } - public: // Methoded /** should Methoded_array::register_directly_used register this class in @@ -32,7 +26,7 @@ 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 @@ -42,18 +36,16 @@ public: // Methoded public: // usage - Methoded(const char *aname, VStateless_classPtr abase=VStateless_classPtr(0)): - VStateless_class(ConstStringPtr(new String(aname)), abase) { + Methoded(const char* aname, VStateless_class* abase=0): + VStateless_class(new String(aname), abase) { } void register_directly_used(Request& r); }; -DECLARE_OBJECT_PTR(Methoded) - /// all Methoded registered here in autogenerated classes.C -class Methoded_array: public Array { +class Methoded_array: public Array { public: Methoded_array(); @@ -66,6 +58,14 @@ public: // Methoded for_each-es void register_directly_used(Request& r); }; -extern Methoded_array methoded_array; +// globals + +Methoded_array& methoded_array(); + +// defines + +#define DECLARE_CLASS_VAR(name, self, base) \ + Methoded* name##_class=self; \ + Methoded* name##_base_class=base #endif