Annotation of parser3/src/types/pa_vclass.h, revision 1.52

1.13      paf         1: /**    @file
1.14      paf         2:        Parser: @b class parser class decl.
1.13      paf         3: 
1.51      paf         4:        Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
1.24      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VCLASS_H
                      9: #define PA_VCLASS_H
1.26      paf        10: 
1.52    ! misha      11: static const char * const IDENT_VCLASS_H="$Date: 2005/08/09 08:14:53 $";
1.40      paf        12: 
                     13: // includes
1.1       paf        14: 
1.8       paf        15: #include "pa_vstateless_class.h"
1.1       paf        16: #include "pa_vjunction.h"
1.22      paf        17: #include "pa_vobject.h"
1.1       paf        18: 
1.13      paf        19: /**    stores 
1.25      paf        20: - static fields: VClass::ffields
1.13      paf        21: */
1.40      paf        22: class VClass: public VStateless_class {
1.1       paf        23: public: // Value
                     24:        
1.40      paf        25:        const char* type() const { return name_cstr(); }
1.29      paf        26: 
1.40      paf        27:        override Value* as(const char* atype, bool looking_up);
1.20      parser     28: 
                     29:        /// VClass: true
1.40      paf        30:        override bool as_bool() const { return true; }
1.1       paf        31: 
1.40      paf        32:        override Value* get_element(const String& aname, Value& aself, bool /*looking_up*/);
1.50      paf        33:        override const VJunction* put_element(Value& self, const String& name, Value* value, bool replace);
1.49      paf        34:        override Value* create_new_value(Pool& apool, HashStringValue& afields);
1.8       paf        35: 
1.47      paf        36: public: // VStateless_class
1.46      paf        37: 
1.47      paf        38:        /// override to pre-cache property accessors into fields
                     39:        override void add_method(const String& name, Method& method);
1.46      paf        40: 
1.49      paf        41: private:
                     42: 
                     43:        Property& add_property(const String& aname);
1.47      paf        44: 
                     45: private:
                     46: 
1.49      paf        47:        struct Prevent_info {
                     48:                VClass* _this;
                     49:                Value* self;
                     50:                const String* name;
                     51:        };
1.50      paf        52:        static const VJunction* prevent_overwrite_property(Value* value, Prevent_info* info);
                     53:        static const VJunction* prevent_append_if_exists_in_base(Value* value, Prevent_info* info);
1.4       paf        54: 
1.25      paf        55: private: // self
1.1       paf        56: 
1.40      paf        57:        HashStringValue ffields;
1.25      paf        58: 
1.1       paf        59: };
                     60: 
                     61: #endif

E-mail: