Skip to content
Snippets Groups Projects
Commit bc185a9c authored by Nicolas Mansard's avatar Nicolas Mansard
Browse files

IVIGIT, added signal-helper (macros to ease the declaration of signals) and...

IVIGIT, added signal-helper (macros to ease the declaration of signals) and entity helper (macros to make the macros of signal-helper possible).
parent ab4acf5b
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2011, Nicolas Mansard, LAAS-CNRS
*
* This file is part of sot-core.
* sot-core is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-core is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __sot_core_entity_helper_H__
#define __sot_core_entity_helper_H__
namespace dynamicgraph
{
template< typename Ent >
struct EntityHelper
{
typedef Ent EntityClassName;
//static const std::string CLASS_NAME; TO BE ADDED IN DG DIRECTLY
};
} // namespace dynamicgraph
#endif // __sot_core_entity_helper_H__
/*
* Copyright 2011, Nicolas Mansard, LAAS-CNRS
*
* This file is part of dynamic-graph.
* dynamic-graph is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* dynamic-graph is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __dynamic_graph_signal_helper_H__
#define __dynamic_graph_signal_helper_H__
/* --- COMMON INCLUDE -------------------------------------------------- */
/* dg signals */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
/* --- MACROS ---------------------------------------------------------- */
#define DECLARE_SIGNAL( name,IO,type ) ::dynamicgraph::Signal<type,int> name##S##IO
#define CONSTRUCT_SIGNAL( name,IO,type ) name##S##IO( getClassName()+"("+getName()+")::"+#IO+"put("+#type+")::"+#name )
#define DECLARE_SIGNAL_IN( name,type ) ::dynamicgraph::SignalPtr<type,int> name##SIN
#define CONSTRUCT_SIGNAL_IN( name,type ) name##SIN( NULL,getClassName()+"("+getName()+")::input("+#type+")::"+#name )
#define SIGNAL_OUT_FUNCTION( name ) name##SOUT_function
#define DECLARE_SIGNAL_OUT( name,type ) \
public: \
::dynamicgraph::SignalTimeDependent<type,int> name##SOUT; \
protected: \
type& SIGNAL_OUT_FUNCTION(name)( type&,int )
#define CONSTRUCT_SIGNAL_OUT( name,type,dep ) \
name##SOUT( boost::bind(& EntityClassName::name##SOUT_function,this,_1,_2), \
dep,getClassName()+"("+getName()+")::output("+#type+")::"+#name )
#endif // __dynamic_graph_signal_helper_H__
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