Jpp 19.3.0-rc.2
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 68 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 78 of file JRootTypewriter.hh.

79 {
80 out << * ((const T*) po);
81 }

◆ 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 92 of file JRootTypewriter.hh.

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

◆ 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 109 of file JRootTypewriter.hh.

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

◆ 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 122 of file JRootTypewriter.hh.

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

◆ 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 137 of file JRootTypewriter.hh.

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

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