00001 #include <iostream>
00002 #include <vector>
00003 #include <string>
00004 #include "../DataSourceBase.hpp"
00005 #include "../OperationInterface.hpp"
00006 #include "../TaskObject.hpp"
00007
00008
00009 using namespace std;
00010
00011 namespace RTT { namespace detail {
00012
00013 void DumpObject(OperationInterface* peer)
00014 {
00015 if (!peer) { cerr << "Not dumping null task!"<<endl; return;}
00016
00017 cerr << "Dumping Task "<< peer->getName() << endl;
00018 cerr << "Attributes: ";
00019 std::vector<std::string> objlist = peer->attributes()->names();
00020 for( std::vector<std::string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
00021 DataSourceBase::shared_ptr pds = peer->attributes()->getValue(*it)->getDataSource();
00022 cerr << *it <<"(="<< pds<<") ";
00023 }
00024 cerr << endl;
00025
00026 cerr << "Events: ";
00027 objlist = peer->events()->getNames();
00028 for( std::vector<std::string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
00029 cerr << *it <<" ";
00030 }
00031 cerr << endl;
00032
00033 objlist = peer->getObjectList();
00034 cerr << "Objects: ";
00035 if ( !objlist.empty() ) {
00036 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
00037 cerr << *it << " ";
00038 } else {
00039 cerr <<"(none)";
00040 }
00041 cerr << endl << endl;
00042
00043
00044 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
00045 if ( *it != "this" )
00046 DumpObject( peer->getObject( *it ) );
00047
00048 }
00049 }}