USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-gaea0e2de
UHD and USRP Manual
static.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011 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 #ifndef INCLUDED_UHD_UTILS_STATIC_HPP
9 #define INCLUDED_UHD_UTILS_STATIC_HPP
10 
11 #include <uhd/config.hpp>
12 
19 #define UHD_SINGLETON_FCN(_t, _x) \
20  static _t& _x() \
21  { \
22  static _t _x; \
23  return _x; \
24  }
25 
31 #define UHD_STATIC_BLOCK(_x) \
32  void _x(void); \
33  static _uhd_static_fixture _x##_fixture(&_x, #_x); \
34  void _x(void)
35 
38 {
39  _uhd_static_fixture(void (*)(void), const char*);
40 };
41 
42 #endif /* INCLUDED_UHD_UTILS_STATIC_HPP */
Helper for static block, constructor calls function.
Definition: static.hpp:37
#define UHD_API
Definition: config.h:68