43 #include "../TaskContext.hpp" 48 #include <boost/bind.hpp> 53 using namespace detail;
54 using namespace boost;
57 error_status<> PropertyParser::handle_no_property(
scanner_t const& scan, parser_error<PropertyErrors, iter_t>&e )
61 return error_status<>( error_status<>::accept, advance_on_error );
65 : commonparser(cp), _bag(0), _property(0)
67 BOOST_SPIRIT_DEBUG_RULE( propertylocator );
72 ( +(commonparser.
notassertingidentifier >>
".")[boost::bind( &PropertyParser::locateproperty,
this, _1, _2 ) ])
73 [ boost::bind(&PropertyParser::handle_no_property,
this, _1, _2) ];
90 void PropertyParser::locateproperty(
iter_t begin,
iter_t end )
92 std::string name( begin, end );
93 name.erase( name.length() -1 );
96 if ( _bag && _bag->
find(name) ) {
104 advance_on_error += end.base() - begin.base();
105 _bag = &(propbag->
set());
106 _property = propbase;
110 throw_(begin, bag_not_found );
120 throw_(begin, bag_not_found );
126 return propertylocator;
PropertyParser(CommonParser &cp)
Base class for all properties.
A container for holding references to properties.
This class contains some very common parser definitions.
void reset()
After reset, property() == 0 and bag == 0.
scanner< iter_t, scanner_pol_t > scanner_t
base::PropertyBase * find(const std::string &name) const
Find the base::PropertyBase with name name.
A property represents a named value of any type with a description.
void setPropertyBag(PropertyBag *pb)
Change the bag we want to traverse.
rule_t & locator()
The locator tries to go as far as possible in the bag-to-property path and will never throw...
reference_t set()
Access to the value of the Property.
rule_t notassertingidentifier
identifier with <template> marks in it
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.