OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Expressions
TFind.h
Go to the documentation of this file.
1
#ifndef OPAL_TFind_HH
2
#define OPAL_TFind_HH
3
4
// ------------------------------------------------------------------------
5
// $RCSfile: TFind.h,v $
6
// ------------------------------------------------------------------------
7
// $Revision: 1.1.1.1 $
8
// ------------------------------------------------------------------------
9
// Copyright: see Copyright.readme
10
// ------------------------------------------------------------------------
11
//
12
// Template function: find<T>(const T table[], const string &name).
13
//
14
// ------------------------------------------------------------------------
15
//
16
// $Date: 2000/03/27 09:33:42 $
17
// $Author: Andreas Adelmann $
18
//
19
// ------------------------------------------------------------------------
20
21
#include <string>
22
23
24
namespace
Expressions {
25
26
// Function find
27
// ----------------------------------------------------------------------
29
// The input table is a C array of structures containing a [b]name[/b]
30
// entry. The result is a pointer to one component of the array or nullptr.
31
// May be replaced by a map<> with suitable parameters.
32
33
template
<
class
T>
inline
34
const
T
*
find
(
const
T
table[],
const
std::string &
name
) {
35
for
(
const
T
*x = table; x->name != 0; x++) {
36
if
(x->name == name)
return
x;
37
}
38
39
return
0;
40
}
41
42
}
43
44
#endif // OPAL_TFind_HH
Expressions::find
const T * find(const T table[], const std::string &name)
Look up name.
Definition:
TFind.h:34
Attrib::Legacy::Distribution::T
Definition:
Distribution.h:171
name
const std::string name
Definition:
MaxNormRadialPeak.cpp:32
Generated on Tue Jul 2 2024 15:05:24 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5