Logo ROOT  
Reference Guide
ClassSelectionRule.cxx
Go to the documentation of this file.
1 // @(#)root/core/utils:$Id: ClassSelectionRule.cxx 41697 2011-11-01 21:03:41Z pcanal $
2 // Author: Velislava Spasova September 2010
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2011, Rene Brun, Fons Rademakers and al. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // ClassSelection //
15 // //
16 //////////////////////////////////////////////////////////////////////////
17 
18 #include "ClassSelectionRule.h"
19 #include <iostream>
20 
22 {
23  fFieldSelectionRules.emplace_back(field);
24 }
25 
27 {
28  return !fFieldSelectionRules.empty();
29 }
30 
31 //const std::list<VariableSelectionRule>& ClassSelectionRule::GetFieldSelectionRules()
32 const std::list<VariableSelectionRule>& ClassSelectionRule::GetFieldSelectionRules() const
33 {
34  return fFieldSelectionRules;
35 }
36 
38 {
39  fMethodSelectionRules.emplace_back(method);
40 }
41 
43 {
44  return !fMethodSelectionRules.empty();
45 }
46 
47 void ClassSelectionRule::Print(std::ostream &out) const
48 {
49  out<<"\t\tSelected (line "<< GetLineNumber() <<"): ";
50  switch(GetSelected()){
51  case BaseSelectionRule::kYes: out<<"Yes"<<std::endl;
52  break;
53  case BaseSelectionRule::kNo: out<<"No"<<std::endl;
54  break;
55  case BaseSelectionRule::kDontCare: out<<"Don't Care"<<std::endl;
56  break;
57  default: out<<"Unspecified"<<std::endl;
58  }
59  out<<"\t\tAttributes: "<<std::endl;
60  PrintAttributes(out,2);
61 
62  if (HasFieldSelectionRules()) {
63  //out<<"\t\tHas field entries"<<std::endl;
64  std::list<VariableSelectionRule> fields = GetFieldSelectionRules();
65  std::list<VariableSelectionRule>::iterator fit = fields.begin();
66  int j = 0;
67 
68  for (; fit != fields.end(); ++fit, ++j)
69  {
70  out<<"\t\tField "<<j<<":"<<std::endl;
71  out<<*fit;
72  }
73  }
74  else {
75  out<<"\t\tNo field sel rules"<<std::endl;
76  }
78  //out<<"\t\tHas method entries"<<std::endl;
79  std::list<FunctionSelectionRule> methods = GetMethodSelectionRules();
80  std::list<FunctionSelectionRule>::iterator mit = methods.begin();
81  int k = 0;
82 
83  for (; mit != methods.end(); ++mit, ++k)
84  {
85  out<<"\t\tMethod "<<k<<":"<<std::endl;
86  out<<*mit;
87  }
88  }
89  else {
90  out<<"\t\tNo method sel rules"<<std::endl;
91  }
92 }
93 
94 //const std::list<FunctionSelectionRule>& ClassSelectionRule::GetMethodSelectionRules()
95 const std::list<FunctionSelectionRule>& ClassSelectionRule::GetMethodSelectionRules() const
96 {
97  return fMethodSelectionRules;
98 }
99 
101 {
102  return fIsInheritable;
103 }
104 
106 {
107  fIsInheritable = inherit;
108 }
109 
111 {
112  return fRequestStreamerInfo;
113 }
114 
116 {
118 }
119 
121 {
122  return fRequestNoStreamer;
123 }
124 
126 {
127  fRequestNoStreamer = mn;
128 }
129 
131 {
133 }
134 
136 {
138 }
139 
141 {
142  fRequestOnlyTClass = value;
143 }
144 
146 {
147  fRequestProtected = value;
148 }
149 
151 {
152  fRequestPrivate = value;
153 }
154 
156 {
157  fRequestedVersionNumber = version;
158 }
159 
161 {
162  return fRequestOnlyTClass;
163 }
164 
166 {
167  return fRequestProtected;
168 }
169 
171 {
172  return fRequestPrivate;
173 }
174 
176 {
178 }
ClassSelectionRule::fRequestOnlyTClass
bool fRequestOnlyTClass
Definition: ClassSelectionRule.h:43
ClassSelectionRule::SetRequestedVersionNumber
void SetRequestedVersionNumber(int version)
Definition: ClassSelectionRule.cxx:155
ClassSelectionRule::SetRequestNoInputOperator
void SetRequestNoInputOperator(bool excl)
Definition: ClassSelectionRule.cxx:135
ClassSelectionRule::SetRequestOnlyTClass
void SetRequestOnlyTClass(bool val)
Definition: ClassSelectionRule.cxx:140
ClassSelectionRule::GetFieldSelectionRules
const std::list< VariableSelectionRule > & GetFieldSelectionRules() const
Definition: ClassSelectionRule.cxx:32
ClassSelectionRule::fMethodSelectionRules
std::list< FunctionSelectionRule > fMethodSelectionRules
Definition: ClassSelectionRule.h:37
ClassSelectionRule::SetInheritable
void SetInheritable(bool inherit)
Definition: ClassSelectionRule.cxx:105
ClassSelectionRule.h
BaseSelectionRule::GetSelected
ESelect GetSelected() const
Definition: BaseSelectionRule.cxx:103
ClassSelectionRule::fRequestStreamerInfo
bool fRequestStreamerInfo
Definition: ClassSelectionRule.h:40
ClassSelectionRule::fRequestNoInputOperator
bool fRequestNoInputOperator
Definition: ClassSelectionRule.h:42
BaseSelectionRule::kNo
@ kNo
Definition: BaseSelectionRule.h:45
ClassSelectionRule::RequestOnlyTClass
bool RequestOnlyTClass() const
Definition: ClassSelectionRule.cxx:160
ClassSelectionRule::fFieldSelectionRules
std::list< VariableSelectionRule > fFieldSelectionRules
Definition: ClassSelectionRule.h:36
ClassSelectionRule::RequestNoInputOperator
bool RequestNoInputOperator() const
Definition: ClassSelectionRule.cxx:130
ClassSelectionRule::fIsInheritable
bool fIsInheritable
Definition: ClassSelectionRule.h:38
ClassSelectionRule::GetMethodSelectionRules
const std::list< FunctionSelectionRule > & GetMethodSelectionRules() const
Definition: ClassSelectionRule.cxx:95
ClassSelectionRule::Print
void Print(std::ostream &out) const
Definition: ClassSelectionRule.cxx:47
BaseSelectionRule::PrintAttributes
void PrintAttributes(int level) const
Definition: BaseSelectionRule.cxx:178
ClassSelectionRule::SetRequestProtected
void SetRequestProtected(bool val)
Definition: ClassSelectionRule.cxx:145
ClassSelectionRule::SetRequestStreamerInfo
void SetRequestStreamerInfo(bool needStreamerInfo)
Definition: ClassSelectionRule.cxx:115
PyTorch_Generate_CNN_Model.fit
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
Definition: PyTorch_Generate_CNN_Model.py:32
ClassSelectionRule::fRequestPrivate
bool fRequestPrivate
Definition: ClassSelectionRule.h:45
ClassSelectionRule::AddMethodSelectionRule
void AddMethodSelectionRule(const FunctionSelectionRule &method)
Definition: ClassSelectionRule.cxx:37
ClassSelectionRule::RequestPrivate
bool RequestPrivate() const
Definition: ClassSelectionRule.cxx:170
ClassSelectionRule::fRequestNoStreamer
bool fRequestNoStreamer
Definition: ClassSelectionRule.h:41
ClassSelectionRule::SetRequestPrivate
void SetRequestPrivate(bool val)
Definition: ClassSelectionRule.cxx:150
VariableSelectionRule
Definition: VariableSelectionRule.h:26
ClassSelectionRule::HasFieldSelectionRules
bool HasFieldSelectionRules() const
Definition: ClassSelectionRule.cxx:26
ClassSelectionRule::RequestStreamerInfo
bool RequestStreamerInfo() const
Definition: ClassSelectionRule.cxx:110
BaseSelectionRule::kYes
@ kYes
Definition: BaseSelectionRule.h:44
ClassSelectionRule::IsInheritable
bool IsInheritable() const
Definition: ClassSelectionRule.cxx:100
ClassSelectionRule::RequestedVersionNumber
int RequestedVersionNumber() const
Definition: ClassSelectionRule.cxx:175
ClassSelectionRule::SetRequestNoStreamer
void SetRequestNoStreamer(bool noStreamer)
Definition: ClassSelectionRule.cxx:125
BaseSelectionRule::GetLineNumber
long GetLineNumber() const
Definition: BaseSelectionRule.h:101
BaseSelectionRule::kDontCare
@ kDontCare
Definition: BaseSelectionRule.h:46
ClassSelectionRule::fRequestProtected
bool fRequestProtected
Definition: ClassSelectionRule.h:44
ClassSelectionRule::RequestProtected
bool RequestProtected() const
Definition: ClassSelectionRule.cxx:165
ClassSelectionRule::fRequestedVersionNumber
int fRequestedVersionNumber
Definition: ClassSelectionRule.h:46
ClassSelectionRule::AddFieldSelectionRule
void AddFieldSelectionRule(const VariableSelectionRule &field)
Definition: ClassSelectionRule.cxx:21
ClassSelectionRule::HasMethodSelectionRules
bool HasMethodSelectionRules() const
Definition: ClassSelectionRule.cxx:42
ClassSelectionRule::RequestNoStreamer
bool RequestNoStreamer() const
Definition: ClassSelectionRule.cxx:120