Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DataFormats
PatCandidates
src
StringMap.cc
Go to the documentation of this file.
1
#include "
DataFormats/PatCandidates/interface/StringMap.h
"
2
3
void
StringMap::add
(
const
std::string
&
string
, int32_t
value
) {
4
entries_
.push_back(
value_type
(
string
,value));
5
}
6
7
void
StringMap::sort
() {
8
std::sort
(
entries_
.begin(),
entries_
.end());
9
}
10
11
void
StringMap::clear
() {
12
entries_
.clear();
13
}
14
15
int32_t
StringMap::operator[]
(
const
std::string
&
string
)
const
{
16
vector_type::const_iterator
match
= std::lower_bound(
entries_
.begin(),
entries_
.end(),
string
,
MatchByString
());
17
return
(match ==
end
() ? -1 : match->second);
18
}
19
20
const
std::string
&
StringMap::operator[]
(int32_t number)
const
{
21
static
std::string
empty_;
22
vector_type::const_iterator
match
=
find
(number);
23
return
(match ==
end
() ? empty_ : match->first);
24
}
25
26
StringMap::const_iterator
StringMap::find
(
const
std::string
&
string
)
const
{
27
vector_type::const_iterator
match
= std::lower_bound(
entries_
.begin(),
entries_
.end(),
string
,
MatchByString
());
28
return
(match->first ==
string
? match :
end
());
29
}
30
31
StringMap::const_iterator
StringMap::find
(int32_t number)
const
{
32
return
std::find_if(
entries_
.begin(),
entries_
.end(),
MatchByNumber
(number));
33
}
34
35
StringMap::add
void add(const std::string &string, int32_t value)
Definition:
StringMap.cc:3
StringMap::end
const_iterator end() const
Definition:
StringMap.h:32
relativeConstraints.value
tuple value
Definition:
relativeConstraints.py:54
python.multivaluedict.sort
def sort
Definition:
multivaluedict.py:161
StringMap::operator[]
int32_t operator[](const std::string &string) const
Definition:
StringMap.cc:15
StringMap::MatchByString
Definition:
StringMap.h:37
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
StringMap::clear
void clear()
Definition:
StringMap.cc:11
StringMap::const_iterator
vector_type::const_iterator const_iterator
Definition:
StringMap.h:12
StringMap::entries_
std::vector< std::pair< std::string, int32_t > > entries_
Definition:
StringMap.h:36
StringMap.h
StringMap::find
const_iterator find(const std::string &string) const
Definition:
StringMap.cc:26
StringMap::value_type
std::pair< std::string, int32_t > value_type
Definition:
StringMap.h:10
StringMap::sort
void sort()
Definition:
StringMap.cc:7
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition:
Utils.h:6
StringMap::MatchByNumber
Definition:
StringMap.h:46
Generated for CMSSW Reference Manual by
1.8.5