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)
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

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.

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.

bool Y2ComponentCreator::isClientCreator  )  const
 

Specifies, whether this creator creates Y2Clients.

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

Specifies, whether this creator creates Y2Servers.

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

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.


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:46 2006 for yast2-core by  doxygen 1.4.6