📄 rfid_reader_phy.hpp
字号:
#ifndef RFID_READER_PHY_H #define RFID_READER_PHY_H #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> #include "physical_layer.hpp" #include "simulator.hpp" class RfidReaderPhy : public PhysicalLayer { public: typedef boost::shared_ptr<RfidReaderPhy> RfidReaderPhyPtr; static inline RfidReaderPhyPtr create( NodePtr node, WirelessChannelManagerPtr wirelessChannelManager); virtual ~RfidReaderPhy(); inline RfidReaderPhyPtr thisRfidReaderPhy(); inline PhysicalLayerPtr thisPhysicalLayer(); inline SimulationEndListenerPtr thisSimulationEndListener(); virtual void simulationEndHandler(); bool setRegularChannel(t_uint channelId); void resetRegularChannel(); bool setAllSendersChannel(t_uint channelId); void resetAllSendersChannel(); protected: RfidReaderPhy(NodePtr node, WirelessChannelManagerPtr wirelessChannelManager); private: boost::weak_ptr<RfidReaderPhy> m_weakThis; static const double m_DEFAULT_READER_RX_THRESHOLD; static const double m_DEFAULT_READER_CS_THRESHOLD; bool m_regularChannelIsValid; t_uint m_regularChannel; bool m_allSendersChannelIsValid; t_uint m_allSendersChannel; }; typedef boost::shared_ptr<RfidReaderPhy> RfidReaderPhyPtr; // Inline Functions inline RfidReaderPhyPtr RfidReaderPhy::create( NodePtr node, WirelessChannelManagerPtr wirelessChannelManager) { RfidReaderPhyPtr p(new RfidReaderPhy(node, wirelessChannelManager)); p->m_weakThis = p; // weakThis *must* be set before this* functions are called. Simulator::instance()->addSimulationEndListener( p->thisSimulationEndListener()); return p; } inline RfidReaderPhyPtr RfidReaderPhy::thisRfidReaderPhy() { RfidReaderPhyPtr p(m_weakThis); return p; } inline PhysicalLayerPtr RfidReaderPhy::thisPhysicalLayer() { PhysicalLayerPtr p(m_weakThis); return p; } inline SimulationEndListenerPtr RfidReaderPhy::thisSimulationEndListener() { SimulationEndListenerPtr p(m_weakThis); return p; } // Overloaded Operators #endif // RFID_READER_PHY_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -