CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
code/src/datafile/vEvent.cc
Go to the documentation of this file.
1 
9 #include "vEvent.hh"
10 #include "vDataFile.hh"
11 #include "sOutputManager.hh"
12 
13 // =====================================================================
14 // ---------------------------------------------------------------------
15 // ---------------------------------------------------------------------
16 // =====================================================================
17 
19 {
20  m_timeInMs = 0;
21  m_nbLines = 0;
22  mp_ID1 = NULL;
23  mp_ID2 = NULL;
26  m_verbose = -1;
27  m_eventValue = 0.;
28 }
29 
30 // =====================================================================
31 // ---------------------------------------------------------------------
32 // ---------------------------------------------------------------------
33 // =====================================================================
34 
36 {
37  if (mp_ID1 != NULL) free(mp_ID1);
38  if (mp_ID1 != NULL) free(mp_ID2);
39 }
40 
41 // =====================================================================
42 // ---------------------------------------------------------------------
43 // ---------------------------------------------------------------------
44 // =====================================================================
45 
47 {
48  // Verbose
50  if (m_verbose>=VERBOSE_DETAIL) Cout("vEvent::AllocateID() -> Allocate buffers for indices" << endl);
51  // Check number of lines
52  if (m_nbLines<1)
53  {
54  Cerr("***** vEvent::AllocateID() -> Error, number of lines has not been initialized (<1) !" << endl);
55  return 1;
56  }
57  else
58  {
59  // Allocate buffer indices
60  mp_ID1 = (uint32_t*)malloc(m_nbLines*sizeof(uint32_t));
61  mp_ID2 = (uint32_t*)malloc(m_nbLines*sizeof(uint32_t));
62  }
63  // Call the pure virtual function implemented in child classes for the allocation of data specific to child classes
65  {
66  Cerr("***** vEvent::AllocateID() -> Error when trying to allocated specific data for the Event !" << endl);
67  return 1;
68  }
69  // End
70  return 0;
71 }
72 
73 // =====================================================================
74 // ---------------------------------------------------------------------
75 // ---------------------------------------------------------------------
76 // =====================================================================
#define Cerr(MESSAGE)
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
vEvent()
vEvent constructor. Initialize the member variables to their default values.
int AllocateID()
Instantiate the mp_ID1 and mp_ID2 indices arrays.
virtual int AllocateSpecificData()=0
Pure virtual function implemented in the child classes, dedicated to the allocation of specific data ...
#define Cout(MESSAGE)
virtual ~vEvent()
vEvent destructor