13 parE_type::iterator pit = pe.find(e_it->first);
14 if (e_it->second.use_) {
16 if (pit != pe.end()) {
29 DCOUT(
'e',
"AlgoCheck::check(): optional param=" << e_it->first);
32 if (pit != pe.end()) {
38 if (e_it->second.default_) {
39 for(
int j=0;
j<e_it->second.minOccurs_; ++
j)
40 pe[e_it->first].push_back(e_it->second.defaultVal_);
53 parS_type::iterator sit = ps.find(s_it->first);
54 if (s_it->second.use_) {
56 if (sit != ps.end()) {
67 if (s_it->second.default_) {
68 for (
int j = 0;
j < s_it->second.minOccurs_; ++
j)
69 ps[s_it->first].push_back(s_it->second.defaultVal_);
79 constraintsE_type::iterator cit,
85 DCOUT(
'e',
"AlgoCheck::checkBounds(), par-name=" << pit->first );
86 DCOUT(
'e',
" minOccurs = " << cit->second.minOccurs_ );
87 DCOUT(
'e',
" maxOccurs = " << cit->second.maxOccurs_ );
88 DCOUT(
'e',
" par-occurs = " << pit->second.size() );
90 if (cit->second.minOccurs_ >
int(pit->second.size()) ) {
91 err +=
"\tpar. " + cit->first
92 +
" occurs=" +
d2s(pit->second.size()) +
std::string(
" < minOccurs; minOccurs=")
94 +
d2s(cit->second.maxOccurs_)
97 DCOUT(
'e',
" VIOLATION of minOccurs");
100 if (cit->second.maxOccurs_ <
int(pit->second.size()) ) {
101 err +=
"\tpar. " + cit->first
102 +
" occurs=" +
d2s(pit->second.size()) +
std::string(
" > maxOccurs; minOccurs=")
104 +
d2s(cit->second.maxOccurs_)
107 DCOUT(
'e',
" VIOLATION of maxOccurs");
115 int m=int(pit->second.size());
117 if (pit->second[i] < cit->second.min_) {
124 if (pit->second[i] > cit->second.max_) {
142 int len = snprintf( buffer, 25,
"%g", x );
144 edm::LogError(
"DoubleToString" ) <<
"Length truncated (from " << len <<
")";
150 constraintsS_type::iterator cit,
155 if (cit->second.minOccurs_ >
int(sit->second.size()) ) {
156 err +=
"\tpar. " + cit->first
157 +
" occurs=" +
d2s(sit->second.size()) +
std::string(
" < minOccurs; minOccurs=")
159 +
d2s(cit->second.maxOccurs_)
162 DCOUT(
'e',
" VIOLATION of minOccurs");
165 if (cit->second.maxOccurs_ <
int(sit->second.size()) ) {
166 err +=
"\tpar. " + cit->first
167 +
" occurs=" +
d2s(sit->second.size()) +
std::string(
" > maxOccurs; minOccurs=")
169 +
d2s(cit->second.maxOccurs_)
172 DCOUT(
'e',
" VIOLATION of maxOccurs");
177 int m = int(sit->second.size());
181 int ss = int(s.size());
184 for (; j < ss; ++
j) {
188 if (j == ss && s[j] ==
' ') {
191 DCOUT(
'e',
" VIOLATION of requiring non-blank std::strings");
bool checkBounds(parE_type::iterator pit, constraintsE_type::iterator cit, std::string &err)
static std::string d2s(double x)
ahh, converts a double into a std::string ... yet another one of this kind!
std::map< std::string, std::vector< std::string > > parS_type
bool check(parS_type &ps, parE_type &pe, std::string &err)
returns true if the check was successfull (parameters conform to XML specification) ...
constraintsS_type constraintsS_
format: "ParameterName" -> ConstraintS
std::map< std::string, std::vector< double > > parE_type
constraintsE_type constraintsE_
format: "ParameterName" -> ConstraintE
bool checkStrings(parS_type::iterator sit, constraintsS_type::iterator cit, std::string &err)
#define DCOUT(M_v_Y, M_v_S)