Y2ComponentCreator Class Reference

Can create certain YaST2 components As documented in Y2Component, there are many ways how to realize a component. A Y2ComponentCreator is and object, that creates a component or at least creates a communication handle to an existing component. The Y2ComponentBroker keeps a list of all known Y2ComponentCreators. If it is asked to create or find a certain component, it scans this list and looks for a matching creator. More...

#include <Y2ComponentCreator.h>

Inheritance diagram for Y2ComponentCreator:

TestY2CC TestY2CC TestY2CC Y2CCAgentComp< AgentComp > Y2CCPlugin Y2CCProgram Y2CCSerial Y2CCStdio Y2CCWFM

List of all members.

Public Member Functions

 Y2ComponentCreator (Y2ComponentBroker::order_t order)
 Y2ComponentCreator (Y2ComponentBroker::order_t order, bool force_register)
virtual ~Y2ComponentCreator ()
virtual Y2Componentcreate (const char *name) const
virtual Y2ComponentcreateInLevel (const char *name, int level, int current_level) const
virtual Y2ComponentprovideNamespace (const char *name)
virtual bool isServerCreator () const =0
bool isClientCreator () const


Detailed Description

Can create certain YaST2 components As documented in Y2Component, there are many ways how to realize a component. A Y2ComponentCreator is and object, that creates a component or at least creates a communication handle to an existing component. The Y2ComponentBroker keeps a list of all known Y2ComponentCreators. If it is asked to create or find a certain component, it scans this list and looks for a matching creator.

If you want to implement a component creator, subclass Y2ComponentCreator, override the create method such that it returns a newly created component of your type and create a global variable of type of your component creator. Its constructor will be called before the execution goes into the main() function and it will be added to the Y2ComponentBrokers list of creators.


Constructor & Destructor Documentation

Y2ComponentCreator::Y2ComponentCreator ( Y2ComponentBroker::order_t  order  ) 

Enters this component creator into the global list of component creators.

Parameters:
order the order in which the creators are scanned. See Y2ComponentBroker::order_t
force_register force registration of this creator even if the component broker's 'stop_register' flag is already set.

References Y2ComponentBroker::registerComponentCreator().

Y2ComponentCreator::Y2ComponentCreator ( Y2ComponentBroker::order_t  order,
bool  force_register 
)

Y2ComponentCreator::~Y2ComponentCreator (  )  [virtual]

Base class must have virtual destructor


Member Function Documentation

Y2Component * Y2ComponentCreator::create ( const char *  name  )  const [virtual]

Override this method to implement the actual creating of the component. You must use the symbol and the signature of the term to decide, which component is to be created. If you are not able to create a matching component, return 0.

Reimplemented in Y2CCAgentComp< AgentComp >, Y2CCSerial, Y2CCStdio, and Y2CCWFM.

References y2warning.

Referenced by createInLevel(), and Y2PluginComponent::loadPlugin().

Y2Component * Y2ComponentCreator::createInLevel ( const char *  name,
int  level,
int  current_level 
) const [virtual]

Override this method to implement component creation for non-builtin components such as share library plugins, scripts and external programs that must be searched for in different directories. The default implementation is to call create in case level == current_level.

Reimplemented in Y2CCPlugin, Y2CCProgram, and Y2CCWFM.

References create().

Referenced by Y2ComponentBroker::createComponent().

bool Y2ComponentCreator::isClientCreator (  )  const

Specifies, whether this creator creates Y2Clients.

References isServerCreator().

Referenced by Y2ComponentBroker::createComponent().

virtual bool Y2ComponentCreator::isServerCreator (  )  const [pure virtual]

Y2Component * Y2ComponentCreator::provideNamespace ( const char *  name  )  [virtual]

Override this method to implement providing a component for a given namespace. If you are not able to create a matching component, return 0.

Reimplemented in Y2CCAgentComp< AgentComp >, Y2CCPlugin, Y2CCProgram, Y2CCSerial, Y2CCStdio, TestY2CC, TestY2CC, Y2CCWFM, and TestY2CC.

References y2warning.

Referenced by Y2ComponentBroker::getNamespaceComponent(), and Y2PluginComponent::loadPlugin().


The documentation for this class was generated from the following files:

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