17 #ifndef HH_SENF_PPI_Connectors_ 18 #define HH_SENF_PPI_Connectors_ 1 22 #include <boost/noncopyable.hpp> 23 #include <boost/scoped_ptr.hpp> 165 bool connected()
const;
171 #ifndef SENF_PPI_NOTRACE 174 static void staticTracingState(
TraceState state);
177 static void tracingFilter(std::string
const & traceFilter);
186 #ifndef SENF_PPI_NOTRACE 187 void trace(
Packet const & p,
char const * label);
188 void throttleTrace(
char const * label,
char const *
type);
191 void unregisterConnector();
193 virtual void v_disconnected();
194 virtual void v_connected();
197 virtual std::type_info
const & v_packetTypeId();
206 #ifndef SENF_PPI_NOTRACE 209 static std::string traceFilter_;
237 template <
class Handler>
238 void onRequest(Handler handler);
251 bool throttled()
const;
252 bool nativeThrottled()
const;
264 virtual void v_disconnected();
265 virtual void v_connected();
268 virtual void v_init();
271 void notifyThrottle();
272 void notifyUnthrottle();
276 void emitUnthrottle();
279 virtual void v_unthrottleEvent();
290 bool remoteThrottled_;
291 bool nativeThrottled_;
293 typedef std::vector<ForwardingRoute*> Routes;
316 template <
class Handler>
317 void onThrottle(Handler handler);
329 template <
class Handler>
330 void onUnthrottle(Handler handler);
342 bool throttled()
const;
349 virtual void v_disconnected();
350 virtual void v_connected();
353 virtual void v_init();
356 void notifyThrottle();
357 void notifyUnthrottle();
365 Callback throttleCallback_;
366 Callback unthrottleCallback_;
368 typedef std::vector<ForwardingRoute*> NotifyRoutes;
369 NotifyRoutes notifyRoutes_;
400 typedef std::deque<Packet> Queue;
406 Packet const & operator()();
419 size_type queueSize()
const;
425 virtual void v_disconnected();
426 virtual void v_connected();
429 void enqueue(
Packet const & p);
431 virtual void v_requestEvent();
432 virtual void v_enqueueEvent();
433 virtual void v_dequeueEvent();
437 Packet const * fastPacket_;
453 void operator()(
Packet const & p);
455 void write(
Packet const & p);
462 virtual void v_disconnected();
463 virtual void v_connected();
485 bool boolean_test()
const;
487 template <
class ThrottlingDisc>
488 void throttlingDisc(ThrottlingDisc
const & disc);
499 virtual void v_disconnected();
500 virtual void v_connected();
503 void v_enqueueEvent();
504 void v_dequeueEvent();
505 void v_unthrottleEvent();
508 boost::scoped_ptr<ThrottlingDiscipline> throttlingDisc_;
520 bool boolean_test()
const;
529 virtual void v_disconnected();
530 virtual void v_connected();
545 bool boolean_test()
const;
552 virtual void v_disconnected();
553 virtual void v_connected();
556 void v_requestEvent();
570 bool boolean_test()
const;
577 virtual void v_disconnected();
578 virtual void v_connected();
587 # define TypedConnector_Input read 588 # define TypedConnector_Output write 589 # define TypedConnector(pType, dir) \ 590 template <class PacketType> \ 592 : public Generic ## pType ## dir, \ 593 private detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType> \ 595 typedef detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType> mixin; \ 597 using mixin::operator(); \ 598 using mixin::TypedConnector_ ## dir ; \ 600 virtual std::type_info const & v_packetTypeId() \ 601 { return typeid(typename PacketType::type); } \ 602 friend class detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType>; \ 605 class pType ## dir <Packet> : public Generic ## pType ## dir \ 608 TypedConnector( Passive, Input );
609 TypedConnector( Passive, Output );
610 TypedConnector( Active, Input );
611 TypedConnector( Active, Output );
613 # undef TypedConnector 614 # undef TypedConnector_Input 615 # undef TypedConnector_Output 631 template <
class PacketType=Packet>
635 PacketType
const & operator()();
639 PacketType
const & read();
654 template <
class PacketType=Packet>
658 PacketType
const & operator()();
662 PacketType
const & read();
676 template <
class PacketType=Packet>
680 void operator()(PacketType
const & packet);
681 void write(PacketType
const & packet);
696 template <
class PacketType=Packet>
700 void operator()(PacketType
const & packet);
701 void write(PacketType
const & packet);
Connector actively sending packets.
DuplicateConnectionException()
#define SENF_LOG_CLASS_AREA()
Combination of PassiveConnector and OutputConnector.
Passive connector base-class.
Active connector base-class.
ModuleManager public header.
Output connector base-class.
Incompatible connectors connected.
Combination of ActiveConnector and OutputConnector.
boost::function< void(Arg)> type
void connect(connector::FastActiveOutput< PacketType > &source, connector::FastPassiveInput< PacketType > &target)
console::ScopedDirectory & consoleDir()
#define SENF_LOG_DEFAULT_LEVEL(level)
Connector passively providing packets.
Throttling public header.
Forwarding route base class.
IncompatibleConnectorsException()