ircproxy  The Ultimate Cyborg

Matcher.h File Reference


Detailed Description

This file contains the declaration of the Matcher classes.

Definition in file Matcher.h.

#include <string>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <libcw/events.h>
#include <sys/types.h>
#include <regex.h>
#include "debug.h"
#include "match.h"
#include "MessageIn.h"
#include "Counter.h"

Go to the source code of this file.

Classes

class  Matcher
 Matcher base class. More...
class  Matcher_noarg
 A Matcher base class for matchers that do not take an extra argument. More...
class  Matcher_matchcomp
 Wildcard (* and ?) matcher. More...
class  Matcher_regexp
 Regular expression matcher. More...
class  Matcher_exactmatch
 Exact match matcher. More...
struct  MatchRequestList
 A list of match requests. More...
class  MatchRequest
 A match request. More...
class  MatcherEventType
 The type of the argument that is returned with the callback. More...
class  MatcherEventRequestBase
 Matcher event request base class. More...
class  MatcherEventRequestQueue
 Matches event request queue. More...

Typedefs

typedef event_data_server_tct
< MatcherEventRequestBase,
MatcherEventRequestQueue
MatcherEventServer
 The event server for MatcherEventType.

Enumerations

enum  match0_type
 Match types that do not need an extra argument. More...
enum  match1_type
 Match types that need one extra argument (the pattern to match against). More...

Functions

std::ostream & operator<< (std::ostream &os, match0_type mt)
 For debugging purposes. Write a match0_type to os.
std::ostream & operator<< (std::ostream &os, match1_type mt)
 For debugging purposes. Write a match1_type to os.
bool operator< (boost::shared_ptr< Matcher > const &matcher1, boost::shared_ptr< Matcher > const &matcher2)
 Returns true if matcher1 is expected to be a faster match than matcher2.


Typedef Documentation

The event server for MatcherEventType.

Definition at line 423 of file Matcher.h.


Enumeration Type Documentation

Match types that do not need an extra argument.

Definition at line 34 of file Matcher.h.

00034                  {
00035   // Ordered roughly in the order of matching speed.
00036   anystring_mt = 0,
00037   nonemptystring_mt = 1,
00038   anyglobalchannel_mt = 2,      // Any string starting with a '#'.
00039   anylocalchannel_mt = 3,       // Any string starting with a '&'.
00040   anychannel_mt = 4,            // Any string starting with a '#' or '&'.
00041   anyserver_mt = 5,             // Any string containing a dot.
00042   anynick_mt = 6,               // Any string that is not a channel or server.
00043   mynick_mt = 8,
00044   localserver_mt = 9
00045 };

Match types that need one extra argument (the pattern to match against).

Definition at line 48 of file Matcher.h.

00048                  {
00049   // Ordered roughly in the order of matching speed.
00050   exactmatch_mt = 7,
00051   wildcard_mt = 10,             // ? == one character, * == any string of characters.
00052   regexp_mt = 11
00053 };


Function Documentation

std::ostream& operator<< ( std::ostream &  os,
match0_type  mt 
)

For debugging purposes. Write a match0_type to os.

Definition at line 181 of file debug_ostream_operators.cc.

References debug::match0_type_name().

00182 {
00183   return os << debug::match0_type_name(mt);
00184 }

std::ostream& operator<< ( std::ostream &  os,
match1_type  mt 
)

For debugging purposes. Write a match1_type to os.

Definition at line 187 of file debug_ostream_operators.cc.

References debug::match1_type_name().

00188 {
00189   return os << debug::match1_type_name(mt);
00190 }

bool operator< ( boost::shared_ptr< Matcher > const &  matcher1,
boost::shared_ptr< Matcher > const &  matcher2 
) [inline]

Returns true if matcher1 is expected to be a faster match than matcher2.

Definition at line 234 of file Matcher.h.

00235 {
00236   return matcher1->sort_value() < matcher2->sort_value();
00237 }


Copyright © 2005-2007 Carlo Wood.  All rights reserved.