Annotation of parser3/src/classes/classes.C, revision 1.2

1.2     ! paf         1: /** @file
        !             2:        Parser: @b Methoded and Methoded_array classes.
        !             3: 
        !             4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
        !             5: 
        !             6:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
        !             7: 
        !             8:        $Id: classes.C,v 1.1.2.2 2001/04/28 07:27:30 paf Exp $
        !             9: */
        !            10: 
        !            11: #include "classes.h"
        !            12: #include "pa_request.h"
        !            13: 
        !            14: // Methoded
        !            15: 
        !            16: void Methoded::register_directly_used(Request& r) {
        !            17:        if(used_directly())
        !            18:                r.classes().put(name(), this);
        !            19: }
        !            20: 
        !            21: // Methoded_array
        !            22: 
        !            23: // global variable
        !            24: 
        !            25: Methoded_array *methoded_array;
        !            26: 
        !            27: // methods
        !            28: 
        !            29: Methoded_array::Methoded_array(Pool& apool) : Array(apool) {
        !            30: #      include "classes.inc"
        !            31: }
        !            32: 
        !            33: static void configure_one(Array::Item *value, void *info) {
        !            34:        Request& r=*static_cast<Request *>(info);
        !            35:        Methoded *methoded=static_cast<Methoded *>(value);
        !            36:        methoded->configure(r);
        !            37: }
        !            38: 
        !            39: void Methoded_array::configure(Request& r) {
        !            40:        for_each(configure_one, &r);
        !            41: }
        !            42: 
        !            43: static void register_one(Array::Item *value, void *info) {
        !            44:        Request& r=*static_cast<Request *>(info);
        !            45:        Methoded *methoded=static_cast<Methoded *>(value);
        !            46:        methoded->register_directly_used(r);
        !            47: }
        !            48: 
        !            49: void Methoded_array::register_directly_used(Request& r) {
        !            50:        for_each(register_one, &r);
        !            51: }
        !            52: 
        !            53: // creator
        !            54: 
        !            55: void init_methoded_array(Pool& pool) {
        !            56:        methoded_array=new(pool) Methoded_array(pool);
        !            57: }

E-mail: