User Manual, Developers Guide and API Documentation

Lower2Copper.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Glue                                                                       *
00003  * __________________________________________________________________________ *
00004  *                                                                            *
00005  * Copyright (C) 2005-2006                                                    *
00006  * Lehrstuhl fuer Kommunikationsnetze (ComNets)                               *
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany                                 *
00008  * phone: ++49-241-80-27910 (phone), fax: ++49-241-80-22242                   *
00009  * email: wns@comnets.rwth-aachen.de                                          *
00010  * www: http://wns.comnets.rwth-aachen.de                                     *
00011  ******************************************************************************/
00012 
00013 #ifndef GLUE_CONVERGENCE_LOWER2COPPER_HPP
00014 #define GLUE_CONVERGENCE_LOWER2COPPER_HPP
00015 
00016 #include <GLUE/convergence/Lower.hpp>
00017 
00018 #include <WNS/probe/bus/ContextCollector.hpp>
00019 
00020 #include <WNS/service/phy/copper/DataTransmission.hpp>
00021 #include <WNS/service/phy/copper/Notification.hpp>
00022 #include <WNS/service/phy/copper/Handler.hpp>
00023 #include <WNS/service/phy/copper/CarrierSensing.hpp>
00024 
00025 #include <WNS/service/dll/Address.hpp>
00026 
00027 #include <WNS/pyconfig/View.hpp>
00028 #include <WNS/Observer.hpp>
00029 
00030 #include <map>
00031 
00032 namespace glue { namespace convergence {
00033 
00034     class Lower2Copper:
00035         virtual public Lower,
00036         virtual public wns::Observer<wns::service::phy::copper::Handler>,
00037         virtual public wns::Observer<wns::service::phy::copper::CarrierSensing>,
00038         public wns::ldk::CommandTypeSpecifier<LowerCommand>,
00039         public wns::ldk::HasReceptor<>,
00040         public wns::ldk::HasConnector<>,
00041         public wns::ldk::HasDeliverer<>,
00042         public wns::Cloneable<Lower2Copper>
00043     {
00044         typedef wns::Subject<wns::service::phy::copper::Handler> HandlerSubject;
00045         typedef wns::Subject<wns::service::phy::copper::CarrierSensing> CarrierSensingSubject;
00046 
00047     public:
00048         Lower2Copper(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00049         virtual ~Lower2Copper();
00050 
00051         // wns::service::phy::copper::Handler
00052         virtual void onData(const wns::osi::PDUPtr& pdu, double ber, bool collision);
00053 
00054         // wns::service::phy::copper::CarrierSensing
00055         virtual void onCarrierIdle();
00056         virtual void onCarrierBusy();
00057         virtual void onCollision();
00058         virtual void setNotificationService(wns::service::Service* phy);
00059         virtual wns::service::phy::copper::Notification* getNotificationService() const;
00060         virtual void setDataTransmissionService(wns::service::Service* phy);
00061         virtual wns::service::phy::copper::DataTransmission* getDataTransmissionService() const;
00062         virtual void setMACAddress(const wns::service::dll::UnicastAddress& address);
00063 
00064     private:
00065         // CompoundHandlerInterface
00066         virtual void doSendData(const wns::ldk::CompoundPtr& sdu);
00067         virtual void doOnData(const wns::ldk::CompoundPtr& compound);
00068         virtual void onFUNCreated();
00069         virtual bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00070         virtual void doWakeup();
00071         bool hasCommandOf(FunctionalUnit* routing, const wns::ldk::CompoundPtr& compound) const
00072         {
00073             return getFUN()->getProxy()->commandIsActivated(compound->getCommandPool(), routing);
00074         }
00075 
00076         void pushUp(const wns::ldk::CompoundPtr& compound, double ber, const wns::osi::PDUPtr& pdu);
00077 
00078         void traceIncoming(wns::ldk::CompoundPtr compound, bool collision);
00079 
00080         wns::pyconfig::View config;
00081         wns::logger::Logger logger;
00082 
00083         struct Friends {
00084             UnicastUpper* unicastRouting;
00085             BroadcastUpper* broadcastRouting;
00086         } friends;
00087 
00089         wns::probe::bus::ContextCollectorPtr jsonTracing;
00090 
00091         wns::service::phy::copper::DataTransmission* dataTransmission;
00092         wns::service::phy::copper::Notification* notificationService;
00093         wns::service::dll::UnicastAddress address;
00094         bool isBlocking;
00095     };
00096 } // convergence
00097 } // glue
00098 
00099 #endif // NOT defined GLUE_CONVERGENCE_LOWER2COPPER_HPP
00100 
00101 

Generated on Fri May 25 03:31:59 2012 for openWNS by  doxygen 1.5.5