USRP Hardware Driver and USRP Manual  Version: 4.6.0.0
UHD and USRP Manual
static.hpp File Reference
#include <uhd/config.hpp>

Go to the source code of this file.

Classes

struct  _uhd_static_fixture
 Helper for static block, constructor calls function. More...
 

Macros

#define UHD_SINGLETON_FCN(_t, _x)
 
#define UHD_STATIC_BLOCK(_x)
 

Macro Definition Documentation

◆ UHD_SINGLETON_FCN

#define UHD_SINGLETON_FCN (   _t,
  _x 
)
Value:
static _t& _x() \
{ \
static _t _x; \
return _x; \
}

Defines a function that implements the "construct on first use" idiom

Parameters
_tthe type definition for the instance
_xthe name of the defined function
Returns
a reference to the lazy instance

◆ UHD_STATIC_BLOCK

#define UHD_STATIC_BLOCK (   _x)
Value:
void _x(void); \
static _uhd_static_fixture _x##_fixture(&_x, #_x); \
void _x(void)
Helper for static block, constructor calls function.
Definition: static.hpp:36

Defines a static code block that will be called before main() The static block will catch and print exceptions to std error.

Parameters
_xthe unique name of the fixture (unique per source)