rfid_tag_phy.hpp

来自「RFID reader 语 tag 模拟器」· HPP 代码 · 共 95 行

HPP
95
字号
 #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 + =
减小字号Ctrl + -
显示快捷键?