Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2PluginComponent Class Reference

#include <Y2PluginComponent.h>

Inheritance diagram for Y2PluginComponent:

Y2Component List of all members.

Public Member Functions

 Y2PluginComponent (bool is_server, string filename, const char *creator_name, const char *component_name, int level)
 ~Y2PluginComponent ()
string name () const
YCPValue evaluate (const YCPValue &command)
SCRAgentgetSCRAgent ()
void result (const YCPValue &result)
void setServerOptions (int argc, char **argv)
Y2ComponentgetCallback (void) const
void setCallback (Y2Component *callback)
YCPValue doActualWork (const YCPList &arglist, Y2Component *user_interface)

Private Member Functions

bool loadPlugin ()
Y2ComponentCreatorlocateSym (int num)

Private Attributes

const bool is_server
string filename
string creator_name
string component_name
int argc
char ** argv
int level
void * handle
Y2Componentcomp
Y2Componentm_callback

Constructor & Destructor Documentation

Y2PluginComponent::Y2PluginComponent bool  is_server,
string  filename,
const char *  creator_name,
const char *  component_name,
int  level
 

Y2PluginComponent::~Y2PluginComponent  ) 
 

Frees internal data.


Member Function Documentation

YCPValue Y2PluginComponent::doActualWork const YCPList arglist,
Y2Component user_interface
[virtual]
 

Launches the plugin with the previously set parameters.

Reimplemented from Y2Component.

YCPValue Y2PluginComponent::evaluate const YCPValue command  )  [virtual]
 

Let the server evaluate a command.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.

Y2Component * Y2PluginComponent::getCallback void   )  const [virtual]
 

Functions to pass callback information The callback is a pointer to a Y2Component with a valid evaluate() function. Override the Y2Component functions here since the plugin component isn't the 'real' component but just a wrapper which contains a pointer to the real one. So any callback information must be passed by the Y2PluginComponent to the component loaded via plugin.

Reimplemented from Y2Component.

SCRAgent * Y2PluginComponent::getSCRAgent  )  [virtual]
 

Returns the SCRAgent of the Y2Component or NULL if it doesn't have one.

Reimplemented from Y2Component.

bool Y2PluginComponent::loadPlugin  )  [private]
 

Does actually load the plugin.

Y2ComponentCreator * Y2PluginComponent::locateSym int  num  )  [private]
 

Tries to locate the global componentcreator via dlsym.

string Y2PluginComponent::name  )  const [virtual]
 

Returns the name of this component.

Implements Y2Component.

void Y2PluginComponent::result const YCPValue result  )  [virtual]
 

Tells this server, that the client doesn't need it's services any longer and that the exit code of the client is result.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.

void Y2PluginComponent::setCallback Y2Component callback  )  [virtual]
 

Reimplemented from Y2Component.

void Y2PluginComponent::setServerOptions int  argc,
char **  argv
[virtual]
 

Sets the commandline options of the server.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.


Member Data Documentation

int Y2PluginComponent::argc [private]
 

Stores options for a server plugin.

char** Y2PluginComponent::argv [private]
 

Stores options for a server plugin.

Y2Component* Y2PluginComponent::comp [private]
 

The created Y2Component.

string Y2PluginComponent::component_name [private]
 

Name of the component that is implemented by the plugin.

string Y2PluginComponent::creator_name [private]
 

Name of the global component creator.

string Y2PluginComponent::filename [private]
 

The name of the plugin library.

void* Y2PluginComponent::handle [private]
 

Handle of the dynamic loaded library.

const bool Y2PluginComponent::is_server [private]
 

It this component a server or a client?

int Y2PluginComponent::level [private]
 

The component level the plugin was started in.

Y2Component* Y2PluginComponent::m_callback [private]
 

The saved callback pointer to be passed to the component after creating (plugin loaded).


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6