List of all members | Friends
casadi::Printable< Derived > Class Template Reference

Base class for objects that have a natural string representation. More...

#include <printable.hpp>

Detailed Description

template<class Derived>
class casadi::Printable< Derived >

Author
Joel Andersson
Date
2010-2014

Extra doc: https://github.com/casadi/casadi/wiki/L_7i

Definition at line 62 of file printable.hpp.

Inheritance diagram for casadi::Printable< Derived >:
Inheritance graph
[legend]
Collaboration diagram for casadi::Printable< Derived >:
Collaboration graph
[legend]

Friends

std::ostream & operator<< (std::ostream &stream, const Derived &obj)
 Print a string representation of the object to a stream. More...
 
std::string repr (const Derived &obj)
 Get string representation with type information. More...
 

Friends And Related Function Documentation

◆ operator<<

template<class Derived >
std::ostream& operator<< ( std::ostream &  stream,
const Derived &  obj 
)
friend

Definition at line 66 of file printable.hpp.

66  {
67  obj.disp(stream);
68  return stream;
69  }

◆ repr

template<class Derived >
std::string repr ( const Derived &  obj)
friend

Definition at line 72 of file printable.hpp.

72  {
73  return Derived::type_name() + "(" + obj.get_str() + ")";
74  }

The documentation for this class was generated from the following file: