Scopira 20080306

uptimeservice.h

00001 
00002 /*
00003  *  Copyright (c) 2007-2010    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_UPTIMESERVICE_H__
00015 #define __INCLUDED_SCOPIRA_AGENT_UPTIMESERVICE_H__
00016 
00017 #include <map>
00018 
00019 #include <scopira/tool/uuid.h>
00020 #include <scopira/agent/context.h>
00021 #include <scopira/tool/export.h>
00022 
00023 namespace scopira
00024 {
00025   namespace agent
00026   {
00027     class uptime_service;
00028   }
00029 }
00030 
00045 class scopira::agent::uptime_service
00046 {
00047   public:
00049     SCOPIRA_EXPORT uptime_service(scopira::agent::task_context &ctx);
00051     SCOPIRA_EXPORT ~uptime_service();
00052 
00060     SCOPIRA_EXPORT void update_uptime(void);
00061 
00063     inline int get_num_agents(void) { return static_cast<int>(dm_servers.size()); }
00064 
00083     SCOPIRA_EXPORT 
00084       const std::string & get_value(int agentnum, const std::string &key);
00085 
00086   private:
00087     scopira::agent::task_context &dm_ctx;
00088 
00089     scopira::basekit::narray<scopira::tool::uuid> dm_servers;
00090 
00091     typedef std::map<std::string, std::string> agent_values;
00092     typedef std::vector<agent_values> agent_list;
00093 
00094     agent_list dm_values;
00095 };
00096 
00097 #endif
00098