Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-25 23:57:04

0001 #ifndef Geometry_CaloGeometry_CaloCellGeometryPtr_h
0002 #define Geometry_CaloGeometry_CaloCellGeometryPtr_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Geometry/CaloGeometry
0006 // Class  :     CaloCellGeometryPtr
0007 //
0008 /**\class CaloCellGeometryPtr CaloCellGeometryPtr.h "Geometry/CaloGeometry/interface/CaloCellGeometryPtr.h"
0009 
0010  Description: Type to hold pointer to CaloCellGeometry
0011 
0012  Usage:
0013     Used to express that the CaloCellGeometry is owned elsewhere
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Wed, 23 Oct 2024 18:47:22 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 
0025 // forward declarations
0026 class CaloCellGeometry;
0027 
0028 class CaloCellGeometryPtr {
0029 public:
0030   explicit CaloCellGeometryPtr(CaloCellGeometry const* iPtr) noexcept : ptr_{iPtr} {}
0031   CaloCellGeometryPtr() noexcept = default;
0032   CaloCellGeometryPtr(const CaloCellGeometryPtr&) noexcept = default;
0033   CaloCellGeometryPtr(CaloCellGeometryPtr&&) noexcept = default;
0034   CaloCellGeometryPtr& operator=(CaloCellGeometryPtr const&) noexcept = default;
0035   CaloCellGeometryPtr& operator=(CaloCellGeometryPtr&&) noexcept = default;
0036 
0037   CaloCellGeometry const* operator->() const { return ptr_; }
0038   CaloCellGeometry const* get() const { return ptr_; }
0039   CaloCellGeometry const& operator*() const { return *ptr_; }
0040 
0041   operator CaloCellGeometry const*() const { return ptr_; }
0042 
0043 private:
0044   const CaloCellGeometry* ptr_ = nullptr;
0045 };
0046 
0047 #endif