当前位置: 首页>>代码示例>>C++>>正文


C++ SerializableList::GetFirst方法代码示例

本文整理汇总了C++中SerializableList::GetFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializableList::GetFirst方法的具体用法?C++ SerializableList::GetFirst怎么用?C++ SerializableList::GetFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializableList的用法示例。


在下文中一共展示了SerializableList::GetFirst方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetAssignedConnections

void wxSFDiagramManager::GetAssignedConnections(wxSFShapeBase* parent, wxClassInfo* shapeInfo, wxSFShapeBase::CONNECTMODE mode, ShapeList& lines)
{
	wxSFLineShape* pLine;
	
	if( parent->GetId() == -1 ) return;

	SerializableList lstLines;
	// lines are children of root item only so we have not to search recursively...
	GetRootItem()->GetChildren( shapeInfo, lstLines );
	
	if( !lstLines.IsEmpty() )
    {
        SerializableList::compatibility_iterator node = lstLines.GetFirst();
        while(node)
        {
            pLine = (wxSFLineShape*)node->GetData();
            switch(mode)
            {
                case wxSFShapeBase::lineSTARTING:
                    if( pLine->GetSrcShapeId() == parent->GetId() ) lines.Append(pLine);
                    break;

                case wxSFShapeBase::lineENDING:
                    if( pLine->GetTrgShapeId() == parent->GetId() ) lines.Append(pLine);
                    break;

                case wxSFShapeBase::lineBOTH:
                    if( ( pLine->GetSrcShapeId() == parent->GetId() ) ||
					    ( pLine->GetTrgShapeId() == parent->GetId() ) ) lines.Append(pLine);
                    break;
            }
            node = node->GetNext();
        }
    }
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:35,代码来源:DiagramManager.cpp

示例2: SetRootItem

void wxXmlSerializer::SetRootItem(xsSerializable* root)
{
    wxASSERT(root);
    wxASSERT(root->IsKindOf(CLASSINFO(xsSerializable)));

	if( m_pRoot )delete m_pRoot;

    if(root && root->IsKindOf(CLASSINFO(xsSerializable)))
    {
        m_pRoot = root;
    }
	else
		m_pRoot = new xsSerializable();

	// update pointers to parent manager
	m_mapUsedIDs.clear();
	
	m_pRoot->m_pParentManager = this;
	m_mapUsedIDs[m_pRoot->GetId()] = m_pRoot;
	
	xsSerializable *pItem;
	SerializableList lstItems;
	GetItems(NULL, lstItems);
	
	SerializableList::compatibility_iterator node = lstItems.GetFirst();
	while( node )
	{
		pItem = node->GetData();
		
		pItem->m_pParentManager = this;
		m_mapUsedIDs[pItem->GetId()] = pItem;
		
		node = node->GetNext();
	}
}
开发者ID:05storm26,项目名称:codelite,代码行数:35,代码来源:XmlSerializer.cpp

示例3: GetCategory

udSettingsCategory* udSettings::GetCategory(const wxString& name)
{
	SerializableList lstCategories;
	GetItems( CLASSINFO(udSettingsCategory), lstCategories );
	
	SerializableList::compatibility_iterator node = lstCategories.GetFirst();
	while( node )
	{
		if( ((udSettingsCategory*)node->GetData())->GetName() == name ) return (udSettingsCategory*)node->GetData();
		
		node = node->GetNext();
	}
	
	return NULL;
}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:15,代码来源:SettingsBase.cpp

示例4: GetIDCount

int wxXmlSerializer::GetIDCount(long id)
{
	int nCount = 0;

    SerializableList items;
    GetItems(CLASSINFO(xsSerializable), items);

	SerializableList::compatibility_iterator node = items.GetFirst();
	while(node)
	{
		if( node->GetData()->GetId() == id ) nCount++;
		node = node->GetNext();
	}

	if( m_pRoot->GetId() == id ) nCount++;

	return nCount;
}
开发者ID:05storm26,项目名称:codelite,代码行数:18,代码来源:XmlSerializer.cpp

示例5: GetChild

xsSerializable* xsSerializable::GetChild(long id, bool recursive)
{
    SerializableList lstChildren;
    SerializableList::compatibility_iterator node;

    if( recursive )
    {
        GetChildrenRecursively( CLASSINFO(xsSerializable), lstChildren );
        node = lstChildren.GetFirst();
    }
    else
        node = m_lstChildItems.GetFirst();

    while(node)
    {
		if( node->GetData()->GetId() == id) return node->GetData();
        node = node->GetNext();
    }

	return NULL;
}
开发者ID:05storm26,项目名称:codelite,代码行数:21,代码来源:XmlSerializer.cpp

示例6: GetProperty

xsProperty* udSettings::GetProperty(const wxString& name)
{
	udSettingsCategory *pCategory;
	xsProperty *pProperty;
	
	SerializableList lstCategories;
	GetItems( CLASSINFO(udSettingsCategory), lstCategories );
	
	SerializableList::compatibility_iterator node = lstCategories.GetFirst();
	while( node )
	{
		pCategory = (udSettingsCategory*)node->GetData();
		
		pProperty = pCategory->GetProperty( name );
		if( pProperty ) return pProperty;
		
		node = node->GetNext();
	}
	
	return NULL;
}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:21,代码来源:SettingsBase.cpp

示例7: InitChild

void xsSerializable::InitChild(xsSerializable* child)
{
	if( child )
	{
        child->m_pParentItem = this;

        if( m_pParentManager )
        {
			if( child->m_pParentManager != m_pParentManager )
			{
				child->m_pParentManager = m_pParentManager;
				
				// assign unique ids to the child object
				if( child->GetId() == -1 ) child->SetId(m_pParentManager->GetNewId());
				else
					m_pParentManager->GetUsedIDs()[child->GetId()] = child;
				
				// if the child has another children, set their parent manager and ID as well
				xsSerializable *pItem;
				SerializableList lstChildren;
				child->GetChildrenRecursively( NULL, lstChildren );
				
				SerializableList::compatibility_iterator node = lstChildren.GetFirst();
				while( node )
				{
					pItem = node->GetData();
					
					pItem->SetParentManager( m_pParentManager );
					
					if( pItem->GetId() == -1 ) pItem->SetId(m_pParentManager->GetNewId());
					else
						m_pParentManager->GetUsedIDs()[pItem->GetId()] = pItem;
					
					node = node->GetNext();
				}
			}
        }
	}
}
开发者ID:05storm26,项目名称:codelite,代码行数:39,代码来源:XmlSerializer.cpp


注:本文中的SerializableList::GetFirst方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。