GENIEGenerator
Loading...
Searching...
No Matches
AlgId.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
11#include <sstream>
12
14
15using std::ostringstream;
16
17using namespace genie;
18
19//____________________________________________________________________________
20namespace genie
21{
22 ostream & operator << (ostream & stream, const AlgId & algid)
23 {
24 algid.Print(stream);
25 return stream;
26 }
27}
28//____________________________________________________________________________
30{
31 this->Init();
32}
33//____________________________________________________________________________
34AlgId::AlgId(string name, string config)
35{
36 this->SetId(name,config);
37}
38//____________________________________________________________________________
40{
41 this->Copy(id);
42}
43//____________________________________________________________________________
44AlgId::AlgId(const RgAlg & registry_item)
45{
46 this->Copy(registry_item);
47}
48//____________________________________________________________________________
50{
51
52}
53//____________________________________________________________________________
54void AlgId::SetName(string name)
55{
56 this->SetId(name, this->Config());
57}
58//____________________________________________________________________________
59void AlgId::SetConfig(string config)
60{
61 this->SetId(this->Name(), config);
62}
63//____________________________________________________________________________
64void AlgId::SetId(string name, string config)
65{
66 this->fName = name;
67 this->fConfig = config;
68
69 this->UpdateKey();
70}
71//____________________________________________________________________________
72void AlgId::Copy(const AlgId & id)
73{
74 this->fName = id.Name();
75 this->fConfig = id.Config();
76
77 this->UpdateKey();
78}
79//____________________________________________________________________________
80void AlgId::Copy(const RgAlg & registry_item)
81{
82 this->fName = registry_item.name;
83 this->fConfig = registry_item.config;
84
85 this->UpdateKey();
86}
87//____________________________________________________________________________
88void AlgId::Print(ostream & stream) const
89{
90 stream << this->Key();
91}
92//____________________________________________________________________________
94{
95 ostringstream key;
96
97 key << this->Name();
98 if(this->Config().size() > 0) key << "/" << this->Config();
99
100 fKey = key.str();
101}
102//____________________________________________________________________________
103void AlgId::Init(void)
104{
105 this->fName = "";
106 this->fConfig = "";
107 this->fKey = "";
108}
109//____________________________________________________________________________
void Init(void)
Definition AlgId.cxx:103
string fKey
Unique key: namespace::alg_name/alg_config.
Definition AlgId.h:64
string Config(void) const
Definition AlgId.h:45
void SetConfig(string config)
Definition AlgId.cxx:59
string Key(void) const
Definition AlgId.h:46
void UpdateKey(void)
Definition AlgId.cxx:93
string Name(void) const
Definition AlgId.h:44
string fConfig
Configuration set name.
Definition AlgId.h:63
void Print(ostream &stream) const
Definition AlgId.cxx:88
void Copy(const AlgId &id)
Definition AlgId.cxx:72
void SetName(string name)
Definition AlgId.cxx:54
string fName
Algorithm name (including namespaces)
Definition AlgId.h:62
void SetId(string name, string config="")
Definition AlgId.cxx:64
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)