| USRP Hardware Driver and Device Manual Version: 4.10.0.0 UHD and USRP Manual |

Loading...
Searching...
No Matches
container.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
10#include <stdint.h>
11#include <memory>
12#include <string>
13#include <vector>
14
15 namespace uhd { namespace usrp { namespace cal {
16
22 class UHD_API container
23{
24 public:
25 virtual ~container() = default;
26
28 virtual std::string get_name() const = 0;
29
31 virtual std::string get_serial() const = 0;
32
34 virtual uint64_t get_timestamp() const = 0;
35
37 virtual std::vector<uint8_t> serialize() = 0;
38
40 virtual void deserialize(const std::vector<uint8_t>& data) = 0;
41
43 //
44 // \tparam container_type The class type of cal data which should be
45 // generated from \p data
46 // \param data The serialized data to be turned into the cal class
47 template <typename container_type>
48 static std::shared_ptr<container_type> make(const std::vector<uint8_t>& data)
49 {
50 auto cal_data = container_type::make();
51 cal_data->deserialize(data);
52 return cal_data;
53 }
54};
55
56}}} // namespace uhd::usrp::cal
uhd::usrp::cal::container
Definition container.hpp:23
uhd::usrp::cal::container::~container
virtual ~container()=default
uhd::usrp::cal::container::make
static std::shared_ptr< container_type > make(const std::vector< uint8_t > &data)
Generic factory for cal data from serialized data.
Definition container.hpp:48
uhd::usrp::cal::container::get_name
virtual std::string get_name() const =0
Return the name of this calibration table.
uhd::usrp::cal::container::get_timestamp
virtual uint64_t get_timestamp() const =0
Timestamp of acquisition time.
uhd::usrp::cal::container::deserialize
virtual void deserialize(const std::vector< uint8_t > &data)=0
Populate this class from the serialized data.
uhd::usrp::cal::container::serialize
virtual std::vector< uint8_t > serialize()=0
Return a serialized version of this container.
uhd::usrp::cal::container::get_serial
virtual std::string get_serial() const =0
Return the device serial of this calibration table.
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
uhd::usrp::cal
Definition cal_utils.hpp:11
uhd::usrp
Definition cal_utils.hpp:11
uhd
Definition build_info.hpp:12