prefix_ void senf::ppi::module::AnnotationRouter<AnnotationType>::request()
{
Packet p (input());
- typename AnnotationRouter::DynamicConnectorContainer::iterator i (
+ typename AnnotationRouter::ContainerType::iterator i (
this->connectors().find(p.annotation<AnnotationType>()));
if (i == this->connectors().end())
defaultOutput(p);
#include "../Utils/String.hh"
#include "Module.hh"
#include "Connectors.hh"
-#include "DynamicConnectorMixin.hh"
+#include "MultiConnectorMixin.hh"
//#include "AnnotationRouter.mpp"
///////////////////////////////hh.p////////////////////////////////////////
template <class AnnotationType>
class AnnotationRouter
: public Module,
- public DynamicConnectorMixin< AnnotationRouter<AnnotationType>,
+ public MultiConnectorMixin< AnnotationRouter<AnnotationType>,
connector::ActiveOutput<>,
AnnotationType >
{
typedef boost::ptr_map<AnnotationType, connector::ActiveOutput<> > Outputs;
Outputs outputs_;
- friend class DynamicConnectorMixin< AnnotationRouter<AnnotationType>,
+ friend class MultiConnectorMixin< AnnotationRouter<AnnotationType>,
connector::ActiveOutput<>,
AnnotationType >;
};
///////////////////////////////cc.p////////////////////////////////////////
prefix_ void
-senf::ppi::module::ActiveDuplicator::connectorSetup(ActiveDuplicator::DynamicConnector & conn)
+senf::ppi::module::ActiveDuplicator::connectorSetup(ActiveDuplicator::ConnectorType & conn)
{
route(input, conn);
}
prefix_ void senf::ppi::module::ActiveDuplicator::request()
{
Packet p (input());
- ActiveDuplicator::ConnectorContainer::iterator i (connectors().begin());
- ActiveDuplicator::ConnectorContainer::iterator const i_end (connectors().end());
+ ActiveDuplicator::ContainerType::iterator i (connectors().begin());
+ ActiveDuplicator::ContainerType::iterator const i_end (connectors().end());
for (; i != i_end; ++i)
(*i)(p);
}
#include "predecl.hh"
#include "Connectors.hh"
#include "Module.hh"
-#include "DynamicConnectorMixin.hh"
+#include "MultiConnectorMixin.hh"
//#include "Duplicators.mpp"
///////////////////////////////hh.p////////////////////////////////////////
*/
class ActiveDuplicator
: public Module,
- public DynamicConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >
+ public MultiConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >
{
SENF_PPI_MODULE(ActiveDuplicator);
public:
ActiveDuplicator();
private:
- void connectorSetup(ActiveDuplicator::DynamicConnector & conn);
+ void connectorSetup(ActiveDuplicator::ConnectorType & conn);
void request();
- friend class DynamicConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >;
+ friend class MultiConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >;
};
}}}
// private members
prefix_ void
-senf::ppi::module::PriorityJoin::connectorSetup(PriorityJoin::DynamicConnector & conn,
+senf::ppi::module::PriorityJoin::connectorSetup(PriorityJoin::ConnectorType & conn,
int priority)
{
noroute(conn);
{
using boost::lambda::_1;
using boost::lambda::bind;
- PriorityJoin::ConnectorContainer::iterator i (
+ PriorityJoin::ContainerType::iterator i (
std::find_if(connectors().begin(), connectors().end(),
! bind(&connector::GenericActiveInput::throttled, _1)));
if (i != connectors().end())
#include "predecl.hh"
#include "Connectors.hh"
#include "Module.hh"
-#include "DynamicConnectorMixin.hh"
+#include "MultiConnectorMixin.hh"
//#include "Joins.mpp"
///////////////////////////////hh.p////////////////////////////////////////
*/
class PassiveJoin
: public Module,
- public DynamicConnectorMixin<PassiveJoin, connector::PassiveInput<> >
+ public MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >
{
SENF_PPI_MODULE(PassiveJoin);
public:
void onThrottle();
void onUnthrottle();
- friend class DynamicConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
+ friend class MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
};
/** \brief Join multiple packet streams with active inputs
*/
class PriorityJoin
: public Module,
- public DynamicConnectorMixin<PriorityJoin, connector::ActiveInput<> >
+ public MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >
{
SENF_PPI_MODULE(PriorityJoin);
public:
PriorityJoin();
private:
- void connectorSetup(PriorityJoin::DynamicConnector & conn, int priority=-1);
+ void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1);
void request();
void onThrottle();
void onUnthrottle();
- friend class DynamicConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
+ friend class MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
};
}}}
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief DynamicConnectorMixin inline template implementation */
+ \brief MultiConnectorMixin inline template implementation */
-//#include "DynamicConnectorMixin.ih"
+//#include "MultiConnectorMixin.ih"
// Custom includes
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
-template <class Self, class ConnectorType, class KeyType, class ContainerType>
-prefix_ ContainerType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,KeyType,ContainerType>::connectors()
+template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
+prefix_ ContainerType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::connectors()
{
return connectors_;
}
-template <class Self, class ConnectorType, class ContainerType>
-prefix_ ContainerType &
-senf::ppi::module::DynamicConnectorMixin<Self, ConnectorType, void, ContainerType>::connectors()
+template <class Self_, class ConnectorType_, class ContainerType_>
+prefix_ ContainerType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
{
return connectors_;
}
#define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
0, \
- SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \
- SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \
+ SENF_MULTI_CONNECTOR_MAX_ARGS, \
+ SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
3 ))
#include BOOST_PP_ITERATE()
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief DynamicConnectorMixin public header */
+ \brief MultiConnectorMixin public header */
-#ifndef HH_SENF_PPI_DynamicConnectorMixin_
-#define HH_SENF_PPI_DynamicConnectorMixin_ 1
+#ifndef HH_SENF_PPI_MultiConnectorMixin_
+#define HH_SENF_PPI_MultiConnectorMixin_ 1
// Custom includes
#include "../config.hh"
#include "Connectors.hh"
#include "Setup.hh"
-#include "DynamicConnectorMixin.mpp"
+#include "MultiConnectorMixin.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-#ifndef SENF_DYNAMIC_CONNECTOR_MAX_ARGS
-#define SENF_DYNAMIC_CONNECTOR_MAX_ARGS 3
+#ifndef SENF_MULTI_CONNECTOR_MAX_ARGS
+#define SENF_MULTI_CONNECTOR_MAX_ARGS 3
#endif
namespace senf {
# define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
0, \
- SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \
- SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \
+ SENF_MULTI_CONNECTOR_MAX_ARGS, \
+ SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
2 ))
# include BOOST_PP_ITERATE()
namespace detail {
template <class KeyType, class ConnectorType>
- struct DefaultDynamicContainer
+ struct DefaultMultiConnectorContainer
{ typedef boost::ptr_map<KeyType, ConnectorType> type; };
template <class ConnectorType>
- struct DefaultDynamicContainer<void,ConnectorType>
+ struct DefaultMultiConnectorContainer<void,ConnectorType>
{ typedef boost::ptr_vector<ConnectorType> type; };
template <class ConnectorType>
The list manager will insert the new connector at the end of the list BEFORE calling
connetorSetup. This allows the setup routine to manipulate the position.
*/
- template <class Self,
- class ConnectorType,
- class KeyType=void,
- class ContainerType=typename detail::DefaultDynamicContainer<
- KeyType,ConnectorType>::type>
- class DynamicConnectorMixin
- : private detail::DynamicDisableType<ConnectorType>::type
+ template <class Self_,
+ class ConnectorType_,
+ class KeyType_=void,
+ class ContainerType_=typename detail::DefaultMultiConnectorContainer<
+ KeyType_,ConnectorType_>::type>
+ class MultiConnectorMixin
+ : private detail::DynamicDisableType<ConnectorType_>::type
{
public:
- typedef ConnectorType DynamicConnector;
+ typedef ConnectorType_ ConnectorType;
protected:
- typedef ContainerType DynamicConnectorContainer;
- ContainerType & connectors();
+ typedef ContainerType_ ContainerType;
+ ContainerType_ & connectors();
private:
# define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
0, \
- SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \
- SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \
+ SENF_MULTI_CONNECTOR_MAX_ARGS, \
+ SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
1 ))
# include BOOST_PP_ITERATE()
- ContainerType connectors_;
+ ContainerType_ connectors_;
};
- template <class Self,
- class ConnectorType,
- class ContainerType>
- class DynamicConnectorMixin<Self, ConnectorType, void, ContainerType>
- : private detail::DynamicDisableType<ConnectorType>::type
+ template <class Self_,
+ class ConnectorType_,
+ class ContainerType_>
+ class MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>
+ : private detail::DynamicDisableType<ConnectorType_>::type
{
public:
- typedef ConnectorType DynamicConnector;
+ typedef ConnectorType_ ConnectorType;
protected:
- typedef ContainerType ConnectorContainer;
- ContainerType & connectors();
+ typedef ContainerType_ ContainerType;
+ ContainerType_ & connectors();
private:
# define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
0, \
- SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \
- SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \
+ SENF_MULTI_CONNECTOR_MAX_ARGS, \
+ SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
1 ))
# include BOOST_PP_ITERATE()
- ContainerType connectors_;
+ ContainerType_ connectors_;
};
}}}
///////////////////////////////hh.e////////////////////////////////////////
-//#include "DynamicConnectorMixin.cci"
-//#include "DynamicConnectorMixin.ct"
-#include "DynamicConnectorMixin.cti"
+//#include "MultiConnectorMixin.cci"
+//#include "MultiConnectorMixin.ct"
+#include "MultiConnectorMixin.cti"
#endif
\f
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief DynamicConnectorMixin Boost.Preprocesser external iteration include */
+ \brief MultiConnectorMixin Boost.Preprocesser external iteration include */
-#if !BOOST_PP_IS_ITERATING && !defined(MPP_SENF_PPI_DynamicConnectorMixin_)
-#define MPP_SENF_PPI_DynamicConnectorMixin_ 1
+#if !BOOST_PP_IS_ITERATING && !defined(MPP_SENF_PPI_MultiConnectorMixin_)
+#define MPP_SENF_PPI_MultiConnectorMixin_ 1
// Custom includes
#include <boost/preprocessor/iteration/iterate.hpp>
// ////////////////////////////////////////////////////////////////////////
#if BOOST_PP_ITERATION_FLAGS()==1 // //////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////
-// DynamicConnectorMixin member declaration
+// MultiConnectorMixin member declaration
mpp_TplParams()
-ConnectorType & newConnector( mpp_FnParams() );
+ConnectorType_ & newConnector( mpp_FnParams() );
template <class Source, class Target mpp_TplParamsKomma()>
friend typename boost::enable_if<
- boost::is_base_of<connector::OutputConnector, typename Source::DynamicConnector>,
- typename Source::DynamicConnector & >::type
+ boost::is_base_of<connector::OutputConnector, typename Source::ConnectorType>,
+ typename Source::ConnectorType & >::type
senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma());
template <class Source, class Target mpp_TplParamsKomma()>
friend typename boost::enable_if<
- boost::is_base_of<connector::InputConnector, typename Target::DynamicConnector>,
- typename Target::DynamicConnector & >::type
+ boost::is_base_of<connector::InputConnector, typename Target::ConnectorType>,
+ typename Target::ConnectorType & >::type
senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma());
// ////////////////////////////////////////////////////////////////////////
template <class Source, class Target mpp_TplParamsKomma()>
typename boost::enable_if<
- boost::is_base_of<connector::OutputConnector, typename Source::DynamicConnector>,
- typename Source::DynamicConnector & >::type
+ boost::is_base_of<connector::OutputConnector, typename Source::ConnectorType>,
+ typename Source::ConnectorType & >::type
connect(Source & source, Target & target mpp_FnParamsKomma());
template <class Source, class Target mpp_TplParamsKomma()>
typename boost::enable_if<
- boost::is_base_of<connector::InputConnector, typename Target::DynamicConnector>,
- typename Target::DynamicConnector & >::type
+ boost::is_base_of<connector::InputConnector, typename Target::ConnectorType>,
+ typename Target::ConnectorType & >::type
connect(Source & source, Target & target mpp_FnParamsKomma());
// ////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////
// Implementation
-template <class Self, class ConnectorType, class KeyType, class ContainerType>
+template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
mpp_TplParams()
-prefix_ ConnectorType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,KeyType,ContainerType>::
+prefix_ ConnectorType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
newConnector(mpp_FnParams())
{
- std::auto_ptr<ConnectorType> conn (new ConnectorType);
- KeyType key (static_cast<Self*>(this)->connectorSetup(*conn mpp_CallParamsKomma()));
+ std::auto_ptr<ConnectorType_> conn (new ConnectorType_);
+ KeyType_ key (static_cast<Self_*>(this)->connectorSetup(*conn mpp_CallParamsKomma()));
return * connectors_.insert(key, conn).first->second;
}
-template <class Self, class ConnectorType, class ContainerType>
+template <class Self_, class ConnectorType_, class ContainerType_>
mpp_TplParams()
-prefix_ ConnectorType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,void,ContainerType>::
+prefix_ ConnectorType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
newConnector(mpp_FnParams())
{
- connectors_.push_back(new ConnectorType);
- ConnectorType & conn (connectors_.back());
- try { static_cast<Self*>(this)->connectorSetup(conn mpp_CallParamsKomma()); }
+ connectors_.push_back(new ConnectorType_);
+ ConnectorType_ & conn (connectors_.back());
+ try { static_cast<Self_*>(this)->connectorSetup(conn mpp_CallParamsKomma()); }
catch (...) { connectors_.pop_back(); throw; }
return conn;
}
template <class Source, class Target mpp_TplParamsKomma()>
typename boost::enable_if<
- boost::is_base_of<senf::ppi::connector::OutputConnector, typename Source::DynamicConnector>,
- typename Source::DynamicConnector & >::type
+ boost::is_base_of<senf::ppi::connector::OutputConnector, typename Source::ConnectorType>,
+ typename Source::ConnectorType & >::type
senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma())
{
connect(source.newConnector(mpp_CallParams()), target);
template <class Source, class Target mpp_TplParamsKomma()>
typename boost::enable_if<
- boost::is_base_of<senf::ppi::connector::InputConnector, typename Target::DynamicConnector>,
- typename Target::DynamicConnector & >::type
+ boost::is_base_of<senf::ppi::connector::InputConnector, typename Target::ConnectorType>,
+ typename Target::ConnectorType & >::type
senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma())
{
connect(source, target.newConnector(mpp_CallParams()));
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief DynamicConnectorMixin.test unit tests */
+ \brief MultiConnectorMixin.test unit tests */
-//#include "DynamicConnectorMixin.test.hh"
-//#include "DynamicConnectorMixin.test.ih"
+//#include "MultiConnectorMixin.test.hh"
+//#include "MultiConnectorMixin.test.ih"
// Custom includes
-#include "DynamicConnectorMixin.hh"
+#include "MultiConnectorMixin.hh"
#include "../Utils/auto_unit_test.hh"
#include <boost/test/test_tools.hpp>