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

PkgModuleFunctions::CallbackHandler Class Reference

Handler for Callbacks received or triggered. Needs access to WFM. More...

#include <PkgModuleCallbacks.h>

List of all members.

Public Member Functions

 CallbackHandler ()
 ~CallbackHandler ()

Public Attributes

YCPCallbacks_ycpCallbacks
Y2PMReceive_y2pmReceive

Private Member Functions

CallbackHandleroperator= (const CallbackHandler &)
 CallbackHandler (const CallbackHandler &)


Detailed Description

Handler for Callbacks received or triggered. Needs access to WFM.

NOTE: Public references to YCPCallbacks and Y2PMReceive are intentionally not usable outside PkgModuleCallbacks.cc, because both class definitions reside within the implementation file. They are public because callback realated PkgModuleFunctions methods are defined in the same file and use them to set the YCP callbacks. Appart from this, there's no need to propagate the interface.

How to introduce new YCP callbacks

  1. In class YCPCallbacks introduce a new value in enum CBid. This enum value is used to set and access the YCP callbacks data.
  2. In class PkgModuleFunctions declare a method CallbackWhateverName, and implement it in PkgModuleCallbacks.cc to set the calback data.
  3. Finaly adjust PkgModule::evaluate to make the method available to the YCP code.
How to introduce new recipient which triggers the YCP callbacks

  1. Consult PkgModuleCallbacks.cc
  2. Within namespace Y2PMRecipients define the new recipient class, which is usg. derived from Recipient and some calback interface class provided by Y2PM or some of it's components.
  3. In class Y2PMReceive create an instance of your recipient, and adjust constructor and destructor to setup and clear the redirection of the Report (also provided by Y2PM or some of it's components) you want to receive.
Sounds more complicated than it actually is. Take an existing recipient as example. Consider class RecipientCtl, which is inherited by Y2PMReceive and shared among the recipient classes, if you need to exchage data or coordinate different recipients.

See also class Report (in liby2util).


Constructor & Destructor Documentation

PkgModuleFunctions::CallbackHandler::CallbackHandler const CallbackHandler  )  [private]
 

PkgModuleFunctions::CallbackHandler::CallbackHandler  ) 
 

Constructor. Setup handler and redirect Y2PMCallbacks to the Y2PMReceiver.

PkgModuleFunctions::CallbackHandler::~CallbackHandler  ) 
 

Destructor. Reset Y2PMCallbacks to it's defaults.


Member Function Documentation

CallbackHandler& PkgModuleFunctions::CallbackHandler::operator= const CallbackHandler  )  [private]
 


Member Data Documentation

Y2PMReceive& PkgModuleFunctions::CallbackHandler::_y2pmReceive
 

YCPCallbacks& PkgModuleFunctions::CallbackHandler::_ycpCallbacks
 


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