PUMA Library Reference Manual
Puma::Printable Class Referenceabstract

#include <Puma/Printable.h>

+ Inheritance diagram for Puma::Printable:

Description

Provides that possibility for an object to be used with output streams (std::ostream). Derived classes have to implement method Printable::print().

Example:

class Name : public Puma::Printable {
const char* the_name;
public:
Name(const char* n) : the_name(n) {}
void print(ostream &os) {
os << "[name: " << the_name << "]";
}
};
Name adam("adam");
std::cout << adam << std::endl; // prints "[name: adam]\n"

Public Member Functions

virtual ~Printable ()
 Destructor. More...
 
virtual void print (std::ostream &os) const =0
 Print object information on the given output stream. More...
 

Constructor & Destructor Documentation

◆ ~Printable()

virtual Puma::Printable::~Printable ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ print()

virtual void Puma::Printable::print ( std::ostream &  os) const
pure virtual

Print object information on the given output stream.

To be implemented by concrete objects.

Parameters
osThe output stream.

Implemented in Puma::Filename, Puma::CT_QualName, Puma::CT_SimpleName, Puma::CTypeInfo, Puma::Unit, Puma::ManipError, and Puma::DeducedArgument.

Puma::Printable::print
virtual void print(std::ostream &os) const =0
Print object information on the given output stream.
Puma::Printable
Definition: Printable.h:49