[834] | 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 | // $Id: G4VModelCommand.hh,v 1.4 2006/09/11 21:22:02 tinslay Exp $ |
---|
[1346] | 27 | // GEANT4 tag $Name: $ |
---|
[834] | 28 | // |
---|
| 29 | // Jane Tinslay, John Allison, Joseph Perl November 2005 |
---|
| 30 | // |
---|
| 31 | // Class Description |
---|
| 32 | // Templated base class for model messengers. Commands specific to a particular |
---|
| 33 | // concrete model should inherit from G4VModelCommand, with the concrete model |
---|
| 34 | // type as the template parameter. |
---|
| 35 | // Class Description - End: |
---|
| 36 | |
---|
| 37 | #ifndef G4VMODELCOMMAND_HH |
---|
| 38 | #define G4VMODELCOMMAND_HH |
---|
| 39 | |
---|
| 40 | #include "G4UImessenger.hh" |
---|
| 41 | #include "G4String.hh" |
---|
| 42 | |
---|
| 43 | class G4UIcommand; |
---|
| 44 | |
---|
| 45 | template <typename T> |
---|
| 46 | class G4VModelCommand : public G4UImessenger { |
---|
| 47 | |
---|
| 48 | public: |
---|
| 49 | |
---|
| 50 | // Constructor |
---|
| 51 | G4VModelCommand(T* model, const G4String& placement=""); |
---|
| 52 | |
---|
| 53 | // Destructor |
---|
| 54 | virtual ~G4VModelCommand(); |
---|
| 55 | |
---|
| 56 | // Methods |
---|
| 57 | G4String GetCurrentValue(G4UIcommand* command); |
---|
| 58 | G4String Placement(); |
---|
| 59 | |
---|
| 60 | protected: |
---|
| 61 | |
---|
| 62 | // Access to model |
---|
| 63 | T* Model(); |
---|
| 64 | |
---|
| 65 | private: |
---|
| 66 | |
---|
| 67 | // Data members |
---|
| 68 | T* fpModel; |
---|
| 69 | G4String fPlacement; |
---|
| 70 | }; |
---|
| 71 | |
---|
| 72 | template <typename T> |
---|
| 73 | G4VModelCommand<T>::G4VModelCommand(T* model, const G4String& placement) |
---|
| 74 | :fpModel(model) |
---|
| 75 | ,fPlacement(placement) |
---|
| 76 | {} |
---|
| 77 | |
---|
| 78 | template <typename T> |
---|
| 79 | G4VModelCommand<T>::~G4VModelCommand() {} |
---|
| 80 | |
---|
| 81 | template <typename T> |
---|
| 82 | G4String |
---|
| 83 | G4VModelCommand<T>::GetCurrentValue(G4UIcommand*) |
---|
| 84 | { |
---|
| 85 | return ""; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | template <typename T> |
---|
| 89 | T* |
---|
| 90 | G4VModelCommand<T>::Model() |
---|
| 91 | { |
---|
| 92 | return fpModel; |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | template <typename T> |
---|
| 96 | G4String |
---|
| 97 | G4VModelCommand<T>::Placement() |
---|
| 98 | { |
---|
| 99 | return fPlacement; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | #endif |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|