Scopira  20080306
uptimeservice.h
1 
2 /*
3  * Copyright (c) 2007-2010 National Research Council
4  *
5  * All rights reserved.
6  *
7  * This material is confidential and proprietary information of
8  * National Research Council Canada ("Confidential Information").
9  * This Confidential Information may only be used and reproduced
10  * in accordance with the terms of the license agreement.
11  *
12  */
13 
14 #ifndef __INCLUDED_SCOPIRA_AGENT_UPTIMESERVICE_H__
15 #define __INCLUDED_SCOPIRA_AGENT_UPTIMESERVICE_H__
16 
17 #include <map>
18 
19 #include <scopira/tool/uuid.h>
20 #include <scopira/agent/context.h>
21 #include <scopira/tool/export.h>
22 
23 namespace scopira
24 {
25  namespace agent
26  {
27  class uptime_service;
28  }
29 }
30 
46 {
47  public:
49  SCOPIRA_EXPORT uptime_service(scopira::agent::task_context &ctx);
51  SCOPIRA_EXPORT ~uptime_service();
52 
60  SCOPIRA_EXPORT void update_uptime(void);
61 
63  inline int get_num_agents(void) { return static_cast<int>(dm_servers.size()); }
64 
83  SCOPIRA_EXPORT
84  const std::string & get_value(int agentnum, const std::string &key);
85 
86  private:
88 
90 
91  typedef std::map<std::string, std::string> agent_values;
92  typedef std::vector<agent_values> agent_list;
93 
94  agent_list dm_values;
95 };
96 
97 #endif
98 
uptime_service(scopira::agent::task_context &ctx)
constructor
Definition: archiveflow.h:20
Definition: context.h:186
int get_num_agents(void)
returns the number of agents being monitored
Definition: uptimeservice.h:63
size_t size(void) const
gets the size (1D)
Definition: narray.h:859
const std::string & get_value(int agentnum, const std::string &key)
Definition: uptimeservice.h:45