📄 rfid_tag_phy.hpp
字号:
#ifndef RFID_TAG_PHY_H #define RFID_TAG_PHY_H #include <boost/shared_ptr.hpp> #include "physical_layer.hpp" #include "simulator.hpp" class RfidTagPhy : public PhysicalLayer { public: typedef boost::shared_ptr<RfidTagPhy> RfidTagPhyPtr; static inline RfidTagPhyPtr create( NodePtr node, WirelessChannelManagerPtr wirelessChannelManager); virtual ~RfidTagPhy(); inline RfidTagPhyPtr thisRfidTagPhy(); virtual inline PhysicalLayerPtr thisPhysicalLayer(); virtual inline SimulationEndListenerPtr thisSimulationEndListener(); virtual void simulationEndHandler(); bool setSendingChannel(t_uint channelId); void resetSendingChannel(); bool setAllListenersChannel(t_uint channelId); void resetAllListenersChannel(); virtual void recvdErrorFreeSignal( WirelessCommSignalPtr signal, double recvdSignalStrength); protected: RfidTagPhy(NodePtr node, WirelessChannelManagerPtr wirelessChannelManager); private: boost::weak_ptr<RfidTagPhy> m_weakThis; bool m_sendingChannelIsValid; t_uint m_sendingChannel; bool m_allListenersChannelIsValid; t_uint m_allListenersChannel; }; typedef boost::shared_ptr<RfidTagPhy> RfidTagPhyPtr; typedef boost::shared_ptr<RfidTagPhy const> ConstRfidTagPhyPtr; // Inline Functions inline RfidTagPhyPtr RfidTagPhy::create( NodePtr node, WirelessChannelManagerPtr wirelessChannelManager) { RfidTagPhyPtr p(new RfidTagPhy(node, wirelessChannelManager)); p->m_weakThis = p; // weakThis *must* be set before this* functions are called. Simulator::instance()->addSimulationEndListener( p->thisSimulationEndListener()); return p; } inline RfidTagPhyPtr RfidTagPhy::thisRfidTagPhy() { RfidTagPhyPtr p(m_weakThis); return p; } inline PhysicalLayerPtr RfidTagPhy::thisPhysicalLayer() { PhysicalLayerPtr p(m_weakThis); return p; } inline SimulationEndListenerPtr RfidTagPhy::thisSimulationEndListener() { SimulationEndListenerPtr p(m_weakThis); return p; } // Overloaded Operators #endif // RFID_TAG_PHY_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -