|
|
| version 1.28, 2005/07/26 12:43:05 | version 1.45, 2024/11/10 21:00:00 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b Methoded class decl. | Parser: @b Methoded class decl. |
| Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru> |
| */ | */ |
| #ifndef CLASSES_H | #ifndef CLASSES_H |
| #define CLASSES_H | #define CLASSES_H |
| static const char * const IDENT_CLASSES_H="$Date$"; | #define IDENT_CLASSES_H "$Id$" |
| // include | // include |
| Line 20 static const char * const IDENT_CLASSES_ | Line 20 static const char * const IDENT_CLASSES_ |
| */ | */ |
| class Methoded: public VStateless_class { | class Methoded: public VStateless_class { |
| public: // Value | public: // Value |
| override const Junction* put_element(const String& /*name*/, Value * /*value*/, bool /*replace*/) { | override const char* type() const { return ftype; } |
| return false; // fewer useless Exceptions | |
| } | |
| public: // Methoded | public: // Methoded |
| Line 32 public: // Methoded | Line 30 public: // Methoded |
| if not - global variable with Methoded descendant | if not - global variable with Methoded descendant |
| is used in VStateless_class parameter | 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 | /// use this method to read parameters from root "auto.p"; access r.main_class |
| virtual void configure_admin(Request& ) {} | virtual void configure_admin(Request& ) {} |
| /// use this method to read parameters from 'MAIN' class; access r.main_class | /// use this method to read parameters from 'MAIN' class; access r.main_class |
| virtual void configure_user(Request& ) {} | 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 | public: // usage |
| Methoded(const char* aname, VStateless_class* abase=0): | Methoded(const char* atype): ftype(atype){} |
| VStateless_class(new String(aname), abase) { | |
| } | |
| void register_directly_used(Request& r); | void register_directly_used(Request& r); |
| Line 70 Methoded_array& methoded_array(); | Line 68 Methoded_array& methoded_array(); |
| // defines | // defines |
| #define DECLARE_CLASS_VAR(name, self, base) \ | #define DECLARE_CLASS_VAR(name, self) \ |
| Methoded* name##_class=self; \ | Methoded* name##_class=self; \ |
| Methoded* name##_base_class=base | Methoded* name##_init(){ if(!name##_class){ name##_class=self; } return name##_class; } |
| #endif | #endif |