G4AttDef.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 
00029 #ifndef G4ATTDEF_HH
00030 #define G4ATTDEF_HH
00031 
00032 #include "globals.hh"
00033 #include "G4TypeKey.hh"
00034 #include <map>
00035 
00036 // Class Description:
00037 //
00038 // @class G4AttDef
00039 //
00040 // @brief This class represents a HepRep-style Attribute Definition.
00041 // The G4AttDef is used to define new kinds of attributes that can
00042 // then have values set for a Trajectory, Trajectory Point or Sensitive
00043 // Detector Hit.  These attributes are then made available to the end user
00044 // in an interactive visualization system (such as WIRED).
00045 // Values are set by creating G4AttValue objects and attaching them to the
00046 // relevant Trajectory, Trajectory Point or Sensitive Detector Hit.
00047 // The association between the G4AttValue and the G4AttDef object is
00048 // made through the data member "name".
00049 // For details, see the HepRep home page at http://heprep.freehep.org
00050 //  
00051 // @author M.Frailis 
00052 // @author R.Giannitrapani
00053 // @author J.Perl
00054 // Class Description - End:
00055 
00056   
00057   class G4AttDef{
00058 
00059   public:
00060     G4AttDef(const G4String& name,
00061              const G4String& desc,
00062              const G4String& category,
00063              const G4String& extra,
00064              const G4String& valueType):
00065       m_name(name),m_desc(desc),
00066       m_category(category),
00067       m_extra(extra),m_valueType(valueType){};
00068 
00069     // G4Typekey based constructor
00070     G4AttDef(const G4String& name,
00071              const G4String& desc,
00072              const G4String& category,
00073              const G4String& extra,
00074              const G4TypeKey& typeKey):
00075       m_name(name),m_desc(desc),
00076       m_category(category),
00077       m_extra(extra),m_valueType("Null"), 
00078       m_typeKey(typeKey)
00079     {};
00080 
00081     G4AttDef(){};
00082     virtual ~G4AttDef(){};
00083     
00084     const G4String& GetName()const{return m_name;};
00085     const G4String& GetDesc()const{return m_desc;};
00086     const G4String& GetCategory()const{return m_category;};
00087     const G4String& GetExtra()const{return m_extra;};
00088     const G4String& GetValueType()const{return m_valueType;};
00089     const G4TypeKey& GetTypeKey()const{return m_typeKey;};
00090 
00091     void SetName(const G4String& name){m_name = name;};
00092     void SetDesc(const G4String& desc){m_desc = desc;};
00093     void SetCategory(const G4String& cat){m_category = cat;};
00094     void SetExtra(const G4String& extra){m_extra = extra;};
00095     void SetValueType(const G4String& type){m_valueType = type;};
00096 
00097   private:
00099     G4String m_name;
00101     G4String m_desc;
00103     G4String m_category;
00105     G4String m_extra;
00107     G4String m_valueType;
00108     // Type key
00109     G4TypeKey m_typeKey;
00110 
00111   };
00112 
00113 std::ostream& operator<<
00114   (std::ostream& os, const std::map<G4String,G4AttDef>* definitions);
00115 
00116 #endif //G4ATTDEF_H

Generated on Mon May 27 17:47:41 2013 for Geant4 by  doxygen 1.4.7