Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:56:50

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4SmartVoxelProxy
0027 //
0028 // Class description:
0029 //
0030 // Class for proxying smart voxels. The class represents either a header
0031 // (in turn refering to more VoxelProxies) or a node. If created as a node,
0032 // calls to GetHeader cause an exception, and likewise GetNode when a header.
0033 //
0034 // Note that the proxy does NOT gain deletion responsibility for proxied
0035 // objects.
0036 
0037 // 12.07.95, P.Kent - Initial version
0038 // --------------------------------------------------------------------
0039 #ifndef G4SMARTVOXELPROXY_HH
0040 #define G4SMARTVOXELPROXY_HH 1
0041 
0042 #include <assert.h>
0043 
0044 #include "geomwdefs.hh"
0045 #include "G4Types.hh"
0046 
0047 class G4SmartVoxelNode;
0048 class G4SmartVoxelHeader;
0049 
0050 class G4SmartVoxelProxy 
0051 {
0052 
0053   public:
0054 
0055     G4SmartVoxelProxy(G4SmartVoxelHeader *pHeader)
0056       : fHeader(pHeader) {}
0057       // Proxy for the specified header.
0058 
0059     G4SmartVoxelProxy(G4SmartVoxelNode *pNode)
0060       : fNode(pNode) {}
0061       // Proxy for the specified node.
0062 
0063     ~G4SmartVoxelProxy() = default;
0064       // Destructor - do nothing. Not responsible for proxied objects.
0065 
0066     G4bool IsHeader() const;
0067       // Return true if proxying for a header, else false.
0068 
0069     G4bool IsNode() const;
0070       // Return true if proxying for a node, else false.
0071 
0072     G4SmartVoxelNode* GetNode() const;
0073       // Return ptr to proxied node, else call G4Exception.
0074 
0075     G4SmartVoxelHeader* GetHeader() const;
0076       // Return ptr to proxied header, else call G4Exception
0077 
0078     G4bool operator == (const G4SmartVoxelProxy& v) const;
0079       // Equality operator.
0080       // True when objects share same address.
0081 
0082   private:
0083 
0084     G4SmartVoxelHeader* fHeader = nullptr;
0085     G4SmartVoxelNode* fNode = nullptr;
0086 };
0087 
0088 #include "G4SmartVoxelProxy.icc"
0089 
0090 #endif