44 #include "../TaskContext.hpp" 45 #include "../types/TypeStream.hpp" 46 #include "../Logger.hpp" 49 #include <boost/tuple/tuple.hpp> 53 using namespace boost;
57 using namespace detail;
65 std::string prompt(
" = ");
68 doPrint( ds, recurse );
84 Logger::log() << dsb->
get();
89 Logger::log() << dsi->
get() ;
96 Logger::log() << dsl->
get() ;
102 Logger::log() << dsui->
get() ;
107 Logger::log() <<
'"'<< dss->
get() <<
'"' ;
113 Logger::log() << dsvval->
get() ;
118 Logger::log() << ds6d->
get() ;
124 Logger::log() << dsd->
get() ;
129 Logger::log() <<
'\''<< dsc->
get()<<
'\'' ;
138 Logger::log() << siz <<
" Properties";
140 if ( ! bag.empty() ) {
141 Logger::log() <<Logger::nl;
143 Logger::log() <<(*it)->getType()<<
" "<< (*it)->getName();
145 this->printResult( propds.get(), false );
146 Logger::log() <<
" ("<<(*it)->getDescription()<<
')' << Logger::nl;
149 Logger::log() <<
"(empty PropertyBag)";
159 Logger::log() <<
"(void)" ;
165 Logger::log() <<
"( result type '"+ds->
getType()+
"' not known to TaskBrowser )" ;
173 StatementProcessor::StatementProcessor(
TaskContext* tc)
179 StatementProcessor::~StatementProcessor() {
183 int StatementProcessor::execute(
const std::string& comm)
192 if ( taskcontext->
provides()->getValue( comm ) ) {
193 d->printResult( taskcontext->
provides()->getValue( comm )->getDataSource().get(), true );
204 if ( ds.get() != 0 ) {
206 d->printResult( ds.get(), false );
212 Logger::log() <<
Logger::Debug <<
"fatal_semantic_parse_exception: ";
217 Logger::log() <<
Logger::Error <<
"syntactic_parse_exception: ";
223 Logger::log() <<
Logger::Debug <<
"Ignoring ValueChange exception :"<<Logger::nl;
231 Logger::log() <<
Logger::Debug <<
"Trying Expression..."<<Logger::nl;
236 if ( ds.get() != 0 ) {
237 d->printResult( ds.get(), true );
240 Logger::log() <<
Logger::Error <<
"returned zero !"<<Logger::nl;
243 Logger::log() <<
Logger::Error <<
"syntactic_parse_exception :";
248 Logger::log() <<
Logger::Error <<
"fatal_semantic_parse_exception :";
253 Logger::log() <<
Logger::Debug <<
"Ignoring Expression exception :"<<Logger::nl;
257 Logger::log() <<
Logger::Debug <<
"Ignoring Expression parse_exception :"<<Logger::nl;
virtual std::string getType() const =0
Return useful type info in a human readable format.
virtual result_t get() const =0
Return the data as type T.
Service::shared_ptr provides()
Returns this Service.
virtual const std::string what() const =0
The base class for all internal data representations.
A container for holding references to properties.
virtual void reset()
Reset the data to initial values.
basic_ostreams & endl(basic_ostreams &s)
Flush and newline.
virtual bool evaluate() const =0
Force an evaluation of the DataSourceBase.
void doPrint(DataSourceBase *ds, bool recurse)
This is the uppermost exception class in the parser system.
const std::string what() const
This class is the public interface to the Orocos Program Parser Framework.
Properties & getProperties()
Returns a list of all the property objects in this bag.
void printResult(DataSourceBase *ds, bool recurse)
A normal syntactic parse exception means the parser recognised the input, but got stuck later due to ...
base::DataSourceBase::shared_ptr parseExpression(const std::string &s, TaskContext *)
Parses the expression in s.
Notify the Logger in which 'module' the message occured.
An exception which a parser may throw to indicate that it failed to understand the input...
The TaskContext is the C++ representation of an Orocos component.
Properties::iterator iterator
An iterator over the Properties.
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
A Fatal Semantic parse exception means the parser knows that the parsing failed dramatically and shou...
base::DataSourceBase::shared_ptr parseValueChange(const std::string &s, TaskContext *)
Parses a change of a value in s.