~chtsanti/squid/icap-max-connections

« back to all changes in this revision

Viewing changes to src/esi/Parser.h

  • Committer: Christos Tsantilas
  • Date: 2009-04-11 09:00:59 UTC
  • mfrom: (9294.1.333 trunk)
  • Revision ID: chtsanti@users.sourceforge.net-20090411090059-8n47p1kyy1cqfqkn
MergeĀ FromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
class ESIParser : public RefCountable
53
53
{
54
54
public:
 
55
    class Register;
55
56
    typedef RefCount<ESIParser> Pointer;
56
57
 
57
58
    static void registerParser(const char *name, Pointer (*new_func)(ESIParserClient *aClient));
70
71
protected:
71
72
    ESIParser() {};
72
73
 
73
 
    class Register;
74
 
 
75
74
private:
76
75
    static Register *Parser;
77
76
    static Register *Parsers;
83
82
{
84
83
 
85
84
public:
86
 
    Register(const char *_name, ESIParser::Pointer (*_newParser)(ESIParserClient *aClient)) : name(_name), newParser(_newParser) {
87
 
        this->next = ESIParser::Parsers;
88
 
        ESIParser::Parsers = this;
89
 
    }
 
85
    Register(const char *_name, ESIParser::Pointer (*_newParser)(ESIParserClient *aClient));
 
86
    ~Register();
90
87
 
91
88
    const char *name;
92
89
    ESIParser::Pointer (*newParser)(ESIParserClient *aClient);
93
90
    Register * next;
94
91
};
95
92
 
96
 
#define RegisterESIParser(name, ThisClass) \
97
 
    ESIParser::Register ThisClass::thisParser(name, &NewParser); \
 
93
#define EsiParserDefinition(ThisClass) \
98
94
    ESIParser::Pointer ThisClass::NewParser(ESIParserClient *aClient) \
99
95
    { \
100
96
        return new ThisClass (aClient); \
101
97
    }
102
98
 
103
 
#define ESI_PARSER_TYPE \
104
 
    static ESIParser::Pointer NewParser(ESIParserClient *aClient); \
105
 
    static ESIParser::Register thisParser
106
 
 
 
99
#define EsiParserDeclaration \
 
100
    static ESIParser::Pointer NewParser(ESIParserClient *aClient)
107
101
 
108
102
#endif /* SQUID_ESIPARSER_H */