Scopira 20080306

loop.h

00001 
00002 /*
00003  *  Copyright (c) 2005    National Research Council
00004  *
00005  *  All rights reserved.
00006  *
00007  *  This material is confidential and proprietary information of
00008  *  National Research Council Canada ("Confidential Information").
00009  *  This Confidential Information may only be used and reproduced
00010  *  in accordance with the terms of the license agreement.
00011  *
00012  */
00013 
00014 #ifndef __INCLUDED_SCOPIRA_AGENT_LOOP_H__
00015 #define __INCLUDED_SCOPIRA_AGENT_LOOP_H__
00016 
00017 #include <scopira/tool/export.h>
00018 #include <scopira/tool/object.h>
00019 #include <scopira/agent/agent.h>
00020 
00021 namespace scopira
00022 {
00028   namespace agent
00029   {
00030     class agent_loop;
00031   }
00032 }
00033 
00045 class scopira::agent::agent_loop
00046 {
00047   public:
00053     SCOPIRA_EXPORT agent_loop(void);
00059     SCOPIRA_EXPORT agent_loop(int &argc, char **&argv);
00064     SCOPIRA_EXPORT ~agent_loop();
00065 
00071     bool failed(void) const { return dm_worker->failed(); }
00072 
00081     SCOPIRA_EXPORT void set_wait_for_quit(void);
00082 
00083   private:
00084     class clusterboot;
00086     scopira::tool::count_ptr<clusterboot> dm_clusterboot;
00088     volatile bool dm_daemon_mode;
00090     scopira::tool::count_ptr<scopira::agent::agent_i> dm_worker;
00091 };
00092 
00232 #endif
00233