本文整理汇总了C++中CArray::getItFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ CArray::getItFirst方法的具体用法?C++ CArray::getItFirst怎么用?C++ CArray::getItFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArray
的用法示例。
在下文中一共展示了CArray::getItFirst方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UT_ASSERT_CHECK_REMOVE
// Check the remove functionality of the CArray<Tsint>.
void UT_ASSERT_CHECK_REMOVE(CArray<Tsint>& a_rArray, Tbool a_cDirectOrder, const Tbool a_cReversed = false)
{ CALL
Tsint value = (a_cDirectOrder || a_cReversed) ? 1 : 6;
CArray<Tsint>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast());
while (it.isValid())
{
UT_ASSERT_EQUAL(*it, value);
(a_cDirectOrder || a_cReversed) ? ++value : --value;
UT_ASSERT(a_cDirectOrder ? it.removeForward() : it.removeBackward());
}
UT_ASSERT_EQUAL(value, ((a_cDirectOrder || a_cReversed) ? 7 : 0));
}
示例2: UT_ASSERT_CHECK_REMOVE
// Check the remove functionality of the CArray<Tbool>.
void UT_ASSERT_CHECK_REMOVE(CArray<Tbool>& a_rArray, Tbool a_cDirectOrder, const Tbool a_cReversed = false)
{ CALL
Tbool value = (a_cDirectOrder || a_cReversed) ? true : false;
CArray<Tbool>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast());
while (it.isValid())
{
UT_ASSERT_EQUAL(*it, value);
value = !value;
UT_ASSERT(a_cDirectOrder ? it.removeForward() : it.removeBackward());
}
UT_ASSERT((a_cDirectOrder || a_cReversed) ? (value == true) : (value == false));
}
示例3: remove
// Remove all items from the instance of the CArray<Tbool> class.
static void remove(IWriter& writer, CArray<Tbool>& a_rArray, const Tbool a_cDirectOrder)
{ CALL
writer << STR("CArray<Tbool>(") << STR("size = ") << a_rArray.getSize() << STR(")") << ln;
CArray<Tbool>::TIterator it = (a_cDirectOrder ? a_rArray.getItFirst() : a_rArray.getItLast());
writer << STR("{") << ln;
while (it.isValid())
{
writer << STR(" removed item = ") << *it << ln;
a_cDirectOrder ? it.removeForward() : it.removeBackward();
}
writer << STR("}") << ln;
}
示例4: UT_ASSERT_CHECK_SHOW_REVERSED
// Check the show reversed functionality of the CArray<Tsint>.
void UT_ASSERT_CHECK_SHOW_REVERSED(const CArray<Tsint>& a_crArray, const Tbool a_cDirectOrder)
{ CALL
Tsint value = (a_cDirectOrder ? 6 : 1);
CArray<Tsint>::TIteratorConst it = (a_cDirectOrder ? a_crArray.getItFirst() : a_crArray.getItLast());
if (it.isValid())
{
do
{
UT_ASSERT_EQUAL(*it, value);
(a_cDirectOrder) ? --value : ++value;
} while ((a_cDirectOrder ? it.stepForward() : it.stepBackward()) == 1);
}
UT_ASSERT_EQUAL(value, (a_cDirectOrder ? 0 : 7));
}
示例5: UT_ASSERT_CHECK_SHOW_REVERSED
// Check the show reversed functionality of the CArray<Tbool>.
void UT_ASSERT_CHECK_SHOW_REVERSED(const CArray<Tbool>& a_crArray, const Tbool a_cDirectOrder)
{ CALL
Tbool value = (a_cDirectOrder ? false : true);
CArray<Tbool>::TIteratorConst it = (a_cDirectOrder ? a_crArray.getItFirst() : a_crArray.getItLast());
if (it.isValid())
{
do
{
UT_ASSERT_EQUAL(*it, value);
value = !value;
} while ((a_cDirectOrder ? it.stepForward() : it.stepBackward()) == 1);
}
UT_ASSERT((a_cDirectOrder) ? !value : value);
}