本文整理汇总了C++中CFunction::compile方法的典型用法代码示例。如果您正苦于以下问题:C++ CFunction::compile方法的具体用法?C++ CFunction::compile怎么用?C++ CFunction::compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunction
的用法示例。
在下文中一共展示了CFunction::compile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
C_INT32 CFunctionDB::load(CReadConfig &configbuffer)
{
CFunction Function;
CFunction * pFunction = NULL;
C_INT32 Size = 0;
C_INT32 Fail = 0;
configbuffer.getVariable("TotalUDKinetics", "C_INT32", &Size,
CReadConfig::LOOP);
for (C_INT32 i = 0; i < Size; i++)
{
Function.load(configbuffer);
switch (Function.getType())
{
case CEvaluationTree::Function:
pFunction = new CFunction(Function);
break;
case CEvaluationTree::MassAction:
pFunction = new CMassAction(Function);
break;
case CEvaluationTree::PreDefined:
case CEvaluationTree::UserDefined:
pFunction = new CKinFunction(Function,
&configbuffer);
break;
default:
fatalError();
break;
}
pFunction->compile();
if (!mLoadedFunctions.add(pFunction, true))
{
pdelete(pFunction);
// We ignore:
// CCopasiVector (2): Object '%s' allready exists.
if ((MCCopasiVector + 2) != CCopasiMessage::peekLastMessage().getNumber())
return Fail = 1;
// Remove the ignored meesage.
CCopasiMessage::getLastMessage();
}
}
return Fail;
}
示例2: if
bool FunctionWidget1::saveToFunction()
{
CFunction* func = dynamic_cast<CFunction*>(CCopasiRootContainer::getKeyFactory()->get(mKey));
if (!func) return false;
//radio buttons
TriLogic tmpl;
if (RadioButton1->isChecked() == true)
{
tmpl = TriTrue;
}
else if (RadioButton2->isChecked() == true)
{
tmpl = TriFalse;
}
else
{
tmpl = TriUnspecified;
}
if (tmpl != func->isReversible())
{
func->setReversible(tmpl);
flagChanged = true;
}
if (flagChanged)
{
copyFunctionContentsToFunction(mpFunction, func);
protectedNotify(ListViews::FUNCTION, ListViews::CHANGE, mKey);
if (mpDataModel != NULL)
{
mpDataModel->changed();
}
flagChanged = false;
}
func->compile();
return true;
}