yast2-core
Y2CCAgentComponent.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  * Author: Arvin Schnell <arvin@suse.de>
5  */
6 
7 
8 #ifndef Y2CCAgentComponent_h
9 #define Y2CCAgentComponent_h
10 
11 
12 #include <y2/Y2ComponentCreator.h>
13 
14 
18 template <class AgentComp> class Y2CCAgentComp : public Y2ComponentCreator
19 {
20 
21 public:
22 
26  Y2CCAgentComp (const char*);
27 
31  bool isServerCreator () const { return true; }
32 
37  Y2Component* create (const char*) const;
38 
42  Y2Component* provideNamespace (const char*) { return NULL; }
43 
44 private:
45 
49  const char* my_name;
50 
51 };
52 
53 
54 template <class AgentComp>
57  my_name (my_name)
58 {
59 }
60 
61 
62 template <class AgentComp> Y2Component*
63 Y2CCAgentComp<AgentComp>::create (const char* name) const
64 {
65  if (strcmp (name, my_name) == 0)
66  return new AgentComp (my_name);
67 
68  return 0;
69 }
70 
71 
72 #endif // Y2CCAgentComponent_h

Generated on a sunny day for yast2-core by doxygen 1.8.2