libpnicore
Data Structures | Macros | Typedefs | Functions
Utility classes

Data Structures

class  pni::core::container_iterator< ITERABLE >
 iterator type More...
 
struct  pni::core::container_utils< CTYPE >
 container utility More...
 
struct  pni::core::container_utils< std::array< T, N > >
 container utility for std::array More...
 
struct  pni::core::or_t< T1, T2 >
 or type More...
 
struct  pni::core::and_t< T1, T2 >
 and type More...
 
struct  pni::core::not_t< T >
 logical not More...
 

Macros

#define DEPRECATED_FUNCTION(newfunc)
 runtime warning for functions More...
 

Typedefs

template<typename T >
using pni::core::invoke = typename T::type
 alias to invoke a metafunction More...
 
template<typename C >
using pni::core::enable_if = invoke< std::enable_if< C::value >>
 shortcut for std::enable_if
 
template<typename T >
using pni::core::is_pod = std::is_pod< T >
 shortcut for std::is_pod
 
template<typename T >
using pni::core::is_ptr = std::is_pointer< T >
 shortcut for std::is_pointer
 

Functions

template<typename CTYPE , typename... CTYPES>
bool pni::core::check_equal_size (const CTYPE &c, const CTYPES &...cs)
 check container sizes More...
 

Detailed Description

This module contains utilty classes used throughout the entire code.

Macro Definition Documentation

#define DEPRECATED_FUNCTION (   newfunc)
Value:
std::cerr<<"DEPRECATION WARNING:"<<std::endl; \
std::cerr<<""<<BOOST_CURRENT_FUNCTION;\
std::cerr<<" is deprecated use "<<newfunc<<" instread!";\
std::cerr<<std::endl

This macro inserts a warning message shown at runtime when a deprecated function or class member function is used. It should remaind the developer that the function in use will most probably vanish in a future release. Call the macro at the beginning of the deprecated function. It uses the BOOST_CURRENT_FUNCTION macro to get the name of the actual function. The only argument is the signature of the new function to be used instread.

1 void old_function()
2 {
3  DEPRECATED_FUNCTION("void new_function()");
4  .......
5 }
6 
7 void new_function()
8 {
9  .......
10 }

!

Parameters
newfuncthe new function to use

Typedef Documentation

template<typename T >
using pni::core::invoke = typedef typename T::type

Metafunction to retrieve the result type of another metafunction.

Template Parameters
Tmetafunction type

Function Documentation

template<typename CTYPE , typename... CTYPES>
bool pni::core::check_equal_size ( const CTYPE &  c,
const CTYPES &...  cs 
)

This variadic function compares the sizes of all the containers passed its arguments. If they are all equal true is returend, false otherwise.

typedef ... vector_type;
typedef ... list_type;
typedef std::vector<size_t,10> array_type;
vector_type v1(100);
list_type l1(100);
array_type a1;
check_equal_size(v1,l1); //returns true
check_equal_size(v1,l1,a1); //returns false

!

Template Parameters
CTYPEcontainer type of first argument
CTYPESresidual arguments types
Parameters
cfirst container instance
csresidual containers
Returns
true if all of samme size, false otherwise