English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReLauncher: TKeyScript.h Source File
Uranie / ReLauncher v4.9.0
/* @license-end */
TKeyScript.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 by
6// 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 1.3 $
22// $State$
24
32#ifndef __TKEYSCRIPT__
33#define __TKEYSCRIPT__
34
35#include <fstream>
36//ROOT
37#include "TString.h"
38#include "TList.h"
39#include "TObjArray.h"
40#include "TRegexp.h"
41
42//Uranie
43#include "Relauncher.h"
44#include "TAttribute.h"
45#include "TCodeEval.h"
46
47namespace URANIE
48{
49namespace Relauncher
50{
51
52class TKeyParser: public TNamed
53{
54
55
56public:
57 URANIE::DataServer::TAttribute *_att;
61
63 public:
65 std::cout<<"␛[91m <ERROR> \n <ERROR> The key "<<key.Data()<<" is not found in the provided input file.\n <ERROR>␛[0m"<<std::endl;
66 }
67 };
68 std::stringstream buffer;
69
70 TKeyParser(const char *name, URANIE::DataServer::TAttribute *att);
71 virtual ~TKeyParser();
72
73 //virtual Bool_t IsSortable();
74 virtual Int_t Compare(const TObject *) const;
75 void build(int id, std::istream &fi);
77 TString &replace(TString *line, URANIE::DataServer::UEntry *val, TString format);
80};
81
83{
84protected:
85 TString _path;
86 TObjArray _vars;
87 TString _format;
88
89public:
90
92 public:
93 FileNotFound(TString file){
94 std::cout<<"␛[91m <ERROR> \n <ERROR> The file "<<file<<" is not found. Cannot proceed to search for keys.\n <ERROR>␛[0m"<<std::endl;
95 }
96 };
97 TKeyScript(const char *path);
98 virtual ~TKeyScript(void);
99
100 void addInput(URANIE::DataServer::TAttribute *, const char *);
101 void setInputs(Int_t size, URANIE::DataServer::TAttribute *, const char *,
102 ...);
103 void setVectorProperties( TString beg, TString delim, TString end);
104 void setStringProperties( TString beg, TString end);
105 void setFormat(TString form) {_format=form;}
106
107 /* protocole */
108 virtual void build(TString &dir, TObjArray *in);
109 virtual void put(TString &ref, TString &tmp, Double_t*);
110 virtual void put(TString &ref, TString &tmp, vector<URANIE::DataServer::UEntry*> *in);
111
112 ClassDef(URANIE::Relauncher::TKeyScript, ID_RELAUNCHER)
113
114};
115
116}
117} //namespace
118
119#endif
120
encapsulation dun TCode
Definition TCodeEval.h:54
KeyNotFound(TString key)
Definition TKeyScript.h:64
Definition TKeyScript.h:53
void build(int id, std::istream &fi)
Definition TKeyScript.cxx:101
TString _sstrend
Definition TKeyScript.h:59
URANIE::DataServer::TAttribute * _att
Definition TKeyScript.h:57
TString _svecend
Definition TKeyScript.h:59
void setVectorProperties(TString beg, TString delim, TString end)
Definition TKeyScript.cxx:73
Ssiz_t _index
Definition TKeyScript.h:58
TRegexp _re_equ
Definition TKeyScript.h:60
Ssiz_t _line
Definition TKeyScript.h:58
Ssiz_t _istop
Definition TKeyScript.h:58
TString & replace(TString *line, Double_t val)
Definition TKeyScript.cxx:130
void setStringProperties(TString beg, TString end)
Definition TKeyScript.cxx:81
virtual Int_t Compare(const TObject *) const
Definition TKeyScript.cxx:95
TString _sstrbeg
Definition TKeyScript.h:59
TRegexp _re_full
Definition TKeyScript.h:60
TString _svecbeg
Definition TKeyScript.h:59
Ssiz_t _istart
Definition TKeyScript.h:58
std::stringstream buffer
Definition TKeyScript.h:68
virtual ~TKeyParser()
Definition TKeyScript.cxx:89
TString _svecdel
Definition TKeyScript.h:59
TRegexp _re_fin
Definition TKeyScript.h:60
FileNotFound(TString file)
Definition TKeyScript.h:93
Definition TKeyScript.h:83
virtual void build(TString &dir, TObjArray *in)
Definition TKeyScript.cxx:204
TString _path
Definition TKeyScript.h:85
void setInputs(Int_t size, URANIE::DataServer::TAttribute *, const char *,...)
Definition TKeyScript.cxx:183
virtual ~TKeyScript(void)
Definition TKeyScript.cxx:148
void setVectorProperties(TString beg, TString delim, TString end)
Definition TKeyScript.cxx:160
TString _format
Definition TKeyScript.h:87
TObjArray _vars
Definition TKeyScript.h:86
void setStringProperties(TString beg, TString end)
Definition TKeyScript.cxx:169
virtual void put(TString &ref, TString &tmp, Double_t *)
Definition TKeyScript.cxx:231
void setFormat(TString form)
Definition TKeyScript.h:105
void addInput(URANIE::DataServer::TAttribute *, const char *)
Definition TKeyScript.cxx:178
Definition TBaseEval.cxx:44