Scopira  20080306
agent/register.h
1 
2 /*
3  * Copyright (c) 2007-2008 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_REGISTER_H__
15 #define __INCLUDED_SCOPIRA_AGENT_REGISTER_H__
16 
17 #include <map>
18 #include <vector>
19 
20 #include <scopira/tool/object.h>
21 #include <scopira/tool/uuid.h>
22 
23 namespace scopira
24 {
25  namespace agent
26  {
27  class register_service;
28  class service_registrar;
29  }
30 }
31 
39 {
40  public:
42  register_service(const std::string &taskclassname, scopira::tool::uuid serviceid);
43 };
44 
49 {
50  private:
51  // maps class names to servicesd they provide
52  typedef std::multimap<std::string, scopira::tool::uuid> service_map;
53 
54  service_map dm_services;
55 
56  public:
58  service_registrar(void);
60  virtual ~service_registrar();
61 
68  static service_registrar * instance(void);
69 
70  void add_service(const std::string &taskclassname, scopira::tool::uuid serviceid);
71 
72  void get_service(const std::string &taskclassname, std::vector<scopira::tool::uuid> &out);
73 
74  private:
75  static service_registrar *dm_instance;
76 };
77 
78 #endif
79 
Definition: agent/register.h:48
Definition: archiveflow.h:20
register_service(const std::string &taskclassname, scopira::tool::uuid serviceid)
the ctor
Definition: object.h:71
Definition: uuid.h:183
Definition: agent/register.h:38