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 // $Id$ 00027 // 00028 // Jane Tinslay, John Allison, Joseph Perl November 2005 00029 // 00030 // Class Description 00031 // Templated base class for model messengers. Commands specific to a particular 00032 // concrete model should inherit from G4VModelCommand, with the concrete model 00033 // type as the template parameter. 00034 // Class Description - End: 00035 00036 #ifndef G4VMODELCOMMAND_HH 00037 #define G4VMODELCOMMAND_HH 00038 00039 #include "G4UImessenger.hh" 00040 #include "G4String.hh" 00041 00042 class G4UIcommand; 00043 00044 template <typename T> 00045 class G4VModelCommand : public G4UImessenger { 00046 00047 public: 00048 00049 // Constructor 00050 G4VModelCommand(T* model, const G4String& placement=""); 00051 00052 // Destructor 00053 virtual ~G4VModelCommand(); 00054 00055 // Methods 00056 G4String GetCurrentValue(G4UIcommand* command); 00057 G4String Placement(); 00058 00059 protected: 00060 00061 // Access to model 00062 T* Model(); 00063 00064 private: 00065 00066 // Data members 00067 T* fpModel; 00068 G4String fPlacement; 00069 }; 00070 00071 template <typename T> 00072 G4VModelCommand<T>::G4VModelCommand(T* model, const G4String& placement) 00073 :fpModel(model) 00074 ,fPlacement(placement) 00075 {} 00076 00077 template <typename T> 00078 G4VModelCommand<T>::~G4VModelCommand() {} 00079 00080 template <typename T> 00081 G4String 00082 G4VModelCommand<T>::GetCurrentValue(G4UIcommand*) 00083 { 00084 return ""; 00085 } 00086 00087 template <typename T> 00088 T* 00089 G4VModelCommand<T>::Model() 00090 { 00091 return fpModel; 00092 } 00093 00094 template <typename T> 00095 G4String 00096 G4VModelCommand<T>::Placement() 00097 { 00098 return fPlacement; 00099 } 00100 00101 #endif 00102 00103 00104