yast2-core
Y2ComponentBroker.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: Y2ComponentBroker.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef Y2ComponentBroker_h
22 #define Y2ComponentBroker_h
23 
24 #include <string.h>
25 #include <map>
26 #include <vector>
27 #include <string>
28 
29 using std::vector;
30 using std::map;
31 using std::string;
32 
33 class Y2ComponentCreator;
34 class Y2Component;
35 
92 {
93 public:
98  enum order_t { BUILTIN = 0,
99  PLUGIN = 1,
100  SCRIPT = 2,
102  NETWORK = 4,
103  MAX_ORDER = 5 };
104 
105 private:
106 
107  struct ltstr
108  {
109  bool operator()(const char* s1, const char* s2) const
110  {
111  return strcmp(s1, s2) < 0;
112  }
113  };
114 
115  static map<const char *, const Y2Component *, ltstr> namespaces;
116 
120  static vector<const Y2ComponentCreator *> *creators[MAX_ORDER];
121 
127  static bool stop_register;
128 
134  static map<string, string> namespace_exceptions;
135 
136 public:
149  static void registerComponentCreator(const Y2ComponentCreator *creator, order_t order, bool force=false);
150 
151 private:
164  static Y2Component *createComponent(const char *name, bool look_for_clients);
165 
166 public:
170  static Y2Component *createClient(const char *name);
171 
175  static Y2Component *createServer(const char *name);
176 
183  static Y2Component *getNamespaceComponent(const char *name);
184 
192  static bool registerNamespaceException(const char* name_space, const char* component_name);
193 
194 private:
198  static void initializeLists();
199 };
200 
201 
202 #endif //Y2ComponentBroker_h
static Y2Component * createServer(const char *name)
Definition: Y2ComponentBroker.cc:109
static map< const char *, const Y2Component *, ltstr > namespaces
Definition: Y2ComponentBroker.h:115
Definition: Y2ComponentBroker.h:107
static void initializeLists()
Definition: Y2ComponentBroker.cc:199
static bool registerNamespaceException(const char *name_space, const char *component_name)
Definition: Y2ComponentBroker.cc:183
Definition: Y2ComponentBroker.h:102
static void registerComponentCreator(const Y2ComponentCreator *creator, order_t order, bool force=false)
Definition: Y2ComponentBroker.cc:40
order_t
Definition: Y2ComponentBroker.h:98
bool operator()(const char *s1, const char *s2) const
Definition: Y2ComponentBroker.h:109
static map< string, string > namespace_exceptions
Definition: Y2ComponentBroker.h:134
Definition: Y2ComponentBroker.h:101
static bool stop_register
Definition: Y2ComponentBroker.h:127
Definition: Y2ComponentBroker.h:99
static int force
Definition: ycpc.cc:60
Definition: Y2ComponentBroker.h:98
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
static Y2Component * createComponent(const char *name, bool look_for_clients)
Definition: Y2ComponentBroker.cc:62
static vector< const Y2ComponentCreator * > * creators[MAX_ORDER]
Definition: Y2ComponentBroker.h:120
Definition: Y2ComponentBroker.h:100
Definition: Y2ComponentBroker.h:91
Definition: Y2ComponentBroker.h:103
Can create certain YaST2 components As documented in Y2Component, there are many ways how to realize ...
Definition: Y2ComponentCreator.h:43
static Y2Component * createClient(const char *name)
Definition: Y2ComponentBroker.cc:103
static Y2Component * getNamespaceComponent(const char *name)
Definition: Y2ComponentBroker.cc:116

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