ThePEG
1.8.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Interface
InterfaceBase.h
1
// -*- C++ -*-
2
//
3
// InterfaceBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2011 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_InterfaceBase_H
10
#define ThePEG_InterfaceBase_H
11
// This is the declaration of the InterfaceBase and RefInterfaceBase classes.
12
13
#include "ThePEG/Config/ThePEG.h"
14
#include "InterfaceBase.fh"
15
#include "InterfaceBase.xh"
16
#include "ThePEG/Utilities/Named.h"
17
#include "ThePEG/Utilities/ClassTraits.h"
18
#include "Interface.h"
19
20
namespace
ThePEG {
21
59
class
InterfaceBase
:
public
Named
{
60
61
public
:
62
83
InterfaceBase
(
string
newName,
string
newDescription,
84
string
newClassName,
85
const
type_info & newTypeInfo,
bool
depSafe,
86
bool
readonly);
87
91
virtual
~InterfaceBase
() {}
92
97
string
tag
(
int
pos = -1)
const
;
98
104
virtual
string
105
exec
(
InterfacedBase
& ib,
string
action,
string
arguments)
const
106
= 0;
107
111
virtual
string
type
()
const
= 0;
112
117
virtual
bool
notDefault
(
InterfacedBase
&)
const
;
118
122
map<string,string> &
objectDefaults
(
InterfacedBase
&)
const
;
123
128
virtual
void
rebind
(
InterfacedBase
&,
129
const
TranslationMap
&,
130
const
IVector
& =
IVector
())
const
{}
131
136
virtual
IVector
getReferences
(
const
InterfacedBase
&)
const
{
137
return
IVector
();
138
}
139
143
string
description
()
const
{
return
theDescription
; }
144
148
virtual
string
fullDescription
(
const
InterfacedBase
& ib)
const
;
149
154
virtual
void
doxygenDescription
(ostream & stream)
const
;
155
160
virtual
string
doxygenType
()
const
= 0;
161
166
string
className
()
const
{
return
theClassName
; }
167
172
bool
dependencySafe
()
const
{
return
isDependencySafe
; }
173
178
void
setDependencySafe
() {
isDependencySafe
=
true
; }
179
184
void
setDependencySensitive
() {
isDependencySafe
=
false
; }
185
190
bool
readOnly
()
const
{
return
isReadOnly
&& (!
NoReadOnly
); }
191
196
void
setReadOnly
() {
isReadOnly
=
true
; }
197
202
void
setReadWrite
() {
isReadOnly
=
false
; }
203
208
bool
anonymous
()
const
{
return
description
().empty(); }
209
214
double
rank
()
const
{
return
theRank
; }
215
220
void
rank
(
double
r) {
theRank
= r; }
221
225
void
setHasDefault
(
bool
b) {
226
hasDefault
= b;
227
}
228
232
static
bool
NoReadOnly
;
233
234
private
:
235
239
string
theDescription
;
240
244
string
theClassName
;
245
250
double
theRank
;
251
252
protected
:
253
257
bool
hasDefault
;
258
263
mutable
bool
isDependencySafe
;
264
269
mutable
bool
isReadOnly
;
270
271
272
};
273
274
280
class
RefInterfaceBase
:
public
InterfaceBase
{
281
282
public
:
283
320
RefInterfaceBase
(
string
newName,
string
newDescription,
321
string
newClassName,
const
type_info & newTypeInfo,
322
string
newRefClassName,
323
const
type_info & newRefTypeInfo,
324
bool
depSafe,
bool
readonly,
325
bool
norebind,
bool
nullable,
bool
defnull);
326
331
string
refClassName
()
const
{
return
theRefClassName
; }
332
337
const
type_info &
refTypeInfo
()
const
{
return
theRefTypeInfo
; }
338
343
bool
noRebind
()
const
{
return
dontRebind
; }
344
349
void
setNoRebind
() {
dontRebind
=
true
; }
350
355
void
setRebind
() {
dontRebind
=
false
; }
356
361
bool
noNull
()
const
{
return
!
isNullable
; }
362
367
void
setNullable
() {
isNullable
=
true
; }
368
373
void
setNotNullable
() {
isNullable
=
false
; }
374
379
bool
defaultIfNull
()
const
{
return
theDefaultIfNull
; }
380
385
void
setDefaultIfNull
() {
theDefaultIfNull
=
true
; }
386
391
void
setNoDefaultIfNull
() {
theDefaultIfNull
=
false
; }
392
393
private
:
394
399
string
theRefClassName
;
400
404
const
type_info &
theRefTypeInfo
;
405
410
bool
dontRebind
;
411
416
bool
isNullable
;
417
422
bool
theDefaultIfNull
;
423
424
};
425
428
inline
double
operator/(
string
,
string
) {
return
0.0; }
429
432
inline
string
operator*(
double
,
string
) {
return
""
; }
433
434
}
435
436
#endif
/* ThePEG_InterfaceBaseH */
Generated on Mon Jul 2 2012 16:06:47 for ThePEG by
1.8.1.1