17 #ifndef HH_SENF_Ext_NetEmu_InterfaceDecorator_ 18 #define HH_SENF_Ext_NetEmu_InterfaceDecorator_ 1 21 #include <boost/mpl/if.hpp> 22 #include <boost/type_traits/is_base_of.hpp> 23 #include <boost/utility/base_from_member.hpp> 49 template <
class Connector>
65 template <
class Connector>
76 :
private boost::noncopyable
92 bool canReceive()
const;
93 bool canTransmit()
const;
105 template <
class InterfaceType,
class Base=InterfaceDecorator>
110 InterfaceType & interface();
111 InterfaceType
const & interface()
const;
129 template <
class InterfaceType,
class Base>
134 InterfaceType & interface();
135 InterfaceType
const & interface()
const;
153 template <
class ReceiveModule>
155 :
private boost::base_from_member<ReceiveModule>,
158 typedef boost::base_from_member<ReceiveModule> ModuleMember;
160 ReceiveModule & receiveModule();
161 ReceiveModule
const & receiveModule()
const;
164 template <
class Interface>
175 template <
class Interface>
191 template <
class TransmitModule>
193 :
private boost::base_from_member<TransmitModule>,
196 typedef boost::base_from_member<TransmitModule> ModuleMember;
198 TransmitModule & transmitModule();
199 TransmitModule
const & transmitModule()
const;
202 template <
class Interface>
213 template <
class Interface>
225 template <
class Interface>
229 template <
class InterfaceType,
class CheckBase,
class Implementation>
230 struct CheckDecoratorBase
231 :
public boost::mpl::if_<
232 boost::is_base_of<CheckBase, InterfaceType>,
243 template <
class InterfaceType,
class ReceiveModule,
class TransmitModule>
245 :
private boost::base_from_member<InterfaceType>,
246 public InterfaceType::Decorator,
247 public detail::CheckDecoratorBase<
250 ReceiverDecoratorImplementation<ReceiveModule>
252 public detail::CheckDecoratorBase<
255 TransmitterDecoratorImplementation<TransmitModule>
258 typedef boost::base_from_member<InterfaceType> InterfaceBase;
259 typedef typename detail::CheckDecoratorBase<
263 typedef typename detail::CheckDecoratorBase<
288 template <
class InterfaceType,
class ReceiveModule,
class TransmitModule>
416 template <
class ReceiveModule=senf::mpl::nil,
class TransmitModule=senf::mpl::nil>
420 template <
class InterfaceType>
424 InterfaceType, ReceiveModule, TransmitModule>
type;
virtual ~ReceiverDecorator()
ppi::connector::ActiveOutputJack< EthernetPacket > output
Apply additional modules to an interface.
Decorator for Transmitters.
Interface API base class for receive capable interfaces.
Interface API base class for transmit capable interfaces.
Decorate InterfaceType with additional processing modules.
Implementing the transmitter decorator.
ReceiverDecorator(Connector &connector)
Specialized Interface decorator base-class.
ppi::connector::PassiveInputJack< EthernetPacket > input
Implementing the receiver decorator.
Generic Interface decorator base-class.