prop_xor.cpp
Go to the documentation of this file.
00001 
00025 #include <predicate_manager/prop_xor.h>
00026 
00027 
00028 
00029 using namespace predicate_manager;
00030 using namespace std;
00031 
00032 
00033 
00034 bool
00035 Xor::
00036 evaluate ( boost::function<bool ( NameID ) > f ) const
00037 {
00038     if ( children_.empty() )
00039         return false;
00040 
00041     bool base_value = children_[0]->evaluate ( f );
00042     for ( size_t i = 1; i < children_.size(); i++ )
00043     {
00044         if ( children_[i]->evaluate ( f ) != base_value )
00045             return false;
00046     }
00047 
00048     return true;
00049 }
00050 
00051 
00052 
00053 boost::shared_ptr<PropLogic>
00054 Xor::
00055 clone() const
00056 {
00057     boost::shared_ptr<Xor> p ( new Xor ( *this ) );
00058     return ( boost::dynamic_pointer_cast<PropLogic> ( p ) );
00059 }


predicate_manager
Author(s): Joao Reis and Joao Messias
autogenerated on Wed Aug 26 2015 12:28:34