Evita  0.16
evObject.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evObject_h
25 #define __evObject_h
26 
27 
28 #include "evCommon.h"
29 
30 
31 class evObject
32 {
33 public:
34  evObject(void)
35  { }
36  virtual ~evObject(void)
37  { }
38  virtual const evString GetClassName(void) const
39  {
40  return(evString("evObject"));
41  }
42 
43  void Print(const int tabbing) const
44  {
45  this->PrintHeader(tabbing);
46  this->PrintSelf(tabbing + 2);
47  this->PrintTrailer(tabbing);
48  }
49  void Print(void) const
50  {
51  this->Print(0);
52  }
53 
54  virtual void PrintSelf(const int tabbing) const
55  {
56  printf("%s\n", this->GetClassName().GetString());
57  }
58 
59 protected:
60  evObject(const evObject &object)
61  { }
62 
63 private:
64  static int FirstObject;
65 
66  void PrintHeader(const int tabbing) const
67  {
68  if (tabbing == EVPRINT_NOFORMAT)
69  return;
70  if (tabbing == 0)
71  printf("---------------------------------------------------------------------------\n\n");
72  evPrintWithTab(tabbing, "Object: %s\n",
73  this->GetClassName().GetString());
74  }
75 
76  void PrintTrailer(const int tabbing) const
77  {
78  if (tabbing == EVPRINT_NOFORMAT)
79  return;
80  if (tabbing == 0)
81  printf("\n---------------------------------------------------------------------------\n\n");
82  }
83 
84 };
85 
86 
87 #endif
evObject(void)
Definition: evObject.h:34
void evPrintWithTab(const int tabbing, const char *format,...)
void Print(const int tabbing) const
Definition: evObject.h:43
void Print(void) const
Definition: evObject.h:49
evObject(const evObject &object)
Definition: evObject.h:60
virtual const evString GetClassName(void) const
Definition: evObject.h:38
virtual void PrintSelf(const int tabbing) const
Definition: evObject.h:54
void PrintTrailer(const int tabbing) const
Definition: evObject.h:76
static int FirstObject
Definition: evObject.h:64
#define EVPRINT_NOFORMAT
Definition: evMiscRoutines.h:34
void PrintHeader(const int tabbing) const
Definition: evObject.h:66
virtual ~evObject(void)
Definition: evObject.h:36
Definition: evObject.h:31
Definition: evString.h:30