| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DayaBay::SimVertexReference Class Reference

A lightweight class to be used like SimVertex*, but it keeps track of indirect references in the case of indirect particles that weren't stored. More...

#include <SimVertexReference.h>

Collaboration diagram for DayaBay::SimVertexReference:

[legend]
List of all members.

Public Member Functions

 SimVertexReference ()
 Default Constructor.
 SimVertexReference (SimVertex *t, int indirection)
 Constructor with data.
virtual ~SimVertexReference ()
 Default Destructor.
bool isDirect () const
 Return true if reference is direct.
bool isIndirect () const
 Return true if reference is indirec.
bool isBad () const
 Return true if reference is invalid.
bool isPrimary () const
 This is a special case: no indrection and no vertex means that this is a placeholder for a link to a primary kinetic input.
SimVertexvertex ()
 Access non-const vertex.
std::ostream & fillStream (std::ostream &s) const
 Serialize to an ostream.
const DayaBay::SimVertexvertex () const
 Retrieve const The vertex.
int indirection () const
 Retrieve const The indirection count.

Static Public Member Functions

static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Attributes

DayaBay::SimVertexm_vertex
 The vertex.
int m_indirection
 The indirection count.

Detailed Description

A lightweight class to be used like SimVertex*, but it keeps track of indirect references in the case of indirect particles that weren't stored.

Author:
tagg@minos.phy.tufts.edu created Mon Apr 11 03:59:57 2011

Definition at line 41 of file SimVertexReference.h.


Constructor & Destructor Documentation

DayaBay::SimVertexReference::SimVertexReference (  )  [inline]

Default Constructor.

Definition at line 46 of file SimVertexReference.h.

00046                        : m_vertex(0),
00047                            m_indirection(-999) {}

DayaBay::SimVertexReference::SimVertexReference ( SimVertex t,
int  indirection 
) [inline]

Constructor with data.

Definition at line 50 of file SimVertexReference.h.

00051                                         : m_vertex(t),
00052                                           m_indirection(indirection) {}

virtual DayaBay::SimVertexReference::~SimVertexReference (  )  [inline, virtual]

Default Destructor.

Definition at line 55 of file SimVertexReference.h.

00055 {}


Member Function Documentation

bool DayaBay::SimVertexReference::isDirect (  )  const [inline]

Return true if reference is direct.

Definition at line 150 of file SimVertexReference.h.

00151 {
00152   return (m_indirection == 0);
00153 }

bool DayaBay::SimVertexReference::isIndirect (  )  const [inline]

Return true if reference is indirec.

Definition at line 155 of file SimVertexReference.h.

00156 {
00157   return (m_indirection > 0);
00158 }

bool DayaBay::SimVertexReference::isBad (  )  const [inline]

Return true if reference is invalid.

Definition at line 160 of file SimVertexReference.h.

00161 {
00162   return (m_indirection < 0);
00163 }

bool DayaBay::SimVertexReference::isPrimary (  )  const [inline]

This is a special case: no indrection and no vertex means that this is a placeholder for a link to a primary kinetic input.

Definition at line 165 of file SimVertexReference.h.

00166 {
00167   return(m_vertex==0)&&(m_indirection==0);
00168 }

DayaBay::SimVertex * DayaBay::SimVertexReference::vertex (  )  [inline]

Access non-const vertex.

Definition at line 170 of file SimVertexReference.h.

00171 {
00172   return m_vertex;
00173 }

std::ostream & DayaBay::SimVertexReference::fillStream ( std::ostream &  s  )  const

Serialize to an ostream.

Definition at line 3 of file SimVertexReference.cc.

00004 {
00005     s << "{ " << "vertex :      ";
00006     if (m_vertex) s << *m_vertex;
00007     else s << "NULL";
00008     s << std::endl
00009       << "indirection : " << m_indirection << std::endl << " }";
00010     return s;
00011 }

const DayaBay::SimVertex * DayaBay::SimVertexReference::vertex (  )  const [inline]

Retrieve const The vertex.

Definition at line 140 of file SimVertexReference.h.

00141 {
00142   return m_vertex;
00143 }

int DayaBay::SimVertexReference::indirection (  )  const [inline]

Retrieve const The indirection count.

Definition at line 145 of file SimVertexReference.h.

00146 {
00147   return m_indirection;
00148 }

static void* DayaBay::SimVertexReference::operator new ( size_t  size  )  [inline, static]

operator new

Definition at line 86 of file SimVertexReference.h.

00087     {
00088       return ( sizeof(SimVertexReference) == size ? 
00089                boost::singleton_pool<SimVertexReference, sizeof(SimVertexReference)>::malloc() :
00090                ::operator new(size) );
00091     }

static void* DayaBay::SimVertexReference::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Definition at line 96 of file SimVertexReference.h.

00097     {
00098       return ::operator new (size,pObj);
00099     }

static void DayaBay::SimVertexReference::operator delete ( void *  p  )  [inline, static]

operator delete

Definition at line 102 of file SimVertexReference.h.

00103     {
00104       boost::singleton_pool<SimVertexReference, sizeof(SimVertexReference)>::is_from(p) ?
00105       boost::singleton_pool<SimVertexReference, sizeof(SimVertexReference)>::free(p) :
00106       ::operator delete(p);
00107     }

static void DayaBay::SimVertexReference::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Definition at line 111 of file SimVertexReference.h.

00112     {
00113       ::operator delete (p, pObj);
00114     }


Member Data Documentation

DayaBay::SimVertex* DayaBay::SimVertexReference::m_vertex [private]

The vertex.

Definition at line 120 of file SimVertexReference.h.

int DayaBay::SimVertexReference::m_indirection [private]

The indirection count.

Definition at line 121 of file SimVertexReference.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:31:30 2011 for SimEvent by doxygen 1.4.7