ircproxy The Ultimate Cyborg |
#include <Expression.h>
Definition at line 200 of file Expression.h.
Public Types | |
typedef BinaryExpression <!inverted, EXPR1, OP, EXPR2 > | inverted_type |
The type of this expression inverted. | |
Public Member Functions | |
BinaryExpression (EXPR1 e1, EXPR2 e2) | |
Constructor. | |
BinaryExpression<!inverted, EXPR1, OP, EXPR2 > | operator! (void) const |
Return inverted expression. | |
ExpressionEventServer & | create_event_server (void) |
Create and return an event server that is watching this expression. | |
void | sub_event_server_impl (ExpressionEventServer *event_server) |
Actual implementation of sub_event_server(). | |
virtual void | add_event_server (boost::shared_ptr< ExpressionEventServer > const &event_server) |
Implementation of pure virtual funtion ExpressionInterface::add_event_server. | |
virtual bool | evaluate (void) |
Evaluate the expression. | |
virtual void | sub_event_server (ExpressionEventServer *event_server) |
Implementation of pure virtual funtion ExpressionInterface::sub_event_server. | |
virtual void | print_on (std::ostream &os) const |
Print the expression on ostream os. | |
Protected Attributes | |
EXPR1 | M_e1 |
First expression. | |
EXPR2 | M_e2 |
Second expression. |
typedef BinaryExpression<!inverted, EXPR1, OP, EXPR2> BinaryExpression< inverted, EXPR1, OP, EXPR2 >::inverted_type |
BinaryExpression< inverted, EXPR1, OP, EXPR2 >::BinaryExpression | ( | EXPR1 | e1, | |
EXPR2 | e2 | |||
) | [inline] |
BinaryExpression<!inverted, EXPR1, OP, EXPR2 > BinaryExpression< inverted, EXPR1, OP, EXPR2 >::operator! | ( | void | ) | const [inline] |
Return inverted expression.
Definition at line 267 of file Expression.h.
References BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e1, and BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e2.
00268 { return BinaryExpression<!inverted, EXPR1, OP, EXPR2>(M_e1, M_e2); }
ExpressionEventServer& BinaryExpression< inverted, EXPR1, OP, EXPR2 >::create_event_server | ( | void | ) | [inline] |
Create and return an event server that is watching this expression.
Definition at line 217 of file Expression.h.
References debug::channels::dc::expression.
00218 { 00219 boost::shared_ptr<ExpressionInterface> expression(new BinaryExpression(*this)); 00220 boost::shared_ptr<ExpressionEventServer> event_server(new ExpressionEventServer(expression)); 00221 expression->add_event_server(event_server); 00222 return *event_server; 00223 }
void BinaryExpression< inverted, EXPR1, OP, EXPR2 >::sub_event_server_impl | ( | ExpressionEventServer * | event_server | ) | [inline] |
virtual void BinaryExpression< inverted, EXPR1, OP, EXPR2 >::add_event_server | ( | boost::shared_ptr< ExpressionEventServer > const & | event_server | ) | [inline, virtual] |
Implementation of pure virtual funtion ExpressionInterface::add_event_server.
Implements ExpressionInterface.
Definition at line 229 of file Expression.h.
bool BinaryExpression< inverted, EXPR1, OP, EXPR2 >::evaluate | ( | void | ) | [inline, virtual] |
Evaluate the expression.
Implements ExpressionInterface.
Definition at line 258 of file Expression.h.
00259 { 00260 typename binary_operator<inverted, EXPR1, OP, EXPR2>::return_type result = 00261 static_cast<BinaryExpressionDerived<inverted, EXPR1, OP, EXPR2>*>(this)->evaluate_impl(); 00262 return only_pass_if_bool(result); 00263 }
virtual void BinaryExpression< inverted, EXPR1, OP, EXPR2 >::sub_event_server | ( | ExpressionEventServer * | event_server | ) | [inline, virtual] |
Implementation of pure virtual funtion ExpressionInterface::sub_event_server.
Implements ExpressionInterface.
Definition at line 234 of file Expression.h.
00234 { sub_event_server_impl(event_server); }
void BinaryExpression< inverted, EXPR1, OP, EXPR2 >::print_on | ( | std::ostream & | os | ) | const [inline, virtual] |
Print the expression on ostream os.
Implements ExpressionInterface.
Definition at line 272 of file Expression.h.
References BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e1, and BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e2.
00273 { 00274 if (inverted) 00275 os << '!'; 00276 os << '('; 00277 M_e1.print_on(os); 00278 switch (OP) 00279 { 00280 case beop_AND: 00281 os << " && "; 00282 break; 00283 case beop_OR: 00284 os << " || "; 00285 break; 00286 case beop_NEQ: 00287 os << " != "; 00288 break; 00289 case beop_EQ: 00290 os << " == "; 00291 break; 00292 case beop_BITWISE_AND: 00293 os << " & "; 00294 break; 00295 case beop_BITWISE_OR: 00296 os << " | "; 00297 break; 00298 case beop_BITWISE_XOR: 00299 os << " ^ "; 00300 break; 00301 } 00302 M_e2.print_on(os); 00303 os << ')'; 00304 }
EXPR1 BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e1 [protected] |
First expression.
Definition at line 206 of file Expression.h.
Referenced by BinaryExpression< inverted, EXPR1, OP, EXPR2 >::operator!(), and BinaryExpression< inverted, EXPR1, OP, EXPR2 >::print_on().
EXPR2 BinaryExpression< inverted, EXPR1, OP, EXPR2 >::M_e2 [protected] |
Second expression.
Definition at line 207 of file Expression.h.
Referenced by BinaryExpression< inverted, EXPR1, OP, EXPR2 >::operator!(), and BinaryExpression< inverted, EXPR1, OP, EXPR2 >::print_on().
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|