fpmas 1.6
Namespaces | Classes | Functions
fpmas::utils Namespace Reference

Namespaces

namespace  perf
 

Classes

struct  Concat
 
struct  Max
 
struct  Min
 
class  VoidCallback
 

Functions

template<typename T1 , typename T2 >
api::utils::PtrWrapper< T1 > ptr_wrapper_cast (T2 *ptr)
 
template<typename T1 , typename T2 >
std::vector< api::utils::PtrWrapper< T1 > > ptr_wrapper_cast (std::vector< T2 * > vec)
 
std::string format (std::string input, int rank)
 
std::string format (std::string input, api::scheduler::TimeStep time)
 
std::string format (std::string input, int rank, api::scheduler::TimeStep time)
 
template<typename T >
std::string format (std::string input, std::string replace, T arg)
 

Detailed Description

Utility classes.

Function Documentation

◆ ptr_wrapper_cast() [1/2]

template<typename T1 , typename T2 >
api::utils::PtrWrapper< T1 > fpmas::utils::ptr_wrapper_cast ( T2 *  ptr)

ptr is converted to T1 using a dynamic_cast operation, and the result is wrapped and returned in an fpmas::api::utils::PtrWrapper instance.

If T1==T2, no dynamic_cast is performed and the result is just wrapped in an fpmas::api::utils::PtrWrapper instance.

Parameters
ptrpointer to cast
Returns
cast result wrapped in a PtrWrapper
Template Parameters
T1target type
T2source type

◆ ptr_wrapper_cast() [2/2]

template<typename T1 , typename T2 >
std::vector< api::utils::PtrWrapper< T1 > > fpmas::utils::ptr_wrapper_cast ( std::vector< T2 * >  vec)

Applies ptr_wrapper_cast to all items of the input vector and returns a new fpmas::api::utils::PtrWrapper vector.

Parameters
vecvector containing pointers to cast and wrap
Returns
cast and wrapped items
Template Parameters
T1items target type
T2items source type

◆ format() [1/4]

std::string fpmas::utils::format ( std::string  input,
int  rank 
)

Replaces "%r" sequences in input by rank.

Parameters
inputinput string
rankreplacement rank
Returns
formatted string

◆ format() [2/4]

std::string fpmas::utils::format ( std::string  input,
api::scheduler::TimeStep  time 
)

Replaces "%t" sequences in input by time.

Parameters
inputinput string
timereplacement time
Returns
formatted string

◆ format() [3/4]

std::string fpmas::utils::format ( std::string  input,
int  rank,
api::scheduler::TimeStep  time 
)

Replaces "%r" and "%t" sequences in input respectibely by rank and time.

Parameters
inputinput string
rankreplacement rank
timereplacement time
Returns
formatted string

◆ format() [4/4]

template<typename T >
std::string fpmas::utils::format ( std::string  input,
std::string  replace,
arg 
)

Replaces all the occurences of replace in the input string by arg, serialized using the output stream operator <<.

Parameters
inputinput string
replacesequence to replace
argreplacement
Returns
formatted string