English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TCodeFile.h Source File
Uranie / Launcher v4.9.0
/* @license-end */
TCodeFile.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published
6// by the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
18// $Id$
19// $Author$
20// $Date$
21// $Revision$
22// $State$
24
41#ifndef TCODEFILE_H
42#define TCODEFILE_H
43
44#include <stdlib.h>
45#include <iostream>
46#include <vector>
47#include <algorithm> // std::find
48using std::cout;
49using std::endl;
50using std::vector;
51
52// ROOT
53#include "Rtypes.h"
54#include "TString.h"
55#include "TSystem.h"
56
57// URANIE
58#include "Launcher.h"
59#include "TAttribute.h"
60#include "UEntry.h"
61
62//STL
63#include <vector>
64
65namespace URANIE
66{
67namespace Launcher
68{
69
70class TCodeFile: public TNamed
71{
72public:
73 vector<URANIE::DataServer::TAttribute *> _attributes;
75 TString _sFileName;
76 Bool_t _blog;
77
78 TString _cComments;
79 TString _cSeparators;
81public:
82 //---------------------------------------------
86
88 TCodeFile(TString str);
90 virtual ~TCodeFile();
92
93 //---------------------------------------------
97
100 virtual void addAttribute(URANIE::DataServer::TAttribute*);
102
103 //---------------------------------------------
107 TString getFileName()
108 {
109 return _sFileName;
110 }
111
112 void setCommentCharacter(const char* str)
113 {
114 _cComments = str;
115 }
117 {
118 return _cComments;
119 }
124 void setSeparatorCharacter(const char* str);
125
127 {
128 return _cSeparators;
129 }
130
131 void setFieldSeparatorCharacter(const char* str);
132
134 {
135 return _cFieldSeparator;
136 }
137
138 URANIE::DataServer::TAttribute * getAttribute(Int_t ind);
139
140 Int_t getAttributesNumber() const;
141
142 Int_t getNAttributes() const
143 {
144 return getAttributesNumber();
145 }
146
147 inline void setVectorProperties( TString beg, TString delim, TString end)
148 {
149 _svecbeg = beg;
150 _svecdel = delim;
151 _svecend = end;
152 }
153 inline void setStringProperties( TString beg, TString end)
154 {
155 _sstrbeg = beg;
156 _sstrend = end;
157 }
158
159 inline void getBegEndProperties( URANIE::DataServer::TAttribute *att, TString &beg, TString &end)
160 {
161 if( att->getDataType()==URANIE::DataServer::TAttribute::kVector)
162 {
163 beg = _svecbeg;
164 end = _svecend;
165 }
166 else if( att->getDataType()==URANIE::DataServer::TAttribute::kString)
167 {
168 beg = _sstrbeg;
169 end = _sstrend;
170 }
171 else
172 {
173 beg = "";
174 end = "";
175 }
176 }
177
183 Bool_t isAttribute(TString sAttributeName);
184
186
187 //---------------------------------------------
191 void setLog()
192 {
193 _blog = kTRUE;
194 }
195 void unsetLog()
196 {
197 _blog = kFALSE;
198 }
200 {
201 _blog = _blog ? kFALSE : kTRUE;
202 }
203 Bool_t getLog()
204 {
205 return _blog;
206 }
207 virtual void printLog(Option_t *option = "");
209
210 ClassDef(URANIE::Launcher::TCodeFile, ID_LAUNCHER)
211 //Classe de
212};
213
214} // Fin du namespace Launcher
215} // Fin du namespace URANIE
216#endif
Description of the class TCodeFile.
Definition TCodeFile.h:71
void unsetLog()
Definition TCodeFile.h:195
TString getFileName()
Definition TCodeFile.h:107
void changeLog()
Definition TCodeFile.h:199
Bool_t _blog
Boolean for edit the log.
Definition TCodeFile.h:76
TString _sFileName
The name of file.
Definition TCodeFile.h:75
virtual void addAttribute(URANIE::DataServer::TAttribute *)
Add the attribute in the file.
void getBegEndProperties(URANIE::DataServer::TAttribute *att, TString &beg, TString &end)
Definition TCodeFile.h:159
vector< URANIE::DataServer::TAttribute * > _attributes
Vector of attributes.
Definition TCodeFile.h:73
Int_t getAttributesNumber() const
void setVectorProperties(TString beg, TString delim, TString end)
Definition TCodeFile.h:147
const char * getFieldSeparatorCharacter()
Definition TCodeFile.h:133
void setFieldSeparatorCharacter(const char *str)
Bool_t getLog()
Definition TCodeFile.h:203
void setSeparatorCharacter(const char *str)
TString _svecdel
Definition TCodeFile.h:74
virtual ~TCodeFile()
Default destructor.
TString _cFieldSeparator
the separator to be used in between fields
Definition TCodeFile.h:80
URANIE::DataServer::TAttribute * getAttribute(Int_t ind)
void setStringProperties(TString beg, TString end)
Definition TCodeFile.h:153
TString _cComments
The set of comment character.
Definition TCodeFile.h:78
TString _svecend
Definition TCodeFile.h:74
const char * getSeparatorCharacter()
Definition TCodeFile.h:126
void setCommentCharacter(const char *str)
Definition TCodeFile.h:112
TString _sstrend
string used for the beginning, end and delimitation of vectors and strings
Definition TCodeFile.h:74
virtual void printLog(Option_t *option="")
void setLog()
Definition TCodeFile.h:191
const char * getCommentCharacter()
Definition TCodeFile.h:116
TString _sstrbeg
Definition TCodeFile.h:74
TString _svecbeg
Definition TCodeFile.h:74
TString _cSeparators
The set of separator character.
Definition TCodeFile.h:79
Bool_t isAttribute(TString sAttributeName)
Verify is the attribute given by the name is is the list of attribute.
TCodeFile(TString str)
Default constructor.
Int_t getNAttributes() const
Definition TCodeFile.h:142
Definition TCluster.h:67