PandA-2024.02
Data Structures | Macros | Functions
utility.hpp File Reference

This file collects some utility functions and macros. More...

#include "panda_types.hpp"
#include "string_manipulation.hpp"
#include "config_HAVE_ASSERTS.hpp"
#include <boost/concept/usage.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/lexical_cast.hpp>
#include <limits>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for utility.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  string_separator
 Functor to tokenize string used with boost::tokenizer. More...
 
struct  check_long_double< T >
 Concept checking class This class is used to check that an object can be converted into long double. More...
 
struct  TimeStamp
 The type used for timestamp. More...
 

Macros

#define STR_CST_string_separator   std::string(1, 31)
 The character used to separate concatenated string. More...
 
#define STR_CST_string_separator_char   static_cast<char>(31)
 The character used to separate concatenated string. More...
 
#define INFINITE_INT   (std::numeric_limits<int>::max())
 INT representing infinite. More...
 
#define INFINITE_UINT   (std::numeric_limits<unsigned int>::max())
 UNSIGNED INT representing infinite. More...
 
#define INFINITE_SIZE_T   (std::numeric_limits<size_t>::max())
 SIZE_T representing infinite. More...
 
#define INFINITE_DOUBLE   (std::numeric_limits<double>::max())
 DOUBLE representing infinite. More...
 
#define INFINITE_LONG_DOUBLE   (std::numeric_limits<long double>::max())
 long double representing infinite More...
 
#define INFINITE_ULONGLONG_INT   (std::numeric_limits<unsigned long long int>::max())
 LONGLONG representing infinite. More...
 
#define MINUS_INFINITE_LONG_DOUBLE   (std::numeric_limits<long double>::min())
 long double representing -infinite More...
 
#define DEBUG_PARAMETER(parameter)   parameter
 macro used to solve problem of parameters used only in not-release More...
 
#define ASSERT_PARAMETER(parameter)
 
#define GET_CLASS_NAME(meth)   #meth
 Macro returning the name of a class. More...
 
#define GET_FUNCTION_DEBUG_LEVEL(parameters)   parameters->GetFunctionDebugLevel(GET_CLASS(*this), __func__)
 Macro returning the debug_level of a function. More...
 

Functions

template<class G >
std::string convert_to_binary (G _value, unsigned long long precision)
 
template<typename _InputIt >
std::string container_to_string (_InputIt first, _InputIt last, const std::string &separator, bool trim_empty=true)
 
template<typename _Container >
std::string container_to_string (const _Container &_c, const std::string &separator, bool trim_empty=true)
 
template<typename _OutputIt >
constexpr void string_to_container (_OutputIt first, const std::string &str, const std::string &separator, bool trim_empty=true)
 
template<typename _Container >
constexpr _Container string_to_container (const std::string &str, const std::string &separator, bool trim_empty=true)
 
template<class T >
void ShuffleVector (typename std::vector< T > &shuffle, const unsigned int seed)
 Randomly shuffle a vector. More...
 

Detailed Description

This file collects some utility functions and macros.

Author
Fabrizio Ferrandi fabri.nosp@m.zio..nosp@m.ferra.nosp@m.ndi@.nosp@m.polim.nosp@m.i.it
Marco Lattuada lattu.nosp@m.ada@.nosp@m.elet..nosp@m.poli.nosp@m.mi.it
Christian Pilato pilat.nosp@m.o@el.nosp@m.et.po.nosp@m.limi.nosp@m..it

Definition in file utility.hpp.

Macro Definition Documentation

◆ ASSERT_PARAMETER

#define ASSERT_PARAMETER (   parameter)

Definition at line 96 of file utility.hpp.

Referenced by tree_manager::find_identifier_nodeID().

◆ DEBUG_PARAMETER

#define DEBUG_PARAMETER (   parameter)    parameter

macro used to solve problem of parameters used only in not-release

Definition at line 91 of file utility.hpp.

◆ GET_CLASS_NAME

#define GET_CLASS_NAME (   meth)    #meth

◆ GET_FUNCTION_DEBUG_LEVEL

#define GET_FUNCTION_DEBUG_LEVEL (   parameters)    parameters->GetFunctionDebugLevel(GET_CLASS(*this), __func__)

Macro returning the debug_level of a function.

Definition at line 107 of file utility.hpp.

Referenced by tree_manager::create_tree_node(), tree_manager::get_next_vers(), and tree_manager::RecursiveReplaceTreeNode().

◆ INFINITE_DOUBLE

#define INFINITE_DOUBLE   (std::numeric_limits<double>::max())

DOUBLE representing infinite.

Definition at line 76 of file utility.hpp.

◆ INFINITE_INT

#define INFINITE_INT   (std::numeric_limits<int>::max())

INT representing infinite.

Definition at line 67 of file utility.hpp.

◆ INFINITE_LONG_DOUBLE

#define INFINITE_LONG_DOUBLE   (std::numeric_limits<long double>::max())

long double representing infinite

Definition at line 79 of file utility.hpp.

Referenced by SpiderParameter::SetDefaults().

◆ INFINITE_SIZE_T

#define INFINITE_SIZE_T   (std::numeric_limits<size_t>::max())

SIZE_T representing infinite.

Definition at line 73 of file utility.hpp.

◆ INFINITE_UINT

#define INFINITE_UINT   (std::numeric_limits<unsigned int>::max())

◆ INFINITE_ULONGLONG_INT

#define INFINITE_ULONGLONG_INT   (std::numeric_limits<unsigned long long int>::max())

LONGLONG representing infinite.

Definition at line 82 of file utility.hpp.

◆ MINUS_INFINITE_LONG_DOUBLE

#define MINUS_INFINITE_LONG_DOUBLE   (std::numeric_limits<long double>::min())

long double representing -infinite

Definition at line 85 of file utility.hpp.

◆ STR_CST_string_separator

#define STR_CST_string_separator   std::string(1, 31)

◆ STR_CST_string_separator_char

#define STR_CST_string_separator_char   static_cast<char>(31)

The character used to separate concatenated string.

Definition at line 64 of file utility.hpp.

Function Documentation

◆ container_to_string() [1/2]

template<typename _InputIt >
std::string container_to_string ( _InputIt  first,
_InputIt  last,
const std::string &  separator,
bool  trim_empty = true 
)

◆ container_to_string() [2/2]

template<typename _Container >
std::string container_to_string ( const _Container &  _c,
const std::string &  separator,
bool  trim_empty = true 
)

Definition at line 142 of file utility.hpp.

References container_to_string().

Here is the call graph for this function:

◆ convert_to_binary()

template<class G >
std::string convert_to_binary ( _value,
unsigned long long  precision 
)

Definition at line 110 of file utility.hpp.

References symmetry::value.

Referenced by mux_connection_binding::determine_connection(), HLS_manager::get_constant_string(), Bit_Value_opt::optimize(), and fu_binding::specialise_fu().

Here is the caller graph for this function:

◆ ShuffleVector()

template<class T >
void ShuffleVector ( typename std::vector< T > &  shuffle,
const unsigned int  seed 
)

Randomly shuffle a vector.

Parameters
shuffleis the vector to be shuffled
seedis the seed to be used in the random generator

Definition at line 263 of file utility.hpp.

References k.

◆ string_to_container() [1/2]

template<typename _OutputIt >
constexpr void string_to_container ( _OutputIt  first,
const std::string &  str,
const std::string &  separator,
bool  trim_empty = true 
)

Definition at line 148 of file utility.hpp.

Referenced by add_evaluation_objective_string(), read_technology_File(), string_to_container(), and HLSCWriter::WriteHeader().

Here is the caller graph for this function:

◆ string_to_container() [2/2]

template<typename _Container >
constexpr _Container string_to_container ( const std::string &  str,
const std::string &  separator,
bool  trim_empty = true 
)

Definition at line 167 of file utility.hpp.

References string_to_container().

Here is the call graph for this function:

Generated on Mon Feb 12 2024 13:03:36 for PandA-2024.02 by doxygen 1.8.13