thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Interface
Command.h
1
// -*- C++ -*-
2
//
3
// Command.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_Command_H
10
#define ThePEG_Command_H
11
// This is the declaration of the Command and CommandBase classes.
12
13
#include "
ThePEG/Config/ThePEG.h
"
14
#include "InterfaceBase.h"
15
#include "Command.fh"
16
#include "Command.xh"
17
18
namespace
ThePEG
{
19
53
class
CommandBase
:
public
InterfaceBase
{
54
55
public
:
56
73
CommandBase
(
string
newName,
string
newDescription,
string
newClassName,
74
const
type_info & newTypeInfo,
bool
depSafe)
75
:
InterfaceBase
(newName, newDescription, newClassName,
76
newTypeInfo, depSafe, false) {
77
hasDefault
=
false
;
78
}
79
86
virtual
string
87
exec
(
InterfacedBase
&ib,
string
action,
string
arguments)
const
88
;
89
94
virtual
string
doxygenType
()
const
;
95
99
virtual
string
type
()
const
;
100
106
virtual
string
cmd
(
InterfacedBase
& ib,
string
c)
const
107
= 0;
108
109
};
110
144
template
<
class
T>
145
class
Command
:
public
CommandBase
{
146
147
public
:
148
153
typedef
string (T::*
ExeFn
)(string);
154
155
public
:
156
171
Command
(
string
newName,
string
newDescription,
172
ExeFn
newExeFn,
bool
depSafe =
false
)
173
:
CommandBase
(newName, newDescription,
174
ClassTraits
<T>::
className
(), typeid(T), depSafe),
175
theExeFn
(newExeFn) {}
176
181
virtual
string
cmd
(
InterfacedBase
& ib,
string
)
182
const
;
183
184
185
private
:
186
190
ExeFn
theExeFn
;
191
192
};
193
194
}
195
196
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
197
#include "Command.tcc"
198
#endif
199
200
#endif
/* ThePEG_Command_H */
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::CommandBase
The CommandBase and its templated Command sub-class defines an interface to a class derived from the ...
Definition:
Command.h:53
ThePEG::CommandBase::cmd
virtual string cmd(InterfacedBase &ib, string c) const =0
Execute the member function.
ThePEG::CommandBase::doxygenType
virtual string doxygenType() const
Return a string describing the type of interface to be included in the Doxygen documentation.
ThePEG::CommandBase::exec
virtual string exec(InterfacedBase &ib, string action, string arguments) const
The general interface method overriding the one in InterfaceBase.
ThePEG::CommandBase::type
virtual string type() const
Return a code for the type of this interface.
ThePEG::CommandBase::CommandBase
CommandBase(string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe)
Standard constructor.
Definition:
Command.h:73
ThePEG::Command
The CommandBase and its templated Command sub-class defines an interface to a class derived from the ...
Definition:
Command.h:145
ThePEG::Command::ExeFn
string(T::* ExeFn)(string)
The declaration of member functions which can be used by this Command interface.
Definition:
Command.h:153
ThePEG::Command::cmd
virtual string cmd(InterfacedBase &ib, string) const
Execute the member function.
ThePEG::Command::theExeFn
ExeFn theExeFn
The pointer to the member function.
Definition:
Command.h:190
ThePEG::Command::Command
Command(string newName, string newDescription, ExeFn newExeFn, bool depSafe=false)
Standard constructor.
Definition:
Command.h:171
ThePEG::InterfaceBase
The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase clas...
Definition:
InterfaceBase.h:59
ThePEG::InterfaceBase::className
string className() const
Return the class name for the class this interface is defined for.
Definition:
InterfaceBase.h:166
ThePEG::InterfaceBase::hasDefault
bool hasDefault
A flag indicating whether this interface has a default setting.
Definition:
InterfaceBase.h:257
ThePEG::InterfacedBase
InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class.
Definition:
InterfacedBase.h:45
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::ClassTraits
The default concrete implementation of ClassTraitsBase.
Definition:
ClassTraits.h:134
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6