G4ModelCmdAddValueContext< M > Class Template Reference

#include <G4ModelCompoundCommandsT.hh>

Inheritance diagram for G4ModelCmdAddValueContext< M >:

G4ModelCmdApplyString< M > G4VModelCommand< M > G4UImessenger

Public Member Functions

 G4ModelCmdAddValueContext (M *model, const G4String &placement, const G4String &cmdName="addValue")
virtual ~G4ModelCmdAddValueContext ()

Protected Member Functions

virtual void Apply (const G4String &param)

Detailed Description

template<typename M>
class G4ModelCmdAddValueContext< M >

Definition at line 93 of file G4ModelCompoundCommandsT.hh.


Constructor & Destructor Documentation

template<typename M>
G4ModelCmdAddValueContext< M >::G4ModelCmdAddValueContext ( M *  model,
const G4String placement,
const G4String cmdName = "addValue" 
) [inline]

Definition at line 97 of file G4ModelCompoundCommandsT.hh.

References G4ModelCmdApplyString< M >::Command(), and G4UIcommand::SetGuidance().

00099     :G4ModelCmdApplyString<M>(model, placement, cmdName) 
00100   {
00101     G4UIcmdWithAString* cmd = G4ModelCmdApplyString<M>::Command();
00102     cmd->SetGuidance("Add value.");
00103   }

template<typename M>
virtual G4ModelCmdAddValueContext< M >::~G4ModelCmdAddValueContext (  )  [inline, virtual]

Definition at line 105 of file G4ModelCompoundCommandsT.hh.

00105                                        {
00106     std::vector<G4UImessenger*>::iterator iter = fMessengers.begin();
00107     
00108     while (iter != fMessengers.end()) {
00109       delete *iter;
00110       iter++;
00111     }
00112   }


Member Function Documentation

template<typename M>
virtual void G4ModelCmdAddValueContext< M >::Apply ( const G4String param  )  [inline, protected, virtual]

Implements G4ModelCmdApplyString< M >.

Definition at line 116 of file G4ModelCompoundCommandsT.hh.

References G4ModelCommandUtils::AddContextMsgrs(), G4VModelCommand< T >::Model(), and G4VModelCommand< T >::Placement().

00116                                             {
00117     G4String myString(param);
00118 
00119     G4String name;
00120     std::istringstream is(param);
00121     
00122     is >> name;
00123 
00124     myString.erase(0, name.size());
00125 
00126     G4String dir = G4VModelCommand<M>::Placement()+"/"+G4VModelCommand<M>::Model()->Name();
00127     
00128     G4VisTrajContext* context = new G4VisTrajContext(name);
00129     
00130     G4ModelCommandUtils::AddContextMsgrs(context, fMessengers, dir);
00131     G4VModelCommand<M>::Model()->AddValueContext(myString, context);
00132   }


The documentation for this class was generated from the following file:
Generated on Mon May 27 17:52:29 2013 for Geant4 by  doxygen 1.4.7