CMS 3D CMS Logo

AlignableDetOrUnitPtr Class Reference

Class to hold either a pointer to an AlignableDet or to an AlignableDetUnit. More...

#include <Alignment/CommonAlignment/interface/AlignableDetOrUnitPtr.h>

List of all members.

Public Member Functions

const Alignablealignable () const
Alignablealignable ()
const AlignableDetalignableDet () const
AlignableDetalignableDet ()
 AlignableDetOrUnitPtr (AlignableDetUnit *aliDetUnit)
 Constructor from AlignableDetUnit* (non-explicit: for automatic conversions).
 AlignableDetOrUnitPtr (AlignableDet *aliDet)
 Constructor from AlignableDet* (non-explicit: for automatic conversions).
const AlignableDetUnitalignableDetUnit () const
AlignableDetUnitalignableDetUnit ()
bool isNull () const
 operator Alignable * ()
 operator const Alignable * () const
const Alignableoperator-> () const
Alignableoperator-> ()
AlignableDetOrUnitPtroperator= (AlignableDetUnit *aliDetUnit)
AlignableDetOrUnitPtroperator= (AlignableDet *aliDet)
 ~AlignableDetOrUnitPtr ()
 Non-virtual destructor: do not use as base class.

Private Attributes

AlignableDettheAliDet
 Pointer to Alignable if it is a Det.
AlignableDetUnittheAliDetUnit
 Pointer to Alignable if it is a DetUnit.


Detailed Description

Class to hold either a pointer to an AlignableDet or to an AlignableDetUnit.

As such it is like a pointer to an Alignable of that hierarchy level on which hits can exists. Therefore it should be used whenever it should be ensured by C++ type safety that a lowest level Alignable* is dealt with.

Conversion and '->' operators exist to use this class as a pointer to the base class Alignable. On the other hand, the accessors alignableDet() and alignableDetUnit() can be used to check which concrete type it is.

Since this class is very light weighted, it can be used by value.

Original author: Gero Flucke, April 2007

Date
2007/04/30 13:13:58
Revision
1.2
(last update by
Author
flucke
)

Definition at line 28 of file AlignableDetOrUnitPtr.h.


Constructor & Destructor Documentation

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDet aliDet  )  [inline]

Constructor from AlignableDet* (non-explicit: for automatic conversions).

Definition at line 32 of file AlignableDetOrUnitPtr.h.

00032 : theAliDet(aliDet), theAliDetUnit(0) {}

AlignableDetOrUnitPtr::AlignableDetOrUnitPtr ( AlignableDetUnit aliDetUnit  )  [inline]

Constructor from AlignableDetUnit* (non-explicit: for automatic conversions).

Definition at line 34 of file AlignableDetOrUnitPtr.h.

00035     : theAliDet(0), theAliDetUnit(aliDetUnit) {}

AlignableDetOrUnitPtr::~AlignableDetOrUnitPtr (  )  [inline]

Non-virtual destructor: do not use as base class.

Definition at line 37 of file AlignableDetOrUnitPtr.h.

00037 {}


Member Function Documentation

const Alignable* AlignableDetOrUnitPtr::alignable (  )  const [inline]

Definition at line 52 of file AlignableDetOrUnitPtr.h.

References operator const Alignable *().

00052 { return this->operator const Alignable*();}

Alignable* AlignableDetOrUnitPtr::alignable (  )  [inline]

Definition at line 51 of file AlignableDetOrUnitPtr.h.

References operator Alignable *().

00051 { return this->operator Alignable*();}

const AlignableDet* AlignableDetOrUnitPtr::alignableDet (  )  const [inline]

Definition at line 56 of file AlignableDetOrUnitPtr.h.

References theAliDet.

00056 { return theAliDet;}

AlignableDet* AlignableDetOrUnitPtr::alignableDet (  )  [inline]

Definition at line 55 of file AlignableDetOrUnitPtr.h.

References theAliDet.

Referenced by AlignableNavigator::alignableDetFromDetId().

00055 { return theAliDet;}

const AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit (  )  const [inline]

Definition at line 58 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

00058 { return theAliDetUnit;}

AlignableDetUnit* AlignableDetOrUnitPtr::alignableDetUnit (  )  [inline]

Definition at line 57 of file AlignableDetOrUnitPtr.h.

References theAliDetUnit.

Referenced by AlignableNavigator::alignableDetFromDetId().

00057 { return theAliDetUnit;}

bool AlignableDetOrUnitPtr::isNull (  )  const [inline]

Definition at line 60 of file AlignableDetOrUnitPtr.h.

References theAliDet, and theAliDetUnit.

00060 { return (!theAliDet && !theAliDetUnit);}

AlignableDetOrUnitPtr::operator Alignable * (  ) 

Definition at line 19 of file AlignableDetOrUnitPtr.cc.

References theAliDet, and theAliDetUnit.

Referenced by alignable(), and operator->().

00020 { 
00021   if (theAliDet) return theAliDet;
00022   else           return theAliDetUnit;
00023 }

AlignableDetOrUnitPtr::operator const Alignable * (  )  const

Definition at line 26 of file AlignableDetOrUnitPtr.cc.

References theAliDet, and theAliDetUnit.

Referenced by alignable(), and operator->().

00027 {
00028   if (theAliDet) return theAliDet;
00029   else           return theAliDetUnit;
00030 }

const Alignable* AlignableDetOrUnitPtr::operator-> (  )  const [inline]

Definition at line 49 of file AlignableDetOrUnitPtr.h.

References operator const Alignable *().

00049 { return this->operator const Alignable*();}

Alignable* AlignableDetOrUnitPtr::operator-> (  )  [inline]

Definition at line 48 of file AlignableDetOrUnitPtr.h.

References operator Alignable *().

00048 { return this->operator Alignable*();}

AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDetUnit aliDetUnit  )  [inline]

Definition at line 41 of file AlignableDetOrUnitPtr.h.

References theAliDet, and theAliDetUnit.

00041                                                                           {
00042     theAliDet = 0; theAliDetUnit = aliDetUnit; return *this;}

AlignableDetOrUnitPtr& AlignableDetOrUnitPtr::operator= ( AlignableDet aliDet  )  [inline]

Definition at line 39 of file AlignableDetOrUnitPtr.h.

References theAliDet, and theAliDetUnit.

00039                                                                   {
00040     theAliDet = aliDet; theAliDetUnit = 0; return *this;}


Member Data Documentation

AlignableDet* AlignableDetOrUnitPtr::theAliDet [private]

Pointer to Alignable if it is a Det.

Definition at line 63 of file AlignableDetOrUnitPtr.h.

Referenced by alignableDet(), isNull(), operator Alignable *(), operator const Alignable *(), and operator=().

AlignableDetUnit* AlignableDetOrUnitPtr::theAliDetUnit [private]

Pointer to Alignable if it is a DetUnit.

Definition at line 64 of file AlignableDetOrUnitPtr.h.

Referenced by alignableDetUnit(), isNull(), operator Alignable *(), operator const Alignable *(), and operator=().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:18 2009 for CMSSW by  doxygen 1.5.4