當前位置: 首頁>>代碼示例>>C++>>正文


C++ BuildList函數代碼示例

本文整理匯總了C++中BuildList函數的典型用法代碼示例。如果您正苦於以下問題:C++ BuildList函數的具體用法?C++ BuildList怎麽用?C++ BuildList使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BuildList函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: BuildList

//-----------------------------------------------------------------------------
// Fixes up all elements
//-----------------------------------------------------------------------------
void CImportSFMV6::BuildList( CDmElement *pElement, CUtlRBTree< CDmElement *, int >& list )
{
	if ( !pElement )
		return;

	if ( list.Find( pElement ) != list.InvalidIndex() )
		return;

	list.Insert( pElement );

	// Descend to bottom of tree, then do fixup coming back up the tree
	for ( CDmAttribute *pAttribute = pElement->FirstAttribute(); pAttribute; pAttribute = pAttribute->NextAttribute() )
	{
		if ( pAttribute->GetType() == AT_ELEMENT )
		{
			CDmElement *pElement = pAttribute->GetValueElement<CDmElement>( );
			BuildList( pElement, list );
			continue;
		}

		if ( pAttribute->GetType() == AT_ELEMENT_ARRAY )
		{
			CDmrElementArray<> array( pAttribute );
			int nCount = array.Count();
			for ( int i = 0; i < nCount; ++i )
			{
				CDmElement *pChild = array[ i ];
				BuildList( pChild, list );
			}
			continue;
		}
	}
}
開發者ID:Axitonium,項目名稱:SourceEngine2007,代碼行數:36,代碼來源:importsfmv6.cpp

示例2: main

int main()
{
	int m, n;
	while (scanf("%d %d", &m, &n) != EOF)
	{
		ListNode* head1 = BuildList(m);
		ListNode* head2 = BuildList(n);

		int diff = m-n;
		ListNode* pHeadLong = head1;
		ListNode* pHeadShort = head2;
		if (m < n)
		{
			diff = n-m;
			pHeadLong = head2;
			pHeadShort = head1;
		}

		// forward to the proper position
		for (int i = 0; i < diff; ++i)
			pHeadLong = pHeadLong->pNext;

		bool bFound = false;
		while (pHeadLong)
		{ // search for the first common node
			if (pHeadLong->nValue == pHeadShort->nValue)
			{
				bFound = true;
				break;
			}
			else
			{
				pHeadLong = pHeadLong->pNext;
				pHeadShort = pHeadShort->pNext;
			}
		}

		if (bFound)
			printf("%d\n", pHeadLong->nValue);
		else
			printf("My God\n");

		DestroyList(head1);
		DestroyList(head2);
	}

	return 0;
}
開發者ID:keke2014,項目名稱:JianzhiOffer,代碼行數:48,代碼來源:37題目1505:兩個鏈表的第一個公共結點.cpp

示例3: BuildList

void GUIgraph::SetDatasets(const vector<GUIgraph::Dataset>& newData,bool showDif,int button,string name)
{
	this->showDif=showDif;
	graphNames[button]=name;
	data[button].clear();
	data[button].insert(data[button].begin(), newData.begin(), newData.end());
	maximum=0;
	
	for(int a=0;a<2;++a){
		vector<GUIgraph::Dataset>::iterator i=data[a].begin();
		vector<GUIgraph::Dataset>::iterator e=data[a].end();

		for(;i!=e; i++)
		{
			vector<float>::iterator j=i->points.begin();
			vector<float>::iterator k=i->points.end();
			float last=0;
		
			for(;j!=k; j++){
				if(*j-last>maximum)
					maximum=*j-last;
				if(showDif)
					last=*j;
			}
		}
	}
	
	BuildList();
}
開發者ID:genxinzou,項目名稱:svn-spring-archive,代碼行數:29,代碼來源:GUIgraph.cpp

示例4: LeaveDirectory

static void LeaveDirectory( void ) {
    char *s;
    int i;

    s = strrchr( m_demos.browse, '/' );
    if( !s ) {
        return;
    }
    *s = 0;

    // rebuild list
    FreeList();
    BuildList();
    MenuList_Init( &m_demos.list );

    // move cursor to the previous directory
    for( i = 0; i < m_demos.numDirs; i++ ) {
        demoEntry_t *e = m_demos.list.items[i];
        if( !strcmp( e->name, s + 1 ) ) {
            MenuList_SetValue( &m_demos.list, i );
            break;
        }
    }

    if( s == m_demos.browse ) {
        m_demos.browse[0] = '/';
        m_demos.browse[1] = 0;
    }
}
開發者ID:Bad-ptr,項目名稱:q2pro,代碼行數:29,代碼來源:ui_demos.c

示例5: Activate

static menuSound_t Activate( menuCommon_t *self ) {
    size_t len, baselen;
    demoEntry_t *e = m_demos.list.items[m_demos.list.curvalue];

    switch( e->type ) {
    case ENTRY_UP:
        LeaveDirectory();
        return QMS_OUT;

    case ENTRY_DN:
        baselen = strlen( m_demos.browse );
        len = strlen( e->name );
        if( baselen + 1 + len >= sizeof( m_demos.browse ) ) {
            return QMS_BEEP;
        }
        if( !baselen || m_demos.browse[ baselen - 1 ] != '/' ) {
            m_demos.browse[ baselen++ ] = '/';
        }
        memcpy( m_demos.browse + baselen, e->name, len + 1 );
        
        // rebuild list
        FreeList();
        BuildList();
        MenuList_Init( &m_demos.list );
        return QMS_IN;

    case ENTRY_DEMO:
        Cbuf_AddText( &cmd_buffer, va( "demo \"%s/%s\"\n", m_demos.browse[1] ?
            m_demos.browse : "", e->name ) );
        return QMS_SILENT;
    }

    return QMS_NOTHANDLED;
}
開發者ID:Bad-ptr,項目名稱:q2pro,代碼行數:34,代碼來源:ui_demos.c

示例6: Test1

void Test1()
{
    ListNode* pHead = BuildList();
    ListNode* pReversedHead = Test("Test1", pHead, 1);

    DestroyList(pReversedHead);
}
開發者ID:brian-smith723,項目名稱:DesignPatterns,代碼行數:7,代碼來源:049_ReverseListInGroups.cpp

示例7: LeaveDirectory

static menuSound_t LeaveDirectory(void)
{
    char    *s;
    int     i;

    s = strrchr(m_demos.browse, '/');
    if (!s) {
        return QMS_BEEP;
    }

    if (s == m_demos.browse) {
        strcpy(m_demos.browse, "/");
    } else {
        *s = 0;
    }

    // rebuild list
    FreeList();
    BuildList();
    MenuList_Init(&m_demos.list);

    // move cursor to the previous directory
    for (i = 0; i < m_demos.numDirs; i++) {
        demoEntry_t *e = m_demos.list.items[i];
        if (!strcmp(e->name, s + 1)) {
            MenuList_SetValue(&m_demos.list, i);
            break;
        }
    }

    return QMS_OUT;
}
開發者ID:AndreyNazarov,項目名稱:q2pro,代碼行數:32,代碼來源:demos.c

示例8: WidgetLBGetCurSel

void ProjectPrefsGUI::DoRemove(void)
{

ActiveItem = WidgetLBGetCurSel(IDC_PARLIST);
HostProj->DL = HostProj->DirList_Remove(HostProj->DL, (short)ActiveItem);
BuildList(ActiveItem);

} // ProjectPrefsGUI::DoRemove()
開發者ID:AlphaPixel,項目名稱:3DNature,代碼行數:8,代碼來源:ProjectPrefsGUI.cpp

示例9: BuildList

eOSState cMenuSearchResults::OnYellow()
{
   eOSState state = osUnknown;
   if(!HasSubMenu())
   {
      modeYellow = (modeYellow==showTitleEpisode?showEpisode:showTitleEpisode);
      BuildList();
      state = osContinue;
   }
   return state;
}
開發者ID:jowi24,項目名稱:vdr-epgsearch,代碼行數:11,代碼來源:menu_searchresults.c

示例10: BuildList

void GUIbutton::SetCaption(const string& capt)
{
	caption=capt;
	
	if(autosizing)
	{
		w=(int)(guifont->GetWidth(caption.c_str()))+14;
	}
	
	BuildList();
}
開發者ID:genxinzou,項目名稱:svn-spring-archive,代碼行數:11,代碼來源:GUIbutton.cpp

示例11: GetSystemMetrics

BOOL CDialogClasses::OnInitDialog( )
{
	m_ImageList.Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32, 1, 1);
	m_ImageList.SetBkColor(RGB(255, 255, 255));
	m_hClassIcon = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_CLASS));
	m_ImageList.Add(m_hClassIcon);
	
	BuildList();

	return TRUE;
}
開發者ID:JackD111,項目名稱:Reclass-2015,代碼行數:11,代碼來源:DialogClasses.cpp

示例12: BuildList

void ProjectPrefsGUI::DoAdd(void)
{
struct DirList *DLNew;

if (DLNew = HostProj->DirList_Add(HostProj->DL, NULL, 0))
	{
	if (! HostProj->DL)
		HostProj->DL = DLNew;
	BuildList(HostProj->DirList_ItemExists(HostProj->DL, DLNew->Name));
	} // if

} // ProjectPrefsGUI::DoAdd()
開發者ID:AlphaPixel,項目名稱:3DNature,代碼行數:12,代碼來源:ProjectPrefsGUI.cpp

示例13: Expose

static void Expose( menuFrameWork_t *self ) {
    time_t now = time( NULL );
    struct tm *tm = localtime( &now );

    if( tm ) {
        m_demos.year = tm->tm_year;
    }

    BuildList();
    // move cursor to previous position
    MenuList_SetValue( &m_demos.list, m_demos.selection );
}
開發者ID:Bad-ptr,項目名稱:q2pro,代碼行數:12,代碼來源:ui_demos.c

示例14: tr

// --- cMenuSearchResultsForBlacklist -------------------------------------------------------
cMenuSearchResultsForBlacklist::cMenuSearchResultsForBlacklist(cBlacklist* Blacklist)
   :cMenuSearchResults(cTemplFile::GetTemplateByName("MenuSearchResults"))
{
   ButtonBlue[0] = tr("Button$all channels");
   ButtonBlue[1] = tr("Button$only FTA");
   ButtonBlue[2] = tr("Button$Timer preview");

   blacklist = Blacklist;
   m_bSort = true;
   modeBlue = blacklist->useChannel==3?showNoPayTV:(EPGSearchConfig.ignorePayTV?showNoPayTV:showAll);

   BuildList();
}
開發者ID:jowi24,項目名稱:vdr-epgsearch,代碼行數:14,代碼來源:menu_searchresults.c

示例15: BuildList

BOOL CEnvelopeTypeDialog::OnInitDialog()
{
	CPmwDialogColor::OnInitDialog();

	m_List.ReadList("ENVELOPE.DAT");

	BuildList();

   CreateWizzardButtons ();
   EnableWizardButtons (m_WizFlags);

	return TRUE;  // return TRUE  unless you set the focus to a control
}
開發者ID:jimmccurdy,項目名稱:ArchiveGit,代碼行數:13,代碼來源:ENVTYPE.CPP


注:本文中的BuildList函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。