Public Member Functions | Static Public Member Functions | List of all members
evdb::Printable Class Referenceabstract

Base class for printable objects. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/nuevdb/v1_00_02/source/nuevdb/EventDisplayBase/Printable.h"

Inheritance diagram for evdb::Printable:
evdb::Canvas evdb::ObjListCanvas evd::Display3DView evd::HardwareView evd::PlotView evd::XZYZProjectionsView evdb::testCanvas1 evd::MCTrueView

Public Member Functions

 Printable ()
 
virtual ~Printable ()
 
virtual void Print (const char *filename)=0
 
virtual const char * Description () const
 
virtual const char * PrintTag () const =0
 

Static Public Member Functions

static void AddToListOfPrintables (const char *name, evdb::Printable *p)
 
static void RemoveFromListOfPrintables (evdb::Printable *p)
 
static std::map< std::string, evdb::Printable * > & GetPrintables ()
 

Detailed Description

Base class for printable objects.

Definition at line 15 of file Printable.h.

Constructor & Destructor Documentation

evdb::Printable::Printable ( )

Definition at line 18 of file Printable.cxx.

18 { }
evdb::Printable::~Printable ( )
virtual

Definition at line 22 of file Printable.cxx.

References RemoveFromListOfPrintables().

23  {
25  }
static void RemoveFromListOfPrintables(evdb::Printable *p)
Definition: Printable.cxx:47

Member Function Documentation

void evdb::Printable::AddToListOfPrintables ( const char *  name,
evdb::Printable p 
)
static

Definition at line 29 of file Printable.cxx.

References om::cerr, and string.

Referenced by evdb::Canvas::Connect(), evdb::ObjListCanvas::Connect(), Description(), and evdb::testCanvas1::testCanvas1().

31  {
33 
34  if (gsPrintables[s] == 0) {
35  gsPrintables[s] = p;
36  }
37  else {
38  if (gsPrintables[s] != p) {
39  std::cerr << "Printable: Name " << name << " reused.\n";
40  std::abort();
41  }
42  }
43  }
const XML_Char * name
Definition: expat.h:151
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
const char * p
Definition: xmltok.h:285
OStream cerr
Definition: OStream.cxx:7
const XML_Char * s
Definition: expat.h:262
enum BeamMode string
virtual const char* evdb::Printable::Description ( ) const
inlinevirtual
std::map< std::string, evdb::Printable * > & evdb::Printable::GetPrintables ( )
static

Definition at line 61 of file Printable.cxx.

References evdb::gsPrintables.

Referenced by Description(), evd::SliceNavigator::postProcessEvent(), evdb::EventDisplay::postProcessEvent(), and evdb::PrintDialog::PrintDialog().

62  {
63  return gsPrintables;
64  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
virtual void evdb::Printable::Print ( const char *  filename)
pure virtual
virtual const char* evdb::Printable::PrintTag ( ) const
pure virtual
void evdb::Printable::RemoveFromListOfPrintables ( evdb::Printable p)
static

Definition at line 47 of file Printable.cxx.

Referenced by Description(), ~Printable(), and evdb::testCanvas1::~testCanvas1().

48  {
49  std::map<std::string,Printable*>::iterator itr(gsPrintables.begin());
50  std::map<std::string,Printable*>::iterator itrEnd(gsPrintables.end());
51  for (; itr!=itrEnd; ++itr) {
52  if ( itr->second == p) {
53  gsPrintables.erase(itr);
54  return;
55  }
56  }
57  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14

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