Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

evdb::Printable Class Reference

Base class for printable objects. More...

#include <Printable.h>

Inheritance diagram for evdb::Printable:

evdb::Canvas evd::DetectorView evd::PlaneView testCanvas1 testCanvas2 TestDisplay List of all members.

Public Member Functions

 Printable ()
virtual ~Printable ()
virtual void Print (const char *filename)=0
 Print the object to a file.

virtual const char * Description () const
virtual const char * PrintTag () const=0

Static Public Member Functions

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

Detailed Description

Base class for printable objects.

Definition at line 16 of file Printable.h.


Constructor & Destructor Documentation

Printable::Printable  ) 
 

Definition at line 18 of file Printable.cxx.

00018 { }

Printable::~Printable  )  [virtual]
 

Definition at line 22 of file Printable.cxx.

00023 {
00024   Printable::RemoveFromListOfPrintables(this);
00025 }


Member Function Documentation

void Printable::AddToListOfPrintables const char *  name,
Printable p
[static]
 

Definition at line 29 of file Printable.cxx.

References gsPrintables.

Referenced by testCanvas1::testCanvas1(), and testCanvas2::testCanvas2().

00031  {
00032   std::string s(name);
00033 
00034   if (gsPrintables[s] == 0) {
00035     gsPrintables[s] = p;
00036   }
00037   else {
00038     if (gsPrintables[s] != p) {
00039       std::cerr << "Printable: Name " << name << " reused.\n";
00040       abort();
00041     }
00042   }
00043 }

virtual const char* evdb::Printable::Description  )  const [inline, virtual]
 

Give a medium length description of what the view holds to be printed. Examples: "Full view of experiment", "3D View", ...

Reimplemented in evd::DetectorView, evd::PlaneView, evdb::Canvas, testCanvas1, and testCanvas2.

Definition at line 26 of file Printable.h.

00026 { return "??"; }

std::map< std::string, Printable * > & Printable::GetPrintables  )  [static]
 

Definition at line 61 of file Printable.cxx.

References gsPrintables.

00062 {
00063   return gsPrintables;
00064 }

virtual void evdb::Printable::Print const char *  filename  )  [pure virtual]
 

Print the object to a file.

Implemented in evdb::Canvas.

Referenced by evdb::PrintDialog::Print().

virtual const char* evdb::Printable::PrintTag  )  const [pure virtual]
 

Give a short tag which can be included in filename to ID object printed Keep to ~4 characters

Implemented in evd::DetectorView, evd::PlaneView, evdb::Canvas, testCanvas1, and testCanvas2.

void Printable::RemoveFromListOfPrintables Printable p  )  [static]
 

Definition at line 47 of file Printable.cxx.

References gsPrintables.

Referenced by testCanvas1::~testCanvas1(), and testCanvas2::~testCanvas2().

00048 {
00049   std::map<std::string,Printable*>::iterator itr(gsPrintables.begin());
00050   std::map<std::string,Printable*>::iterator itrEnd(gsPrintables.end());
00051   for (; itr!=itrEnd; ++itr) {
00052     if ( itr->second == p) {
00053       gsPrintables.erase(itr);
00054       return;
00055     }
00056   }
00057 }


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 02:05:53 2008 for NOvA Offline by doxygen 1.3.5