本文整理汇总了C++中TreeKeyIdx::getUserData方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeKeyIdx::getUserData方法的具体用法?C++ TreeKeyIdx::getUserData怎么用?C++ TreeKeyIdx::getUserData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeKeyIdx
的用法示例。
在下文中一共展示了TreeKeyIdx::getUserData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: linkEntry
void RawGenBook::linkEntry(SWKey const & inkey) {
TreeKeyIdx * key_ = ((TreeKeyIdx *)&(getTreeKey()));
// see if we have a VerseKey * or decendant
/// \bug Remove const_cast:
TreeKeyIdx * srckey =
const_cast<TreeKeyIdx *>(dynamic_cast<TreeKeyIdx const *>(&inkey));
// if we don't have a VerseKey * decendant, create our own
if (!srckey) {
srckey = static_cast<TreeKeyIdx *>(createKey().release());
srckey->positionFrom(inkey);
}
key_->setUserData(srckey->getUserData(), 8);
key_->save();
if (&inkey != srckey) // free our key if we created a VerseKey
delete srckey;
}
示例2: linkEntry
void RawGenBook::linkEntry(const SWKey *inkey) {
TreeKeyIdx *srckey = 0;
TreeKeyIdx *key = ((TreeKeyIdx *)&(getTreeKey()));
// see if we have a VerseKey * or decendant
SWTRY {
srckey = SWDYNAMIC_CAST(TreeKeyIdx, inkey);
}
SWCATCH ( ... ) {}
// if we don't have a VerseKey * decendant, create our own
if (!srckey) {
srckey = (TreeKeyIdx *)createKey();
(*srckey) = *inkey;
}
key->setUserData(srckey->getUserData(), 8);
key->save();
if (inkey != srckey) // free our key if we created a VerseKey
delete srckey;
}