当前位置: 首页>>代码示例>>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;未经允许,请勿转载。