Loading...
Searching...
No Matches
dict.hpp
Go to the documentation of this file.
//
// Copyright 2010-2011,2015 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <cstddef>
#include <list>
#include <map>
#include <utility>
#include <vector>
namespace uhd {
template <typename Key, typename Val>
class UHD_API_HEADER dict
{
public:
dict(void);
template <typename InputIterator>
dict(InputIterator first, InputIterator last);
std::size_t size(void) const;
std::vector<Key> keys(void) const;
std::vector<Val> vals(void) const;
bool has_key(const Key& key) const;
const Val& get(const Key& key, const Val& other) const;
const Val& get(const Key& key) const;
void set(const Key& key, const Val& val);
const Val& operator[](const Key& key) const;
Val& operator[](const Key& key);
bool operator==(const dict<Key, Val>& other) const;
bool operator!=(const dict<Key, Val>& other) const;
Val pop(const Key& key);
void update(const dict<Key, Val>& new_dict, bool fail_on_conflict = true);
operator std::map<Key, Val>() const;
private:
typedef std::pair<Key, Val> pair_t;
std::list<pair_t> _map; // private container
};
} // namespace uhd
#include <uhd/types/dict.ipp>
uhd::dict::keys
std::vector< Key > keys(void) const
Definition dict.ipp:52
uhd::dict::vals
std::vector< Val > vals(void) const
Definition dict.ipp:62
uhd::dict::operator==
bool operator==(const dict< Key, Val > &other) const
Definition dict.ipp:129
uhd::dict::update
void update(const dict< Key, Val > &new_dict, bool fail_on_conflict=true)
Definition dict.ipp:163
uhd::dict::operator[]
const Val & operator[](const Key &key) const
Definition dict.ipp:108
uhd::dict::size
std::size_t size(void) const
Definition dict.ipp:46
uhd::dict::operator!=
bool operator!=(const dict< Key, Val > &other) const
Definition dict.ipp:143
uhd::dict::has_key
bool has_key(const Key &key) const
Definition dict.ipp:72
uhd::dict::dict
dict(void)
Definition dict.ipp:33
uhd::dict::get
const Val & get(const Key &key, const Val &other) const
Definition dict.ipp:82
uhd::dict::pop
Val pop(const Key &key)
Definition dict.ipp:149
uhd::dict::set
void set(const Key &key, const Val &val)
Definition dict.ipp:102
UHD_API_HEADER
#define UHD_API_HEADER
Definition config.h:88
config.hpp
dict.ipp
uhd
Definition build_info.hpp:12