本文整理汇总了C++中CDatum::CanInvoke方法的典型用法代码示例。如果您正苦于以下问题:C++ CDatum::CanInvoke方法的具体用法?C++ CDatum::CanInvoke怎么用?C++ CDatum::CanInvoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDatum
的用法示例。
在下文中一共展示了CDatum::CanInvoke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSecondaryKeys
bool CAeonView::CreateSecondaryKeys (CHexeProcess &Process, CDatum dData, SEQUENCENUMBER RowID, TArray<CRowKey> *retKeys)
// CreateSecondaryKeys
//
// Creates a secondary key from the data and rowID. We return TRUE if all of
// the key values are non-nil. FALSE if one or more values are nil.
{
int i;
bool bAllValid = true;
// Pull the dimensions from the data
TArray<CDatum> KeyData;
for (i = 0; i < m_Keys.GetCount(); i++)
{
CDatum dValue;
CDatum dKeyDesc = m_Keys[i];
// If this is a function then we need to evaluate it.
if (dKeyDesc.CanInvoke())
{
TArray<CDatum> Args;
Args.Insert(dData);
CHexeProcess::ERunCodes iRun = Process.Run(dKeyDesc, Args, &dValue);
switch (iRun)
{
case CHexeProcess::runOK:
// dValue is a valid value for a key
break;
case CHexeProcess::runError:
dValue = CDatum(strPattern("(%s)", dValue.AsString()));
break;
default:
dValue = CDatum(STR_ERROR_KEY);
}
}
// Otherwise this specifies a field in the data to use as a key
else
dValue = dData.GetElement((const CString &)dKeyDesc);
// We don't support Nil keys, so we have to replace these with a
// a special value.
if (dValue.IsNil())
{
dValue = CDatum(STR_EMPTY_KEY);
// If we're not valid if we're excluding nil keys
if (m_bExcludeNil)
bAllValid = false;
}
// Add to list
KeyData.Insert(dValue);
}
// Generate the keys.
// If we use list keys then we need to create permuted keys
retKeys->DeleteAll();
if (m_bUsesListKeys)
CreatePermutedKeys(KeyData, 0, TArray<CDatum>(), RowID, retKeys);
// Otherwise we just create the key normally
else
{
CRowKey *pNewKey = retKeys->Insert();
CRowKey::CreateFromDatumAndRowID(m_Dims, KeyData, RowID, pNewKey);
}
// Done
return bAllValid;
}