The Sparta Modeling Framework
|
Helpers for printing and populating vectors. More...
#include <iostream>
#include <string>
#include <ostream>
#include <vector>
#include <sstream>
#include "sparta/utils/SpartaException.hpp"
Go to the source code of this file.
Namespaces | |
namespace | sparta |
Macros for handling exponential backoff. | |
Enumerations | |
enum | sparta::utils::DisplayBase { BASE_DEC = 0 , sparta::utils::BASE_HEX = 1 , sparta::utils::BASE_OCT = 2 } |
Numeric display options used by Parameter printing routines. More... | |
Functions | |
std::ios_base::fmtflags | sparta::utils::setIOSFlags (std::ios_base &stream, DisplayBase base) |
Configure an ios stream to use given numeric base from sparta::DisplayBase. | |
template<class T > | |
std::string | sparta::utils::stringize_value (const std::vector< T > &v, DisplayBase base=BASE_DEC, const std::string &string_quote="") |
Converting a vector of intrinsic types (and std::string) to a string. | |
template<class T , class U > | |
std::string | sparta::utils::stringize_value (const std::pair< T, U > &p, DisplayBase base=BASE_DEC, const std::string &string_quote="") |
Converting a stl pair of intrinsic types (and std::string) to a string. | |
template<class... Ts> | |
std::string | sparta::utils::stringize_value (const std::tuple< Ts... > &t, DisplayBase base=BASE_DEC, const std::string &string_quote="") |
Converting a stl tuple of intrinsic types (and std::string) to a string. | |
template<class T > | |
std::string | sparta::utils::stringize_value (const T &o, DisplayBase base=BASE_DEC, const std::string &string_quote="") |
Overload of stringize_value that supports intrinisic types as well as std::string. | |
template<> | |
std::string | sparta::utils::stringize_value< std::string > (const std::string &o, DisplayBase base, const std::string &string_quote) |
Specialization for printing strings. | |
std::vector< std::string > & | sparta::utils::operator<< (std::vector< std::string > &v, const char *e) |
Specialization for populating STL vector of string with char*s. | |
template<class T , class U > | |
std::vector< T > & | sparta::utils::operator<< (std::vector< T > &v, U &e) |
Helper for populating STL vectors. | |
template<class T , class U > | |
std::vector< T > & | sparta::utils::operator<< (std::vector< T > &v, const U &e) |
Helper for populating STL vector. | |
template<class T , std::size_t... Is> | |
void | sparta::utils::stringize_tuple (std::stringstream &ss, const T &t, DisplayBase base, const std::string &string_quote, std::index_sequence< Is... >) |
Helper for printing STL tuple. | |
template<class Ch , class T , class Tr > | |
std::basic_ostream< Ch, Tr > & | std::operator<< (std::basic_ostream< Ch, Tr > &out, std::vector< T > const &v) |
Vector printer. | |
template<class Ch , class T , class U , class Tr > | |
std::basic_ostream< Ch, Tr > & | std::operator<< (std::basic_ostream< Ch, Tr > &out, std::pair< T, U > const &p) |
Pair Printer. | |
template<class Ch , class... Ts, class Tr > | |
std::basic_ostream< Ch, Tr > & | std::operator<< (std::basic_ostream< Ch, Tr > &out, std::tuple< Ts... > const &t) |
Tuple Printer. | |
std::vector< std::string > & | operator<< (std::vector< std::string > &v, const char *e) |
Specialization for populating STL vector of string with char*s. | |
template<class T , class U > | |
std::vector< T > & | operator<< (std::vector< T > &v, U &e) |
Helper for populating STL vectors. | |
template<class T , class U > | |
std::vector< T > & | operator<< (std::vector< T > &v, const U &e) |
Helper for populating STL vector. | |
Helpers for printing and populating vectors.
Definition in file Printing.hpp.
Numeric display options used by Parameter printing routines.
Enumerator | |
---|---|
BASE_HEX | Decimal display. |
BASE_OCT | Hex display. |
Definition at line 27 of file Printing.hpp.
|
inline |
Pair Printer.
Definition at line 193 of file Printing.hpp.
|
inline |
Tuple Printer.
Definition at line 193 of file Printing.hpp.
|
inline |
Vector printer.
Definition at line 193 of file Printing.hpp.
|
inline |
Specialization for populating STL vector of string with char*s.
Definition at line 1 of file Printing.hpp.
|
inline |
Specialization for populating STL vector of string with char*s.
Definition at line 161 of file Printing.hpp.
|
inline |
Helper for populating STL vector.
Definition at line 1 of file Printing.hpp.
|
inline |
Helper for populating STL vector.
Definition at line 161 of file Printing.hpp.
|
inline |
Helper for populating STL vectors.
Definition at line 1 of file Printing.hpp.
|
inline |
Helper for populating STL vectors.
Definition at line 161 of file Printing.hpp.
|
inline |
Configure an ios stream to use given numeric base from sparta::DisplayBase.
stream | Stream reference to configure with given sparta::DisplayBase base. |
base | sparta::DisplayBase describing the new formatting. |
SpartaException | if base is not a supported type. |
Definition at line 43 of file Printing.hpp.
|
inline |
Helper for printing STL tuple.
Definition at line 193 of file Printing.hpp.
|
inline |
Converting a stl pair of intrinsic types (and std::string) to a string.
T | first type in pair to stringize |
U | second type in pair to stringize |
p | pair to print (of type <T,U>) |
base | Base of displayed integers |
string_quote | Quote sequence for printing strings; defaults to no quoting |
Definition at line 111 of file Printing.hpp.
|
inline |
Converting a stl tuple of intrinsic types (and std::string) to a string.
Ts | types of tuple |
t | tuple to print |
base | Base of displayed integers |
string_quote | Quote sequence for printing strings; defaults to no quoting |
Definition at line 131 of file Printing.hpp.
|
inline |
Converting a vector of intrinsic types (and std::string) to a string.
T | type of vector to stringize |
v | vector to print (value_type=T) |
base | Base of displayed integers |
string_quote | Quote sequence for printing strings; defaults to no quoting |
Definition at line 80 of file Printing.hpp.
|
inline |
Overload of stringize_value that supports intrinisic types as well as std::string.
Invoking stringize_value with a non-std::vector type will invoke this method.
Definition at line 149 of file Printing.hpp.
|
inline |
Specialization for printing strings.
Definition at line 161 of file Printing.hpp.