diff options
author | Samuel O'Brien <sam.obrien@ni.com> | 2020-06-26 08:26:25 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-13 15:21:52 -0500 |
commit | b0cb065111dc3f40b89bdda76e9bd98f3e70b72e (patch) | |
tree | 4d08118999692767bc018d0a21758562abe1a300 /host/lib/include/uhdlib | |
parent | 14d9452a15a6e65b01e19e0d5ce0c67afc060cc2 (diff) | |
download | uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.tar.gz uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.tar.bz2 uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.zip |
rfnoc: Rename chdr_packet to chdr_packet_writer
It would be confusing to have two classes named chdr_packet. As it makes
more sense to name the new public chdr parser class chdr_packet, the
internal uhd::rfnoc::chdr::chdr_packet class is being renamed to
chdr_packet_writer to better represent its functionality.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'host/lib/include/uhdlib')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp | 2 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp | 4 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_packet_writer.hpp (renamed from host/lib/include/uhdlib/rfnoc/chdr_packet.hpp) | 45 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_rx_data_xport.hpp | 6 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_tx_data_xport.hpp | 6 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp | 2 | ||||
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp | 2 |
7 files changed, 36 insertions, 31 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp index 6f56fd956..61358fa2f 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_endpoint.hpp @@ -7,7 +7,7 @@ #pragma once #include <uhdlib/rfnoc/chdr_ctrl_xport.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/ctrlport_endpoint.hpp> #include <functional> #include <memory> diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp index bf3e03a6b..471a7bc11 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp @@ -6,7 +6,7 @@ #pragma once -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/transport/io_service.hpp> #include <mutex> @@ -145,7 +145,7 @@ private: sep_id_t _my_epid; // Packet for received data - chdr::chdr_packet::uptr _recv_packet; + chdr::chdr_packet_writer::uptr _recv_packet; send_io_if::sptr _send_if; recv_io_if::sptr _ctrl_recv_if; diff --git a/host/lib/include/uhdlib/rfnoc/chdr_packet.hpp b/host/lib/include/uhdlib/rfnoc/chdr_packet_writer.hpp index d56f94d0f..6f1c264dd 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_packet.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_packet_writer.hpp @@ -21,15 +21,16 @@ namespace uhd { namespace rfnoc { namespace chdr { // container provides a high level API to read and write the header, metadata and payload // of the packet. The payload can be accessed as a generic buffer using this interface. // -class chdr_packet +class chdr_packet_writer { public: - //! A unique pointer to a const chdr_packet. Useful as a read-only interface. - typedef std::unique_ptr<const chdr_packet> cuptr; - //! A unique pointer to a non-const chdr_packet. Useful as a read-write interface. - typedef std::unique_ptr<chdr_packet> uptr; + //! A unique pointer to a const chdr_packet_writer. Useful as a read-only interface. + typedef std::unique_ptr<const chdr_packet_writer> cuptr; + //! A unique pointer to a non-const chdr_packet_writer. Useful as a read-write + //! interface. + typedef std::unique_ptr<chdr_packet_writer> uptr; - virtual ~chdr_packet() = 0; + virtual ~chdr_packet_writer() = 0; /*! Updates the underlying storage of this packet. This is a const method and is * only useful for read-only (RX) access. @@ -177,16 +178,20 @@ public: // and deserialized appropriately. // template <typename payload_t> -class chdr_packet_specific +class chdr_packet_writer_specific { public: - //! A unique pointer to a const chdr_packet. Useful as a read-only interface. - typedef std::unique_ptr<const chdr_packet_specific<payload_t>> cuptr; - //! A unique pointer to a non-const chdr_packet. Useful as a read-write interface. - typedef std::unique_ptr<chdr_packet_specific<payload_t>> uptr; - - chdr_packet_specific(chdr_packet::uptr chdr_pkt) : _chdr_pkt(std::move(chdr_pkt)) {} - ~chdr_packet_specific() = default; + //! A unique pointer to a const chdr_packet_writer. Useful as a read-only interface. + typedef std::unique_ptr<const chdr_packet_writer_specific<payload_t>> cuptr; + //! A unique pointer to a non-const chdr_packet_writer. Useful as a read-write + //! interface. + typedef std::unique_ptr<chdr_packet_writer_specific<payload_t>> uptr; + + chdr_packet_writer_specific(chdr_packet_writer::uptr chdr_pkt) + : _chdr_pkt(std::move(chdr_pkt)) + { + } + ~chdr_packet_writer_specific() = default; //! Updates the underlying storage of this packet. This is a const method and is // only useful for read-only access. @@ -233,7 +238,7 @@ public: } private: - chdr_packet::uptr _chdr_pkt; + chdr_packet_writer::uptr _chdr_pkt; }; //---------------------------------------------------- @@ -241,16 +246,16 @@ private: //---------------------------------------------------- //! CHDR control packet -typedef chdr_packet_specific<ctrl_payload> chdr_ctrl_packet; +typedef chdr_packet_writer_specific<ctrl_payload> chdr_ctrl_packet; //! CHDR stream status packet -typedef chdr_packet_specific<strs_payload> chdr_strs_packet; +typedef chdr_packet_writer_specific<strs_payload> chdr_strs_packet; //! CHDR stream command packet -typedef chdr_packet_specific<strc_payload> chdr_strc_packet; +typedef chdr_packet_writer_specific<strc_payload> chdr_strc_packet; //! CHDR management packet -typedef chdr_packet_specific<mgmt_payload> chdr_mgmt_packet; +typedef chdr_packet_writer_specific<mgmt_payload> chdr_mgmt_packet; //---------------------------------------------------- // CHDR packet factory @@ -275,7 +280,7 @@ public: chdr_packet_factory(chdr_packet_factory&& rhs) = default; //! Makes a generic CHDR packet and transfers ownership to the client - chdr_packet::uptr make_generic( + chdr_packet_writer::uptr make_generic( size_t mtu_bytes = std::numeric_limits<size_t>::max()) const; //! Makes a CHDR control packet and transfers ownership to the client diff --git a/host/lib/include/uhdlib/rfnoc/chdr_rx_data_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_rx_data_xport.hpp index caa94bde3..d041f37c6 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_rx_data_xport.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_rx_data_xport.hpp @@ -8,7 +8,7 @@ #include <uhd/config.hpp> #include <uhd/exception.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/rfnoc_common.hpp> #include <uhdlib/rfnoc/rx_flow_ctrl_state.hpp> @@ -391,10 +391,10 @@ private: uint16_t _data_seq_num = 0; // Packet for received data - chdr::chdr_packet::uptr _recv_packet; + chdr::chdr_packet_writer::uptr _recv_packet; // Packet for received data used in callbacks - chdr::chdr_packet::uptr _recv_packet_cb; + chdr::chdr_packet_writer::uptr _recv_packet_cb; // Handles sending of strs flow control response packets detail::rx_flow_ctrl_sender _fc_sender; diff --git a/host/lib/include/uhdlib/rfnoc/chdr_tx_data_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_tx_data_xport.hpp index 777066c0a..4394adaea 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_tx_data_xport.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_tx_data_xport.hpp @@ -9,7 +9,7 @@ #include <uhd/exception.hpp> #include <uhd/types/metadata.hpp> #include <uhd/utils/log.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/rfnoc_common.hpp> #include <uhdlib/rfnoc/tx_flow_ctrl_state.hpp> @@ -378,10 +378,10 @@ private: chdr::chdr_header _send_header; // Packet for send data - chdr::chdr_packet::uptr _send_packet; + chdr::chdr_packet_writer::uptr _send_packet; // Packet to receive strs messages - chdr::chdr_packet::uptr _recv_packet; + chdr::chdr_packet_writer::uptr _recv_packet; // Handles sending of strc flow control ack packets detail::tx_flow_ctrl_sender _fc_sender; diff --git a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp index 3e1cdeee5..6cf224feb 100644 --- a/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp +++ b/host/lib/include/uhdlib/rfnoc/graph_stream_manager.hpp @@ -8,7 +8,7 @@ #include <uhd/stream.hpp> #include <uhd/transport/adapter_id.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_rx_data_xport.hpp> #include <uhdlib/rfnoc/chdr_tx_data_xport.hpp> #include <uhdlib/rfnoc/client_zero.hpp> diff --git a/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp b/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp index 806c9d1ea..223783170 100644 --- a/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp +++ b/host/lib/include/uhdlib/rfnoc/mgmt_portal.hpp @@ -7,7 +7,7 @@ #pragma once #include <uhdlib/rfnoc/chdr_ctrl_xport.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <memory> #include <set> |