31 #ifndef G4ATTRIBUTEFILTERT_HH
32 #define G4ATTRIBUTEFILTERT_HH
57 virtual void Print(std::ostream& ostr)
const;
71 typedef std::pair<G4String, Config>
Pair;
90 ,fWarnedMissingAttribute(
false)
100 template <
typename T>
105 if (fAttName.isNull()) {
107 if (!fWarnedMissingAttribute) {
109 fWarnedMissingAttribute =
true;
124 static G4bool warnedUnableToExtract =
false;
125 if (!warnedUnableToExtract) {
127 ed <<
"Unable to extract attribute definition named "<<fAttName;
129 (
"G4AttributeFilterT::Evaluate",
"modeling0102",
JustWarning, ed,
"Invalid attribute definition");
130 G4cout <<
"Available attributes:\n"
131 <<
object.GetAttDefs();
132 warnedUnableToExtract =
true;
141 typename ConfigVect::const_iterator iter = fConfigVect.begin();
143 while (iter != fConfigVect.end()) {
155 static G4bool warnedUnableToExtract =
false;
156 if (!warnedUnableToExtract) {
158 ed <<
"Unable to extract attribute value named "<<fAttName;
160 (
"G4AttributeFilterT::Evaluate",
"modeling0103",
JustWarning, ed,
"InvalidAttributeValue");
161 G4cout <<
"Available attributes:\n"
162 <<
object.GetAttDefs();
163 warnedUnableToExtract =
true;
169 G4cout<<
"G4AttributeFilterT processing attribute named "<<fAttName;
174 return (
filter->Accept(attVal));
177 template <
typename T>
185 template <
typename T>
189 ostr<<
"Printing data for G4Attribute filter named: "<<
G4VFilter<T>::Name()<<std::endl;
190 ostr<<
"Filtered attribute name: "<<fAttName<<std::endl;
191 ostr<<
"Printing sub filter data:"<<std::endl;
195 template <
typename T>
202 template <
typename T>
208 typename ConfigVect::iterator iter = std::find(fConfigVect.begin(), fConfigVect.end(), myPair);
210 if (iter != fConfigVect.end()) {
212 ed <<
"Interval "<< interval <<
" already exists";
214 (
"G4AttributeFilterT::AddInterval",
"modeling0104",
JustWarning, ed);
218 fConfigVect.push_back(myPair);
221 template <
typename T>
227 typename ConfigVect::iterator iter = std::find(fConfigVect.begin(), fConfigVect.end(), myPair);
229 if (iter != fConfigVect.end()) {
231 ed <<
"Single value "<< value <<
" already exists";
233 (
"G4AttributeFilterT::AddValue",
"modeling0105",
JustWarning, ed);
236 fConfigVect.push_back(myPair);