#include <Y2Function.h>
Inheritance diagram for Y2Function:

Public Member Functions | |
| virtual | ~Y2Function () |
| virtual bool | attachParameter (const YCPValue &arg, const int position)=0 |
| virtual constTypePtr | wantedParameterType () const =0 |
| virtual bool | appendParameter (const YCPValue &arg)=0 |
| virtual bool | finishParameters ()=0 |
| virtual YCPValue | evaluateCall ()=0 |
| virtual bool | reset ()=0 |
| virtual string | name () const =0 |
an example to call Popup::Message()
first, find out the component for the namespace
Y2Component* impl = Y2ComponentBroker::provideNamespace ("Popup");
if (impl != 0)
{
let the component import the namespace
Y2Namespace* ns = impl->import ("Popup");
if (ns != 0)
{
create a function call object for the function
Y2Function* fnc = ns->createFunctionCall ("Message"
, Type::fromSignature ("void (string)"));
if (fnc != 0)
{
pass the parameter for the function
fnc->appendParameter (YCPString ("This is my test"));
fnc->finishParameters ();
evaluate the call fnc->evaluateCall ();
function is not longer needed, free it
delete fnc;
}
}
}
|
|
Whithout this, can't delete YEFunction which is derived from YCode, Y2Function |
|
|
Appends a parameter to the call.
Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
||||||||||||
|
Attaches a parameter to a given position to the call.
Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
|
Executes the call Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
|
Signal that we're done adding parameters.
Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
|
Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
|
Reset the currecn parameters, so the instance can be reused for the next call (appendParameter etc) Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
|
|
What type is expected for the next appendParameter (val) ? (Used when calling from Perl, to be able to convert from the simple type system of Perl to the elaborate type system of YCP)
Implemented in Y2YCPFunction, Y2StdioFunction, and Y2SystemFunction. |
1.4.4