#include <Y2ComponentBroker.h>
Public Types | |
enum | order_t { BUILTIN = 0, PLUGIN = 1, SCRIPT = 2, EXTERNAL_PROGRAM = 3, NETWORK = 4, MAX_ORDER = 5 } |
Static Public Member Functions | |
void | registerComponentCreator (const Y2ComponentCreator *creator, order_t order) |
Y2Component * | createClient (const char *name) |
Y2Component * | createServer (const char *name) |
Y2Component * | getNamespaceComponent (const char *name) |
bool | registerNamespaceException (const char *name_space, const char *component_name) |
Static Private Member Functions | |
Y2Component * | createComponent (const char *name, bool look_for_clients) |
void | initializeLists () |
Static Private Attributes | |
map< const char *, const Y2Component *, ltstr > | namespaces |
vector< const Y2ComponentCreator * > * | creators [MAX_ORDER] = { 0, 0, 0, 0, 0 } |
bool | stop_register = false |
map< string, string > | namespace_exceptions |
a) Only one component broker is needed
b) The data must be accessable before the first global constructor is called
The component broker is the one, that you can ask for if you need a certain component. Components are specified by names. A component name is an arbitrary string. The component broker does not statically know what kinds components exist. During global constructor call time (before main), the constructors of the ComponentCreator classes register themselves to the component broker.
|
Constants for the different types of component creators. |
|
Is a wrapper for createComponent, but only looks for clients. |
|
Tries to create or find a YaST2 component.
|
|
Is a wrapper for createComponent, but only looks for servers. |
|
Provide a component, which implements the given namespace.
|
|
Initializes creators. |
|
Enters a component creator into the list of component creators. Is called by Y2ComponentCreator::Y2ComponentCreator.
|
|
Register a new namespace exception to be used by getNamespaceComponent.
|
|
Storage for the component creators. |
|
A map containing a namespace exceptions. This will be honoured in getNamespaceComponent to give an explicit preference for a namespace to be created by a preffered component. |
|
|
|
This flag stops the registry of components at the broker. It must be set to true before any plugin (dynamic loadable library) is loaded! |