Skip to content
Snippets Groups Projects
Commit 092b8bc6 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Put back mistakenly removed method pool::getSignal.

parent 6d3b7943
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,12 @@ namespace dynamicgraph
void clearPlugin (const std::string& name);
/*! @} */
///
/// \brief Get a signal by name
///
/// \param sigpath stream containing a string of the form "entity.signal"
SignalBase<int>& getSignal( std::istringstream& sigpath );
/*! \brief This method looks for the object named objectName,
and ask to provide the function functionName with the arguments cmdArg.
If the method of the object displays some information this will
......
......@@ -23,11 +23,14 @@
/* --------------------------------------------------------------------- */
/* --- DYNAMIC-GRAPH --- */
#include <dynamic-graph/pool.h>
#include <dynamic-graph/debug.h>
#include <dynamic-graph/entity.h>
#include <list>
#include <typeinfo>
#include <iostream>
#include <sstream>
#include <string>
#include "dynamic-graph/pool.h"
#include "dynamic-graph/debug.h"
#include "dynamic-graph/entity.h"
using namespace dynamicgraph;
......@@ -240,6 +243,38 @@ commandLine( const std::string& objectName,const std::string& functionName,
}
}
static bool
objectNameParser( std::istringstream& cmdparse,
std::string& objName,
std::string& funName )
{
const int SIZE=128;
char buffer[SIZE];
cmdparse >> std::ws;
cmdparse.getline( buffer,SIZE,'.' );
if(! cmdparse.good () ) // The callback is not an object method
return false;
objName = buffer;
//cmdparse.getline( buffer,SIZE );
//funName = buffer;
cmdparse >> funName;
return true;
}
SignalBase<int>&
PoolStorage::
getSignal( std::istringstream& sigpath )
{
std::string objname,signame;
if(! objectNameParser( sigpath,objname,signame ) )
{ DG_THROW ExceptionFactory( ExceptionFactory::UNREFERED_SIGNAL,
"Parse error in signal name" ); }
Entity& ent = getEntity( objname );
return ent.getSignal( signame );
}
namespace dynamicgraph {
//! The global g_pool object.
PoolStorage g_pool;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment