Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Classes | Typedefs | Functions
Pothos::Util Namespace Reference

Classes

class  BlockDescriptionParser
 
class  Compiler
 
class  CompilerArgs
 
class  EvalEnvironment
 
class  FileLock
 
struct  Fundamental
 Determine the fundamental data type of T for primitive types. More...
 
struct  Fundamental< std::complex< T > >
 Overload for getting the fundamental type of std::complex<T> More...
 
struct  integer_sequence
 
class  OrderedQueue
 
class  RefHolder
 
class  RingDeque
 
class  SharedLock
 
class  SpinLock
 
class  SpinLockRW
 
class  UID
 
struct  unwrap_refwrapper
 
struct  unwrap_refwrapper< std::reference_wrapper< T > >
 

Typedefs

template<typename T >
using special_decay_t = typename unwrap_refwrapper< typename std::decay< T >::type >::type
 
template<std::size_t... Ints>
using index_sequence = integer_sequence< std::size_t, Ints... >
 
template<typename T , T N>
using make_integer_sequence = typename GenSeq< T, int(N)>::Type
 
template<std::size_t N>
using make_index_sequence = make_integer_sequence< std::size_t, N >
 
template<typename... T>
using index_sequence_for = make_index_sequence< sizeof...(T)>
 
template<typename BaseType , typename OtherType >
using disable_if_same = typename std::enable_if< not std::is_same< BaseType, typename std::decay< OtherType >::type >::value >::type
 

Functions

template<typename T0 , typename T1 >
int compareTo (const T0 &v0, const T1 &v1)
 
POTHOS_API bool isIPv6Supported (void)
 
POTHOS_API std::string getWildcardAddr (const std::string &service="")
 
POTHOS_API std::string getLoopbackAddr (const std::string &service="")
 
template<typename T , typename U >
fromQ (const U &in, const int n)
 
template<typename T , typename U >
fromQ (const U &in)
 
template<typename T , typename U >
floatToQ (const U &in, const int n)
 
template<typename T , typename U >
floatToQ (const U &in)
 
POTHOS_API std::string typeInfoToString (const std::type_info &type)
 

Typedef Documentation

◆ disable_if_same

template<typename BaseType , typename OtherType >
using Pothos::Util::disable_if_same = typedef typename std::enable_if< not std::is_same<BaseType, typename std::decay<OtherType>::type>::value>::type

Disable SFINAE type used with universal reference constructors

See also
http://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/

Function Documentation

◆ compareTo()

template<typename T0 , typename T1 >
int Pothos::Util::compareTo ( const T0 &  v0,
const T1 &  v1 
)

Compare two objects and return a integer result. The objects being compared require operator==() and operator<().

Parameters
v0value on the left hand side of the comparison
v1value on the right hand side of the comparison
Returns
0 for equal, -1 if v0 < v1, +1 if v0 > v1

◆ floatToQ() [1/2]

template<typename T , typename U >
T Pothos::Util::floatToQ ( const U &  in,
const int  n 
)

Convert a floating point number into Q format.

  • Floating point outputs are passed-through without change.
  • Fixed point outputs are shifted up by the number of fractional bits.
Template Parameters
Tthe output data type
Uthe input data type
Parameters
inthe input number
nthe number of fractional bits
Returns
the output number in Q format

◆ floatToQ() [2/2]

template<typename T , typename U >
T Pothos::Util::floatToQ ( const U &  in)

Convert a floating point number into Q format. The fractional bits default to half of the fixed point integer size.

◆ fromQ() [1/2]

template<typename T , typename U >
T Pothos::Util::fromQ ( const U &  in,
const int  n 
)

Convert from a Q format number.

  • Floating point inputs are passed-through without change.
  • Fixed point inputs are down-shifted by the number of fractional bits.
Template Parameters
Tthe output data type
Uthe input data type
Parameters
inthe input number in Q format
nthe number of fractional bits
Returns
the output number

◆ fromQ() [2/2]

template<typename T , typename U >
T Pothos::Util::fromQ ( const U &  in)

Convert from a Q format number. The fractional bits default to half of the fixed point integer size.

◆ getLoopbackAddr()

POTHOS_API std::string Pothos::Util::getLoopbackAddr ( const std::string &  service = "")

Get a functioning loopback address "::1" or "127.0.0.1".

Parameters
servicean optional service or port number
Returns
the loopback address (IPv6 is available)

◆ getWildcardAddr()

POTHOS_API std::string Pothos::Util::getWildcardAddr ( const std::string &  service = "")

Get a functioning wildcard address "::" or "0.0.0.0".

Parameters
servicean optional service or port number
Returns
the wildcard address (IPv6 is available)

◆ isIPv6Supported()

POTHOS_API bool Pothos::Util::isIPv6Supported ( void  )

Does this system support IPv6?

Returns
true if supported

◆ typeInfoToString()

POTHOS_API std::string Pothos::Util::typeInfoToString ( const std::type_info &  type)

Helper method to get the string representation of a type info. The implementation may look up in a table or demangles type.name().