LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evdb::Printable Class Referenceabstract

Base class for printable objects. More...

#include "Printable.h"

Inheritance diagram for evdb::Printable:
evdb::Canvas evdb::ObjListCanvas evd::CalorView evd::Display3DView evd::Ortho3DView evd::TWQMultiTPCProjectionView evd::TWQProjectionView evdb::testCanvas1

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.

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

31  {
32  std::string s(name);
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  }
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14
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(), 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
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  {
51  for (; itr!=itrEnd; ++itr) {
52  if ( itr->second == p) {
53  gsPrintables.erase(itr);
54  return;
55  }
56  }
57  }
intermediate_table::iterator iterator
static std::map< std::string, evdb::Printable * > gsPrintables
Definition: Printable.cxx:14

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