ircproxy  The Ultimate Cyborg

MatchRequestList Struct Reference

#include <Matcher.h>

Inheritance diagram for MatchRequestList:

List of all members.


Detailed Description

A list of match requests.

Definition at line 240 of file Matcher.h.


Public Member Functions

 MatchRequestList (void)
 Default constructor.
bool is_match (ServerMessageIn const &msg) const
 Check if message msg equals command M_command and all conditions M_conditions.

Public Attributes

int M_command
 The command to match.
std::multiset
< boost::shared_ptr< Matcher > > 
M_conditions
 All other conditions to match (if any).

Private Member Functions

bool check_list (ServerMessageIn const &msg) const
 Returns true if the message msg matches all conditions.

Constructor & Destructor Documentation

MatchRequestList::MatchRequestList ( void   )  [inline]

Default constructor.

Definition at line 245 of file Matcher.h.

00245 : M_command(-2) { }


Member Function Documentation

bool MatchRequestList::is_match ( ServerMessageIn const &  msg  )  const [inline]

Check if message msg equals command M_command and all conditions M_conditions.

Definition at line 248 of file Matcher.h.

References ASSERT, and MessageIn::key().

00249   {
00250     ASSERT(M_command != -2);    // Initialized?
00251     if (M_command != msg.key())
00252       return false;
00253     return check_list(msg);
00254   }

bool MatchRequestList::check_list ( ServerMessageIn const &  msg  )  const [private]

Returns true if the message msg matches all conditions.

Definition at line 160 of file Matcher.cc.

References M_conditions.

00161 {
00162   for (std::multiset<boost::shared_ptr<Matcher> >::const_iterator iter = M_conditions.begin();
00163       iter != M_conditions.end(); ++iter)
00164   {
00165     if (!(*iter)->match(msg))
00166       return false;
00167   }
00168   return true;
00169 }


Member Data Documentation

The command to match.

Definition at line 241 of file Matcher.h.

Referenced by operator<<().

std::multiset<boost::shared_ptr<Matcher> > MatchRequestList::M_conditions

All other conditions to match (if any).

Definition at line 242 of file Matcher.h.

Referenced by check_list(), and operator<<().


The documentation for this struct was generated from the following files:

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