Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::JObjectTypewriter< T > Class Template Reference

Implementation for printing of a template class. More...

#include <JRootTypewriter.hh>

Inheritance diagram for JROOT::JObjectTypewriter< T >:
JROOT::JAbstractTypewriter

Public Member Functions

virtual void print (std::ostream &out, const char *po) const override
 Print object.
 
void print (std::ostream &out, const char *po) const
 Specialisation of print method for TString.
 
void print (std::ostream &out, const char *po) const
 Specialisation of print method for std::string.
 
void print (std::ostream &out, const char *po) const
 Specialisation of print method for unsigned char.
 
void print (std::ostream &out, const char *po) const
 Specialisation of print method for unsigned char.
 

Detailed Description

template<class T>
class JROOT::JObjectTypewriter< T >

Implementation for printing of a template class.

This class implements the JROOT::JAstractTypewriter interface for the given template class.

Definition at line 66 of file JRootTypewriter.hh.

Member Function Documentation

◆ print() [1/5]

template<class T >
virtual void JROOT::JObjectTypewriter< T >::print ( std::ostream & out,
const char * po ) const
inlineoverridevirtual

Print object.

Parameters
outoutput stream
popointer to object

Implements JROOT::JAbstractTypewriter.

Definition at line 76 of file JRootTypewriter.hh.

77 {
78 out << * ((const T*) po);
79 }

◆ print() [2/5]

void JROOT::JObjectTypewriter< TString >::print ( std::ostream & out,
const char * po ) const
virtual

Specialisation of print method for TString.

Parameters
outoutput stream
popointer to object

Implements JROOT::JAbstractTypewriter.

Definition at line 90 of file JRootTypewriter.hh.

91 {
92 const TString* str = (const TString*) po;
93
94 if (!str->IsNull()) {
95 out << "\"" << *str << "\"";
96 }
97 }

◆ print() [3/5]

void JROOT::JObjectTypewriter< std::string >::print ( std::ostream & out,
const char * po ) const
virtual

Specialisation of print method for std::string.

Parameters
outoutput stream
popointer to object

Implements JROOT::JAbstractTypewriter.

Definition at line 107 of file JRootTypewriter.hh.

108 {
109 out << "\"" << * ((const std::string*) po) << "\"";
110 }

◆ print() [4/5]

void JROOT::JObjectTypewriter< char >::print ( std::ostream & out,
const char * po ) const
virtual

Specialisation of print method for unsigned char.

Parameters
outoutput stream
popointer to object

Implements JROOT::JAbstractTypewriter.

Definition at line 120 of file JRootTypewriter.hh.

121 {
122 using namespace std;
123
124 out << "0x" << hex << (int) *po << dec;
125 }

◆ print() [5/5]

void JROOT::JObjectTypewriter< unsignedchar >::print ( std::ostream & out,
const char * po ) const
virtual

Specialisation of print method for unsigned char.

Parameters
outoutput stream
popointer to object

Implements JROOT::JAbstractTypewriter.

Definition at line 135 of file JRootTypewriter.hh.

136 {
137 using namespace std;
138
139 out << "\0x" << hex << (unsigned int) *po << dec;
140 }

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