Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4AttHolder.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 
0027 #ifndef G4ATTHOLDER_HH
0028 #define G4ATTHOLDER_HH
0029 
0030 // Class Description:
0031 //
0032 // @class G4AttHolder
0033 //
0034 // @brief Holds G4AttValues and their corresponding G4AttDef map.
0035 //
0036 // Intended for inheritance by classes that need to hold them.
0037 //
0038 // For further details, see the HepRep home page at http://heprep.freehep.org
0039 //  
0040 // @author J.Allison
0041 // @author J.Perl
0042 // Class Description - End:
0043 
0044 #include "globals.hh"
0045 
0046 #include <vector>
0047 #include <map>
0048 
0049 #include "G4AttValue.hh"
0050 #include "G4AttDef.hh"
0051 
0052 class G4AttHolder {
0053 
0054 public:
0055 
0056   G4AttHolder() = default;
0057   ~G4AttHolder();  // Note: G4AttValues are deleted here.
0058   G4AttHolder(const G4AttHolder&) = delete;  // Copy construction not allowed.
0059   G4AttHolder& operator=(const G4AttHolder&) = delete;  // Assignment not allowed.
0060 
0061   const std::vector<const std::vector<G4AttValue>*>& GetAttValues() const
0062   {return fValues;}
0063   const std::vector<const std::map<G4String,G4AttDef>*>& GetAttDefs() const
0064   {return fDefs;}
0065 
0066   void AddAtts(const std::vector<G4AttValue>* values,
0067                const std::map<G4String,G4AttDef>* defs)
0068   {fValues.push_back(values); fDefs.push_back(defs);}
0069   // Note: G4AttValues are assumed to be expendable - they will be
0070   // deleted in the destructor.  G4AttDefs are assumed to have long
0071   // life.
0072 
0073 private:
0074   std::vector<const std::vector<G4AttValue>*> fValues;
0075   std::vector<const std::map<G4String,G4AttDef>*> fDefs;
0076 };
0077 
0078 #endif //G4ATTHOLDER_HH