USRP Hardware Driver and USRP Manual  Version: 003.009.000-0-gcd88f80f
UHD and USRP Manual
dboard_id.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_DBOARD_ID_HPP
19 #define INCLUDED_UHD_USRP_DBOARD_ID_HPP
20 
21 #include <uhd/config.hpp>
22 #include <boost/cstdint.hpp>
23 #include <boost/operators.hpp>
24 #include <string>
25 
26 namespace uhd{ namespace usrp{
27 
28  class UHD_API dboard_id_t : boost::equality_comparable<dboard_id_t>{
29  public:
34  dboard_id_t(boost::uint16_t id = 0xffff);
35 
40  static dboard_id_t none(void);
41 
47  static dboard_id_t from_uint16(boost::uint16_t uint16);
48 
53  boost::uint16_t to_uint16(void) const;
54 
61  static dboard_id_t from_string(const std::string &string);
62 
67  std::string to_string(void) const;
68 
73  std::string to_cname(void) const;
74 
79  std::string to_pp_string(void) const;
80 
81  private:
82  boost::uint16_t _id; //internal representation
83  };
84 
92  UHD_API bool operator==(const dboard_id_t &lhs, const dboard_id_t &rhs);
93 
94 }} //namespace
95 
96 #endif /* INCLUDED_UHD_USRP_DBOARD_ID_HPP */
Definition: dboard_id.hpp:28
UHD_API bool operator==(const dboard_id_t &lhs, const dboard_id_t &rhs)
Definition: convert.hpp:28
#define UHD_API
Definition: config.h:66