Loading...
Searching...
No Matches
container.hpp
Go to the documentation of this file.
//
// Copyright 2020 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
namespace uhd { namespace usrp { namespace cal {
class UHD_API container
{
public:
virtual ~container() = default;
virtual std::string get_name() const = 0;
virtual std::string get_serial() const = 0;
virtual uint64_t get_timestamp() const = 0;
virtual std::vector<uint8_t> serialize() = 0;
virtual void deserialize(const std::vector<uint8_t>& data) = 0;
//
// \tparam container_type The class type of cal data which should be
// generated from \p data
// \param data The serialized data to be turned into the cal class
template <typename container_type>
static std::shared_ptr<container_type> make(const std::vector<uint8_t>& data)
{
auto cal_data = container_type::make();
cal_data->deserialize(data);
return cal_data;
}
};
}}} // 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 container.hpp:15
uhd::usrp
Definition container.hpp:15
uhd
Definition build_info.hpp:12