110 msgSvc(0,
" ***********************************************",
"");
111 msgSvc(0,
" * C A T *",
"");
113 msgSvc(0,
" * |\\-''-/|.___..--''\"`-._ *",
"");
114 msgSvc(0,
" * `6_ 6 ) `-. ( ).`-.__.`) *",
"");
115 msgSvc(0,
" * (_Y_.)' ._ ) `._ `. ``-..-' *",
"");
116 msgSvc(0,
" * _..`--'_..- _/ /--'_.' ,' *",
"");
117 msgSvc(0,
" * (il),-'' (li),' ((!.-' *",
"");
118 msgSvc(0,
" ***********************************************",
"");
120 msgSvc(0,
"Application running on "+
152 filename.append(
"/.cathist");
154 last.open( filename.c_str() );
155 if ( !last.fail() ) {
158 info(
"Recovering last run number : "+
itos(nrun)+
". Will start from "+
itos(nrun+1)+
".",
"Application:loadHistoryFile");
162 info(
"No history file found.",
"Application:loadHistoryFile");
172 filename.append(
"/.cathist");
174 last.open( filename.c_str() );
176 warning(
"Cannot do the bookkeeping",
"Application::bookkeeping");
190 if (mkdir(directory.c_str(), 0777) == -1) {
191 warning(
"Could not create directory "+directory+
". Error "+strerror(errno),
"Application:makeDir");
227 if (status.compare(
"")!=0) strcpy(
m_state->
status,status.c_str());
242 warning(
"Cannot find the Element at the current position of the Hierarchy",
243 "Application::setConfig");
248 current.append(
"] ");
253 std::list<Processus*>::iterator
proc;
254 for (proc=listproc.begin(); proc!=listproc.end(); ++proc) {
255 if ( proc!=listproc.begin() ) { current.append(
":"); }
256 current.append((*proc)->name());
263 std::vector<Hierarchy*>::iterator iter;
264 for (iter=list.begin(); iter!=list.end(); ++iter) {
265 if ( iter!=list.begin() ) { current.append(
":"); }
266 current.append((*iter)->name());
268 current.append((*iter)->type());
283 if (
name.compare(
"")==0 ) {
291 info(
"Update server information.",
"Application::network");
297 info(
"Stop network connection.",
"Application::network");
310 info(
"Delete CAT server.",
"Application::server");
317 info(
"Update server information.",
"Application::server");
330 warning(
"Type '" + type +
"' not understood");
350 std::string control =
ctrl();
351 if ( 0 == control.compare(
"pause") ) {
353 warning(
"Pause.",
"Application::svcRunning");
356 std::string newctrl =
ctrl();
358 usleep( 1000 * delay );
359 if ( 0==newctrl.compare (
"stop") ) {
362 if ( 0==newctrl.compare (
"resume") ) {
370 if ( 0 == control.compare(
"stop") ) {
371 info(
"User interruption.",
"Application::svcRunning");
385 warning(
"No implementation in cmd mode yet.",
"Application::svcPlot");
397 verbose(
"Prepare for a new run.",
"Application::prepare");
402 std::list<Processus*>::iterator
proc;
406 for (proc=listproc.begin(); proc!=listproc.end(); ++proc) {
407 if ( procName.compare( (*proc)->name() ) == 0 ) {
408 process = (*proc)->
clone();
418 warning(
"Processus " + procName +
" not found.",
"Application::prepare");
450 warning(
"Program initialization interrupted.",
"Application::prepare");
466 info(
"[Processing evt "+
itos(currentNEvt)+
"]",
"Application::loop");
473 warning(
"Program automatically Stopped after " +
474 itos ( currentNEvt ) +
" event(s).",
"Application::loop");
491 "Application::svcRunning");
void info(std::string mymsg)
void verbose(std::string mymsg)
StatusCode create(std::string, std::string)
Application()
Standard constructor.
void setElement(Element *element)
void setNEvt(unsigned long nEvt)
StatusCode endProcessing()
Element * createElement(std::string)
StatusCode prepare(std::string procName, Element *element=0, int nEvt=1)
void setParent(Hierarchy *parent)
StatusCode start()
Start Service.
bool runNumberManagement()
const std::string & osName()
OS name.
void setName(std::string name)
std::vector< Hierarchy * > children()
StatusCode updateConfig()
Update Config Service.
unsigned long runNumber()
const std::string & osVersion()
OS version.
StatusCode run(std::string procName, Element *element=0, int nEvt=1)
std::list< Processus *> procList(Element *)
void setType(std::string type)
virtual Processus * clone()=0
virtual StatusCode execute()=0
void setNEvtMax(int nEvtMax)
std::string m_accountName
void setState(std::string state=std::string(""))
std::string storageFile()
void setNErrors(unsigned long nErrors)
unsigned long printFreq()
void network(std::string)
void setStorageFile(std::string filename=std::string(""))
StatusCode updateState()
Update State Service.
std::string storageFullPath()
StatusCode makeDir(std::string)
void setRunNumber(unsigned long runNumber)
void setStream(std::string file=std::string(""))
StatusCode startProcessing()
virtual void addChild(Hierarchy *element)
StatusCode loadHistoryFile()
void msgSvc(int level, std::string msg, std::string name)
void setCurrent(Hierarchy *current)
void setTimeMax(unsigned long timeMax)
void warning(std::string mymsg)
virtual ~Application()
Destructor.
const std::string & accountName()
User login name.
const std::string getEnv(const char *var)
get a particular environment variable
const std::string & hostName()
Host name.