Go to the documentation of this file.
30 #ifndef EXOTICA_CORE_PRINTABLE_H_
31 #define EXOTICA_CORE_PRINTABLE_H_
38 #include <Eigen/Geometry>
39 #include <kdl/frames.hpp>
42 #ifndef __PRETTY_FUNCTION__
43 #define __PRETTY_FUNCTION__ __func__
46 #ifdef EXOTICA_CORE_DEBUG_MODE
47 #define CHECK_EXECUTION std::cout << "\033[1;32m[EXOTica]:\033[0m Ok in " << __FILE__ << " at line " << __LINE__ << " within function " << __PRETTY_FUNCTION__ << ".\n";
48 #define INDICATE_FAILURE std::cerr << "\033[1;32m[EXOTica]:\033[0m \033[1;31mFailed in " << __FILE__ << " at line " << __LINE__ << " within function " << __PRETTY_FUNCTION__ << ".\033[0m\n";
49 #define WARNING(x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[33mWarning in " << __PRETTY_FUNCTION__ << ": " << x << "\033[0m\n";
50 #define ERROR(x) std::cerr << "\033[1;32m[EXOTica]:\033[0m \033[1;31mFailed in " << __FILE__ << " at line " << __LINE__ << " within function " << __PRETTY_FUNCTION__ << ".\n" \
51 << x << "\033[0m\n"; // With endline
52 #define INFO(x) std::clog << "\033[1;32m[EXOTica]:\033[0m Info in " << __PRETTY_FUNCTION__ << ": " << x << "\n"; // With endline
54 #define CHECK_EXECUTION // No operation
55 #define INDICATE_FAILURE std::cerr << "\033[1;32m[EXOTica]:\033[0m \033[1;31mFailed in " << __FILE__ << " at line " << __LINE__ << " within function " << __PRETTY_FUNCTION__ << ".\033[0m\n";
56 #define WARNING(x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[33mWarning in " << __PRETTY_FUNCTION__ << ": " << x << "\033[0m\n";
57 #define ERROR(x) std::cerr << "\033[1;32m[EXOTica]:\033[0m \033[1;31mFailed in " << __FILE__ << " at line " << __LINE__ << " within function " << __PRETTY_FUNCTION__ << ".\n" \
58 << x << "\033[0m\n"; // With endline
61 #define HIGHLIGHT(x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[36m" << x << "\033[0m\n";
62 #define HIGHLIGHT_NAMED(name, x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[35m[" << name << "]\033[0m \033[36m" << x << "\033[0m\n";
63 #define WARNING_NAMED(name, x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[35m[" << name << "]\033[0m \033[33m" << x << "\033[0m\n";
64 #define INFO_NAMED(name, x) std::cout << "\033[1;32m[EXOTica]:\033[0m \033[35m[" << name << "]\033[0m " << x << "\n";
65 #define INFO_PLAIN(x) std::cout << x << "\n";
72 virtual void Print(std::ostream& os)
const = 0;
78 std::ostream&
operator<<(std::ostream& os,
const std::vector<T>& s)
80 for (
auto& p : s) os << p <<
"\n";
84 template <
typename I,
typename T>
85 std::ostream&
operator<<(std::ostream& os,
const std::map<I, T>& s)
87 for (
auto& p : s) os << p.first <<
": " << p.second <<
"\n";
91 std::string
ToString(
const KDL::Frame& s);
93 std::string
ToString(
const Eigen::Isometry3d& s);
95 void PrintDimensions(
const std::string& name,
const Eigen::Ref<const Eigen::MatrixXd> m);
98 #endif // EXOTICA_CORE_PRINTABLE_H_
Definition: cartpole_dynamics_solver.h:38
Definition: printable.h:69
std::string ToString(const KDL::Frame &s)
virtual void Print(std::ostream &os) const =0
void PrintDimensions(const std::string &name, const Eigen::Ref< const Eigen::MatrixXd > m)
std::ostream & operator<<(std::ostream &os, const Printable &s)