USRP Hardware Driver and Device Manual  Version: 4.10.0.0-0-g2af4ddb9
UHD and USRP Manual
dict.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011,2015 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #pragma once
9 
10 #include <uhd/config.hpp>
11 #include <initializer_list>
12 #include <cstddef>
13 #include <list>
14 #include <map>
15 #include <utility>
16 #include <vector>
17 
18 namespace uhd {
19 
23 template <typename Key, typename Val>
25 {
26 public:
30  dict(void);
31 
38  template <typename InputIterator>
39  dict(InputIterator first, InputIterator last);
40 
41  dict(std::initializer_list<std::pair<Key, Val>> l);
42 
47  std::size_t size(void) const;
48 
54  std::vector<Key> keys(void) const;
55 
61  std::vector<Val> vals(void) const;
62 
68  bool has_key(const Key& key) const;
69 
76  const Val& get(const Key& key, const Val& other) const;
77 
83  const Val& get(const Key& key) const;
84 
90  void set(const Key& key, const Val& val);
91 
99  const Val& operator[](const Key& key) const;
100 
107  Val& operator[](const Key& key);
108 
114  bool operator==(const dict<Key, Val>& other) const;
115 
121  bool operator!=(const dict<Key, Val>& other) const;
122 
129  Val pop(const Key& key);
130 
146  void update(const dict<Key, Val>& new_dict, bool fail_on_conflict = true);
147 
150  operator std::map<Key, Val>() const;
151 
152 private:
153  typedef std::pair<Key, Val> pair_t;
154  std::list<pair_t> _map; // private container
155 };
156 
157 } // namespace uhd
158 
159 #include <uhd/types/dict.ipp>
Definition: dict.hpp:25
#define UHD_API_HEADER
Definition: config.h:88
UHD_INLINE bool operator!=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:71
Definition: build_info.hpp:12
bool operator==(const iq_dc_cal_coeffs_t &lhs, const iq_dc_cal_coeffs_t &rhs)
Definition: iq_dc_cal_coeffs.hpp:40