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

PkgModuleFunctions::CallbackHandler::YCPCallbacks Class Reference

Stores YCPCallback related data and communicates with Y2ComponentBroker. More...

#include <PkgModuleCallbacks.YCP.h>

List of all members.

Public Types

enum  CBid {
  CB_StartRebuildDb, CB_ProgressRebuildDb, CB_NotifyRebuildDb, CB_StopRebuildDb,
  CB_StartConvertDb, CB_ProgressConvertDb, CB_NotifyConvertDb, CB_StopConvertDb,
  CB_StartProvide, CB_ProgressProvide, CB_DoneProvide, CB_StartPackage,
  CB_ProgressPackage, CB_DonePackage, CB_StartDownload, CB_ProgressDownload,
  CB_DoneDownload, CB_MediaChange, CB_SourceChange, CB_YouProgress,
  CB_YouPatchProgress, CB_YouError, CB_YouMessage, CB_YouLog,
  CB_YouExecuteYcpScript, CB_YouScriptProgress
}

Public Member Functions

 YCPCallbacks ()
void popCallback (CBid id_r)
void setCallback (CBid id_r, const string &name_r)
bool setCallback (CBid id_r, const YCPString &args)
YCPValue setYCPCallback (CBid id_r, const YCPString &args_r)
bool isSet (CBid id_r) const
Y2FunctioncreateCallback (CBid id_r) const

Static Public Member Functions

string cbName (CBid id_r)

Private Types

typedef map< CBid, stack<
CBdata > > 
_cbdata_t

Private Attributes

_cbdata_t _cbdata


Detailed Description

Stores YCPCallback related data and communicates with Y2ComponentBroker.

For each YCPCallback it's data, identified by a CBid, are stored in maps.

To invoke a YCPCallback:

YCPTerm callback = createCallback( CB_PatchProgress ); // create callback Term callback->add( YCPInteger ( percent ) ); // add arguments callback->add( YCPString ( pkg ) ); bool result = evaluateBool( callback ); // evaluate


Member Typedef Documentation

typedef map<CBid, stack <CBdata> > PkgModuleFunctions::CallbackHandler::YCPCallbacks::_cbdata_t [private]
 


Member Enumeration Documentation

enum PkgModuleFunctions::CallbackHandler::YCPCallbacks::CBid
 

Unique id for each YCPCallback we may have to trigger. On changes here, adapt cbName.

Enumeration values:
CB_StartRebuildDb 
CB_ProgressRebuildDb 
CB_NotifyRebuildDb 
CB_StopRebuildDb 
CB_StartConvertDb 
CB_ProgressConvertDb 
CB_NotifyConvertDb 
CB_StopConvertDb 
CB_StartProvide 
CB_ProgressProvide 
CB_DoneProvide 
CB_StartPackage 
CB_ProgressPackage 
CB_DonePackage 
CB_StartDownload 
CB_ProgressDownload 
CB_DoneDownload 
CB_MediaChange 
CB_SourceChange 
CB_YouProgress 
CB_YouPatchProgress 
CB_YouError 
CB_YouMessage 
CB_YouLog 
CB_YouExecuteYcpScript 
CB_YouScriptProgress 


Constructor & Destructor Documentation

PkgModuleFunctions::CallbackHandler::YCPCallbacks::YCPCallbacks  )  [inline]
 

Constructor.


Member Function Documentation

string PkgModuleFunctions::CallbackHandler::YCPCallbacks::cbName CBid  id_r  )  [inline, static]
 

Returns the enum name without the leading "CB_" (e.g. "StartProvide" for CB_StartProvide). Should be in sync with CBid.

Y2Function* PkgModuleFunctions::CallbackHandler::YCPCallbacks::createCallback CBid  id_r  )  const [inline]
 

Returns:
The YCPCallback term, ready to append any arguments.

bool PkgModuleFunctions::CallbackHandler::YCPCallbacks::isSet CBid  id_r  )  const [inline]
 

Returns:
Whether the YCPCallback is set. If not, there's no need to create and evaluate it.

void PkgModuleFunctions::CallbackHandler::YCPCallbacks::popCallback CBid  id_r  )  [inline]
 

bool PkgModuleFunctions::CallbackHandler::YCPCallbacks::setCallback CBid  id_r,
const YCPString args
[inline]
 

Set a YCPCallbacks data according to args_r.

void PkgModuleFunctions::CallbackHandler::YCPCallbacks::setCallback CBid  id_r,
const string &  name_r
[inline]
 

Set a YCPCallbacks data from string "module::symbol"

YCPValue PkgModuleFunctions::CallbackHandler::YCPCallbacks::setYCPCallback CBid  id_r,
const YCPString args_r
[inline]
 

Set the YCPCallback according to args_r.

Returns:
YCPVoid on success, otherwise YCPError.


Member Data Documentation

_cbdata_t PkgModuleFunctions::CallbackHandler::YCPCallbacks::_cbdata [private]
 


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