#include <Alignment/CommonAlignment/interface/AlignableDetOrUnitPtr.h>
Public Member Functions | |
const Alignable * | alignable () const |
Alignable * | alignable () |
const AlignableDet * | alignableDet () const |
AlignableDet * | alignableDet () |
AlignableDetOrUnitPtr (AlignableDetUnit *aliDetUnit) | |
Constructor from AlignableDetUnit* (non-explicit: for automatic conversions). | |
AlignableDetOrUnitPtr (AlignableDet *aliDet) | |
Constructor from AlignableDet* (non-explicit: for automatic conversions). | |
const AlignableDetUnit * | alignableDetUnit () const |
AlignableDetUnit * | alignableDetUnit () |
bool | isNull () const |
operator Alignable * () | |
operator const Alignable * () const | |
const Alignable * | operator-> () const |
Alignable * | operator-> () |
AlignableDetOrUnitPtr & | operator= (AlignableDetUnit *aliDetUnit) |
AlignableDetOrUnitPtr & | operator= (AlignableDet *aliDet) |
~AlignableDetOrUnitPtr () | |
Non-virtual destructor: do not use as base class. | |
Private Attributes | |
AlignableDet * | theAliDet |
Pointer to Alignable if it is a Det. | |
AlignableDetUnit * | theAliDetUnit |
Pointer to Alignable if it is a DetUnit. |
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
Definition at line 28 of file AlignableDetOrUnitPtr.h.
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.
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;}
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=().
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=().