本文整理汇总了C++中CList::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ CList::Append方法的具体用法?C++ CList::Append怎么用?C++ CList::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CList
的用法示例。
在下文中一共展示了CList::Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CListTest::EresUnittest_Cursor
//
// @doc:
// Various cursor-based inserts
//
//---------------------------------------------------------------------------
GPOS_RESULT
CListTest::EresUnittest_Cursor()
{
// create memory pool
CAutoMemoryPool amp;
IMemoryPool *pmp = amp.Pmp();
CList<SElem> list;
list.Init(GPOS_OFFSET(SElem, m_linkFwd));
ULONG cSize = 5;
SElem *rgelem = GPOS_NEW_ARRAY(pmp, SElem, cSize);
list.Append(&rgelem[0]);
list.Prepend(&rgelem[1], list.PtFirst());
list.Append(&rgelem[2], list.PtLast());
GPOS_ASSERT(&rgelem[1] == list.PtFirst());
GPOS_ASSERT(&rgelem[2] == list.PtLast());
list.Prepend(&rgelem[3], list.PtLast());
list.Append(&rgelem[4], list.PtFirst());
GPOS_ASSERT(&rgelem[1] == list.PtFirst());
GPOS_ASSERT(&rgelem[2] == list.PtLast());
GPOS_DELETE_ARRAY(rgelem);
return GPOS_OK;
}
示例2: Load
bool COrgOp::Load( CStr &roSrc, unsigned int uiIDOffset )
{
CStr oStrLine;
CStr oStrToken;
CList<COp *> oLstPatch;
unsigned int uiIDIn = 0;
unsigned int uiIdxIn = 0;
unsigned int uiCountIn = 0;
unsigned int uiPortIn = 0;
unsigned int uiIndexIn = 0;
unsigned int uiCountOut = 0;
unsigned int uiPortOut = 0;
unsigned int uiInteralInt = 0;
unsigned int uiInteralUInt = 0;
unsigned int uiInteralFlt = 0;
unsigned int i = 0;
unsigned int uiMaxIPortIn = 0;
unsigned int uiMaxIPortOut = 0;
unsigned int uiMaxIInternalInt = 0;
unsigned int uiMaxIInternalUInt = 0;
unsigned int uiMaxIInternalFlt = 0;
COp *poOp = 0;
// <mod date="2010-12-07">
CList<CArray<unsigned int> *> oLstArrID;
CArray<unsigned int> * poArrID = 0;
// </mod>
// Alle Operatoren einlesen, erstellen und pseudo-patchen.
while( 1 )
{
if( !Decode_GetNextLine( oStrLine, roSrc ) )
break;
i = 0;
while( 1 )
{
if( !Decode_GetNextToken( oStrToken, oStrLine ) )
break;
if( !oStrToken.GetSize() )
{
if( i > 1 ) // Komprimierung :: -> :0:
oStrToken = '0';
else if( i == 0 )
ORG_OP_LOG( "Fehler: Klassen-Name nicht vorhanden." );
}
// class
if( i == 0 )
{
poOp = Create( oStrToken );
if( poOp == 0 )
{
ORG_OP_LOG( "Fehler: Unbekannte Klasse: %s\n", oStrToken.GetData() );
return false;
}
oLstPatch.Append( poOp );
}
// instance
else if( i == 1 )
{
#ifdef OP_USE_RUNTIME_INFO
poOp->SetNameInstance( oStrToken );
#endif // OP_USE_RUNTIME_INFO
}
// id
else if( i == 2 )
{
unsigned int uiID;
ORG_OP_SSCANF( oStrToken, "%x", &uiID );
poOp->SetID( uiID + uiIDOffset ); // Um keinen Konflikt zu erzeugen.
}
// flags
else if( i == 3 )
{
unsigned int uiFlags;
ORG_OP_SSCANF( oStrToken, "%x", &uiFlags );
poOp->SetFlags( uiFlags );
}
// count_input
else if ( i == 4 )
{
ORG_OP_SSCANF( oStrToken, "%x", &uiCountIn );
if( poOp->GetFlags() & OP_FLAG_DYNAMIC_INPUTS )
{
poOp->SetCountIn( uiCountIn );
}
else if( poOp->GetCountIn() != uiCountIn )
{
#ifdef OP_USE_RUNTIME_INFO
ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d Inputs unterstuetzt! "
"Keine dynamischen Inputs!\n", poOp->GetNameClass(), uiCountIn );
#endif // OP_USE_RUNTIME_INFO
return false;
}
uiPortIn = 0;
uiIndexIn = 0;
uiMaxIPortIn = 3 * uiCountIn + 4 + 1;
// <mod date="2010-12-07">
//.........这里部分代码省略.........