USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-ga1b5c4ae
UHD and USRP Manual
container.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2016 Ettus Research
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_UHD_CAL_CONTAINER_HPP
9 #define INCLUDED_UHD_CAL_CONTAINER_HPP
10 
11 #include <uhd/config.hpp>
12 #include <boost/serialization/serialization.hpp>
13 #include <boost/serialization/vector.hpp>
14 #include <boost/serialization/string.hpp>
15 #include <boost/serialization/map.hpp>
16 #include <boost/archive/text_iarchive.hpp>
17 #include <boost/archive/text_oarchive.hpp>
18 #include <boost/shared_ptr.hpp>
19 
20 namespace uhd {
21 namespace cal {
22 
24 public:
25  typedef std::map<std::string, std::string> metadata_t;
26  typedef boost::shared_ptr<base_container> sptr;
27 };
28 
40 template<typename in_type, typename out_type>
42 public:
43  typedef std::map<in_type, out_type> container_t;
44 
54  virtual out_type get(const in_type &args) = 0;
55 
64  virtual void add(const out_type output, const in_type &args) = 0;
65 
71  virtual void add_metadata(const metadata_t &data) = 0;
72 
78  virtual const metadata_t &get_metadata() = 0;
79 
80 public:
81  typedef boost::archive::text_iarchive iarchive_type;
82  typedef boost::archive::text_oarchive oarchive_type;
83 
84 protected:
85  friend class boost::serialization::access;
86 
87  virtual void serialize(iarchive_type & ar, const unsigned int) = 0;
88  virtual void serialize(oarchive_type & ar, const unsigned int) = 0;
89 };
90 
91 } // namespace cal
92 } // namespace uhd
93 
94 #endif /* INCLUDED_UHD_CAL_CONTAINER_HPP */
boost::archive::text_oarchive oarchive_type
Definition: container.hpp:82
boost::shared_ptr< base_container > sptr
Definition: container.hpp:26
Definition: build_info.hpp:14
#define UHD_API
Definition: config.h:63
boost::archive::text_iarchive iarchive_type
Definition: container.hpp:81
Definition: container.hpp:41
Definition: container.hpp:23
std::map< std::string, std::string > metadata_t
Definition: container.hpp:25
std::map< in_type, out_type > container_t
Definition: container.hpp:43