ircproxy The Ultimate Cyborg |
#include <Matcher.h>
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. |
MatchRequestList::MatchRequestList | ( | void | ) | [inline] |
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 }
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<<().
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|