| [831] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4SmartVoxelProxy.hh,v 1.8 2006/06/29 18:32:17 gunter Exp $
|
|---|
| [1058] | 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $
|
|---|
| [831] | 29 | //
|
|---|
| 30 | // class G4SmartVoxelProxy
|
|---|
| 31 | //
|
|---|
| 32 | // Class description:
|
|---|
| 33 | //
|
|---|
| 34 | // Class for proxying smart voxels. The class represents either a header
|
|---|
| 35 | // (in turn refering to more VoxelProxies) or a node. If created as a node,
|
|---|
| 36 | // calls to GetHeader cause an exception, and likewise GetNode when a header.
|
|---|
| 37 | //
|
|---|
| 38 | // Note that the proxy does NOT gain deletion responsibility for proxied
|
|---|
| 39 | // objects.
|
|---|
| 40 |
|
|---|
| 41 | // History:
|
|---|
| 42 | // 12.07.95 P.Kent Initial version
|
|---|
| 43 | // 03.08.95 P.Kent Updated to become non abstract class, removing
|
|---|
| 44 | // HeaderProxy and NodeProxy derived classes
|
|---|
| 45 | // --------------------------------------------------------------------
|
|---|
| 46 | #ifndef G4SMARTVOXELPROXY_HH
|
|---|
| 47 | #define G4SMARTVOXELPROXY_HH
|
|---|
| 48 |
|
|---|
| 49 | #include "G4Types.hh"
|
|---|
| 50 | #include <assert.h>
|
|---|
| 51 |
|
|---|
| 52 | class G4SmartVoxelNode;
|
|---|
| 53 | class G4SmartVoxelHeader;
|
|---|
| 54 |
|
|---|
| 55 | class G4SmartVoxelProxy
|
|---|
| 56 | {
|
|---|
| 57 |
|
|---|
| 58 | public: // with description
|
|---|
| 59 |
|
|---|
| 60 | G4SmartVoxelProxy(G4SmartVoxelHeader *pHeader)
|
|---|
| 61 | : fHeader(pHeader), fNode(0) {}
|
|---|
| 62 | // Proxy for the specified header.
|
|---|
| 63 |
|
|---|
| 64 | G4SmartVoxelProxy(G4SmartVoxelNode *pNode)
|
|---|
| 65 | : fHeader(0), fNode(pNode) {}
|
|---|
| 66 | // Proxy for the specified node.
|
|---|
| 67 |
|
|---|
| 68 | ~G4SmartVoxelProxy();
|
|---|
| 69 | // Destructor - do nothing. Not responsible for proxied objects.
|
|---|
| 70 |
|
|---|
| 71 | G4bool IsHeader() const;
|
|---|
| 72 | // Return true if proxying for a header, else false.
|
|---|
| 73 |
|
|---|
| 74 | G4bool IsNode() const;
|
|---|
| 75 | // Return true if proxying for a node, else false.
|
|---|
| 76 |
|
|---|
| 77 | G4SmartVoxelNode* GetNode() const;
|
|---|
| 78 | // Return ptr to proxied node, else call G4Exception.
|
|---|
| 79 |
|
|---|
| 80 | G4SmartVoxelHeader* GetHeader() const;
|
|---|
| 81 | // Return ptr to proxied header, else call G4Exception
|
|---|
| 82 |
|
|---|
| 83 | G4bool operator == (const G4SmartVoxelProxy& v) const;
|
|---|
| 84 | // Equality operator.
|
|---|
| 85 | // True when objects share same address.
|
|---|
| 86 |
|
|---|
| 87 | private:
|
|---|
| 88 |
|
|---|
| 89 | G4SmartVoxelHeader* fHeader;
|
|---|
| 90 | G4SmartVoxelNode* fNode;
|
|---|
| 91 | };
|
|---|
| 92 |
|
|---|
| 93 | #include "G4SmartVoxelProxy.icc"
|
|---|
| 94 |
|
|---|
| 95 | #endif
|
|---|