38 std::cout << std::string(
n,
' ');
121 register_factory (
"alternate_regions", std::make_unique<AltRegionsFactory>());
136 std::cout <<
"IdDictParser::parse1>" << std::endl;
140 std::cout <<
"IdDictParser::parse2>" << std::endl;
144 std::cout <<
"IdDictParser::parse3>" << std::endl;
176 std::cout <<
"IdDictMgrFactoryFactory::idd_start>" << std::endl;
186 std::cout <<
"IdDictMgrFactoryFactory::idd_end>" << std::endl;
194 std::cout <<
"DictionaryFactory::idd_start>" << std::endl;
196 parser.m_dictionary = std::make_unique<IdDictDictionary>
207 std::cout <<
"DictionaryFactory::idd_end> d=" <<
parser.m_dictionary.get() << std::endl;
210 if (
parser.m_dictionary != 0){
211 parser.m_idd.add_dictionary (std::move(
parser.m_dictionary));
219 std::cout <<
"FieldFactory::idd_start>" << std::endl;
228 std::cout <<
"FieldFactory::idd_end>" << std::endl;
231 if (
parser.m_field != 0) {
232 if (
parser.m_dictionary != 0)
parser.m_dictionary->add_field (std::move(
parser.m_field));
233 else parser.m_field.reset();
241 std::cout <<
"LabelFactory::idd_start>" << std::endl;
244 std::unique_ptr<IdDictLabel>
label;
258 std::cout <<
"LabelFactory::idd_end>" << std::endl;
266 std::cout <<
"AltRegionsFactory::idd_start>" << std::endl;
268 auto altregions = std::make_unique<IdDictAltRegions>();
271 std::cout <<
"AltRegionsFactory::idd_start> previous=" <<
parser.m_altregions.get()
272 <<
" new=" << altregions.get()
275 parser.m_altregions = std::move(altregions);
282 std::cout <<
"AltRegionsFactory::idd_end>" << std::endl;
284 if (
parser.m_altregions != 0) {
286 parser.m_altregions->select_region (
"");
289 if (
parser.m_dictionary != 0)
parser.m_dictionary->add_dictentry (std::move(
parser.m_altregions));
290 else parser.m_altregions.reset();
298 std::cout <<
"RegionFactory::idd_start>" << std::endl;
313 std::string::size_type
pos = 0;
315 std::string::size_type
next;
317 if (
next == std::string::npos)
break;
323 if (
next == std::string::npos) {
333 std::string::size_type
pos = 0;
335 std::string::size_type
next;
338 if (
next == std::string::npos)
break;
346 if (
next == std::string::npos) {
356 std::string::size_type
pos = 0;
358 std::string::size_type prev;
359 prev =
names.find_first_not_of (
" ",
pos);
360 if (prev == std::string::npos)
break;
362 prev =
names.find_first_of (
" ",
pos);
366 if (prev == std::string::npos) {
376 std::string::size_type
pos = 0;
378 std::string::size_type
next;
380 if (
next == std::string::npos)
break;
386 if (
next == std::string::npos) {
401 std::cout <<
"RegionFactory::idd_start> name, group, tag, next eta, prev/next samp, prev/next subdet "
402 <<
parser.m_region->name() <<
" "
403 <<
parser.m_region->group_name() <<
" "
404 <<
parser.m_region->tag() <<
" "
405 <<
parser.m_region->next_abs_eta() <<
" ";
406 for (
const std::string&
s :
parser.m_region->prev_samp_names()) {
407 std::cout <<
s <<
" ";
409 for (
const std::string&
s :
parser.m_region->next_samp_names()) {
410 std::cout <<
s <<
" ";
412 for (
const std::string&
s :
parser.m_region->prev_subdet_names()) {
413 std::cout <<
s <<
" ";
415 for (
const std::string&
s :
parser.m_region->next_subdet_names()) {
416 std::cout <<
s <<
" ";
418 std::cout <<
parser.m_region->eta0() <<
" "
419 <<
parser.m_region->deta() <<
" "
420 <<
parser.m_region->phi0() <<
" "
421 <<
parser.m_region->dphi() <<
" "
430 std::cout <<
"RegionFactory::idd_end>" << std::endl;
432 if (
parser.m_region != 0){
433 if (
parser.m_dictionary != 0)
parser.m_dictionary->add_region (
parser.m_region.get());
436 if (
parser.m_region->n_entries() == 0) {
437 parser.m_region->set_is_empty();
440 if (
parser.m_altregions != 0) {
441 parser.m_altregions->add_region (std::move(
parser.m_region));
442 }
else if (
parser.m_dictionary != 0) {
443 parser.m_dictionary->add_dictentry (std::move(
parser.m_region));
454 std::cout <<
"SubRegionFactory::idd_start>" << std::endl;
463 std::cout <<
"SubRegionFactory::idd_end>" << std::endl;
465 if (
parser.m_subregion != 0) {
466 if (
parser.m_dictionary != 0)
parser.m_dictionary->add_subregion (std::move(
parser.m_subregion));
467 else parser.m_subregion.reset();
475 std::cout <<
"RegionEntryFactory::idd_start>" << std::endl;
483 std::cout <<
"RegionEntryFactory::idd_end>" << std::endl;
485 if (
parser.m_regionentry != 0){
486 if (
parser.m_region != 0)
parser.m_region->add_entry (std::move(
parser.m_regionentry));
487 else if (
parser.m_subregion != 0)
parser.m_subregion->add_entry (std::move(
parser.m_regionentry));
488 else parser.m_regionentry.reset();
496 std::cout <<
"RangeFactory::idd_start>" << std::endl;
503 std::string::size_type
pos = 0;
504 std::vector<std::string> label_vec;
506 std::string::size_type
next;
508 if (
next == std::string::npos)
break;
512 if (
next == std::string::npos) {
518 range->set_range (label_vec);
522 if (hasMin and hasMax) {
531 if (wraparound)
range->set_wrap_around();
546 std::cout <<
"ReferenceFactory::idd_start>" << std::endl;
555 std::cout <<
"DictionaryRefFactory::idd_start>" << std::endl;
557 auto dictionaryref = std::make_unique<IdDictDictionaryRef> (
get_value (
node,
"name"));
559 if (dictionaryref->dictionary_name() !=
"") {
560 parser.m_idd.add_subdictionary_name (dictionaryref->dictionary_name());
561 if (
parser.m_dictionary != 0)
parser.m_dictionary->add_subdictionary_name (dictionaryref->dictionary_name());
563 parser.m_regionentry = std::move(dictionaryref);