26 #ifndef ADF_ConfigurationFrame
43 namespace { UInt_t gAllocated = 0u; }
55 if ( gAllocated == 1 ) {
57 std::clog <<
"[[static]] ConfAgent::~ConfAgent() ]\n[...\n" ;
61 std::clog <<
" done\n...]\n";
70 if ( model ==
"kStrict" )
72 else if ( model ==
"kGrowing" )
80 const char *model = 0x0;
97 if ( gTheGlobalAgent && gAllocated == 1 ) {
99 std::clog <<
"[[static]] KilltheGlobalAgent() ]\n[...\n" ;
100 std::clog <<
" Destroying the global agent ... " <<
std::endl;
102 delete gTheGlobalAgent;
104 std::clog <<
" done\n...]\n";
106 gTheGlobalAgent = 0x0;
208 {
return fRunAgent ;}
210 {
return const_cast<const DFAgent *
> (fDFAgent) ;}
212 {
return const_cast<const RunAgent *
> (fRunAgent) ;}
214 ConfAgent *
Clone(
const char *comment =
"Clone of the global ConfAgent");
220 virtual Bool_t
Configure(
const Char_t *name,
const char *option =
"in", Bool_t allow_init =
true)
230 fDFAgent(new
DFAgent(
"ADF::ConfAgent",
"Agata",true,true)),
231 fRunAgent(new
RunAgent(
"ADF::ConfAgent",
"Run"))
250 if ( tmp.size() > 0 && !(tmp.at(tmp.size()-1) ==
'/') )
255 fLog <<
info <<
"Init Global Conf Agent from distribution " << tmp <<
nline;
257 fLog <<
error <<
"Failed to init Global Conf Agent from distribution " << tmp <<
nline;
266 if ( ::getenv(
"ADF_CONF_PATH") ) {
268 tmp = ::getenv(
"ADF_CONF_PATH");
270 if ( tmp.size() > 0 && !(tmp.at(tmp.size()-1) ==
'/') )
274 fLog <<
info <<
"Init Global Conf Agent from ADF_CONF_PATH " << tmp <<
nline;
276 fLog <<
warning <<
"Failed to init Global Conf Agent from ADF_CONF_PATH " << tmp <<
nline;
279 fLog <<
warning <<
"ADF_CONF_PATH NOT DEFINED !, try init Global Conf Agent from current dir ..." <<
nline;
297 fDFAgent(new
DFAgent(
"ADF::ConfAgent",
"Agata",true,false)),
298 fRunAgent(new
RunAgent(
"ADF::ConfAgent",
"Run"))
312 delete fDFAgent; fDFAgent = 0x0;
315 delete fRunAgent; fRunAgent = 0x0;
321 if ( gTheGlobalAgent == 0x0 ) {
323 std::clog <<
"[[static]] Creating the global ConfAgent ]\n[...\n";
337 if ( gTheGlobalAgent )
338 std::clog <<
" done\n...]\n";
340 { std::clog <<
" *** ERROR *** \n"; std::clog <<
"...]\n"; }
343 return gTheGlobalAgent;
358 std::ostringstream o;
362 std::istringstream i(tmp);
373 Bool_t ok; std::string opt = option;
379 std::istringstream in;
381 in.str((frame->
String()));
386 std::ostringstream out;
391 out << ends << ends << ends << ends << ends << ends << ends << ends << ends << ends << ends << ends;
392 out << ends << ends << ends << ends << ends << ends << ends << ends <<
"\n";
394 frame->
String() = out.str();
404 if ( gTheGlobalAgent == 0x0 ) {
406 std::clog <<
"[[static]] Creating the global ConfAgent ]\n[...\n";
408 if ( which_agent ==
"Agata" ) {
412 if ( gTheGlobalAgent )
413 std::clog <<
" done\n...]\n";
415 { std::clog <<
" *** ERROR *** \n"; std::clog <<
"...]\n"; }
418 return gTheGlobalAgent;
virtual void SetLevel(ELevel lev, unsigned short verbosity=0u)
To get the current level of the message.
static MainFrameFactory & theMainFactory()
the main (global) keyfactory
static void KilltheGlobalAgent()
to kill the global agent
DotConf : Utility for class configuration from ascii file or Configuration frames.
LogMessage & info(LogMessage &)
manipulator to modify the LogMessage
static const Char_t * GetStringModel(ConfAgent::EModel)
void SetLastModif()
set in last modif string the current date.
static AgataConfAgent * theGlobalAgent()
A configuration frame is just an encapsulation of a string.
void SetComment(const Char_t *comment)
LogMessage & error(LogMessage &)
ConfAgent * Clone(const char *comment="Clone of the global ConfAgent")
Clone of the main (global) Agent.
AgataConfAgent()
used to set global agent
The Agata Data Flow agent.
static ConfAgent * theGlobalAgent(std::string="Agata")
to get the global agent
virtual UInt_t Read()
It reads the content of the string from the Frame.
static ConfAgent::EModel GetModel(std::string)
virtual Bool_t Configure(ConfigurationFrame *, const char *option="in", Bool_t allow_init=false)
configuration from/to a configuration frame : extact string from the frame and call DoConfigure ...
virtual UInt_t Write()
It writes to the Frame the content of the string.
virtual const DFAgent * GetConstDFAgent() const
virtual void SetProcessMethod(const char *)
To set the current method.
bool IsDebug(short debug_to_test) const
to test if the required debug level is lower that the global one
LogMessage & nline(LogMessage &)
LogMessage fLog
the log messenger ... to know the object hae been properly intitialised/modified
virtual Bool_t DoConfigure(std::istream &, Bool_t allow_init)
configure this from an input stream
virtual ~AgataConfAgent()
destructor
header file for DFAgent.cpp
Bool_t Register(KeyFactory *)
Add one factory to this collection of keyfactories: name has to be unique so return false if a factor...
A DFAgent contains all the information concerning the structure of the data flow. ...
virtual RunAgent * GetRunAgent()
to get the run Agent in charge of knowing the conditions of the DF being processed ...
ADF::LogMessage & endl(ADF::LogMessage &log)
header file for ConfAgent.cpp
header file for RunAgent.cpp
Bool_t Register(FrameFactory *)
Add one factory to this collection of keyfactories: name has to be unique so return false if a factor...
virtual void AddConf(DotConf *)
add a conf object to this. The added objects are not owned by this so not deleted.
LogMessage & dolog(LogMessage &)
virtual std::string & GetProcessName()
To get the Process name.
static MainKeyFactory & theMainFactory()
the main (global) keyfactory
virtual const RunAgent * GetConstRunAgent() const
virtual DFAgent * GetDFAgent()
to get the Data Flow Agent in charge of knowing the structure of the DF
std::string GetPathToConfFile()
virtual Bool_t Configure(const Char_t *name, const char *option="in", Bool_t allow_init=true)
to avoid some warning of hidden methods
void SetWithRecord(Bool_t is_record=true)
to change the behavior
LogMessage & warning(LogMessage &)