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