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


C++ compatibility_iterator::GetData方法代码示例

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


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

示例1: Init

ErdPanel::ErdPanel(wxWindow* parent, IDbAdapter* dbAdapter, xsSerializable* pConnections, xsSerializable* pItems)
    : _ErdPanel(parent)
{
    m_pErdTable = NULL;
    m_pDbAdapter = dbAdapter;
    m_pConnections = pConnections;
    Init(parent, dbAdapter);
    int i = 10;
    SerializableList::compatibility_iterator node = pItems->GetFirstChildNode();
    while(node) {
        Table* pTable = wxDynamicCast(node->GetData(), Table);
        if(pTable) {
            ErdTable* pErdTab = new ErdTable(pTable);
            m_diagramManager.AddShape(pErdTab, NULL, wxPoint(i, 10), sfINITIALIZE, sfDONT_SAVE_STATE);
            i += 200;
            pErdTab->UpdateColumns();
        }
        View* pView = wxDynamicCast(node->GetData(), View);
        if(pView) {
            ErdView* pErdView = new ErdView(pView);
            m_diagramManager.AddShape(pErdView, NULL, wxPoint(i, 10), sfINITIALIZE, sfDONT_SAVE_STATE);
            i += 200;
            pErdView->UpdateView();
        }
        node = node->GetNext();
    }
    m_pFrameCanvas->UpdateERD();
    m_pFrameCanvas->UpdateVirtualSize();
}
开发者ID:capturePointer,项目名称:codelite,代码行数:29,代码来源:ErdPanel.cpp

示例2: GetLastChild

xsSerializable* xsSerializable::GetLastChild(wxClassInfo *type)
{
    SerializableList::compatibility_iterator node = m_lstChildItems.GetLast();
    while( node )
	{
		if( node->GetData()->IsKindOf( type ) ) return node->GetData();
		node = node->GetPrevious();
    }
	return NULL;
}
开发者ID:05storm26,项目名称:codelite,代码行数:10,代码来源:XmlSerializer.cpp

示例3: ConvertTable

void PostgreSqlDbAdapter::ConvertTable(Table* pTab) {
	SerializableList::compatibility_iterator node = pTab->GetFirstChildNode();
	while( node ) {
		if( node->GetData()->IsKindOf( CLASSINFO(Column)) )  {
			Column* col = (Column*) node->GetData();
			col->SetType(ConvertType(col->GetType()));
		}
		node = node->GetNext();
	}
}
开发者ID:kluete,项目名称:codelite,代码行数:10,代码来源:PostgreSqlDbAdapter.cpp

示例4: FitToChildren

void wxSFRectShape::FitToChildren()
{
    // HINT: overload it for custom actions...

    wxSFShapeBase* pChild;

    // get bounding box of the shape and children set be inside it	
	wxRect chBB = this->GetBoundingBox();
	wxRect shpBB = chBB;

    SerializableList::compatibility_iterator node = GetFirstChildNode();
    while(node)
    {
        pChild = (wxSFShapeBase*)node->GetData();

        if( pChild->ContainsStyle(sfsALWAYS_INSIDE) )
        {
            pChild->GetCompleteBoundingBox(chBB, bbSELF | bbCHILDREN);
        }
        node = node->GetNext();
    }

	if(!chBB.IsEmpty())
	{
		//wxRect shpBB = this->GetBoundingBox();

		if(!shpBB.Contains(chBB))
		{
			double dx = chBB.GetLeft() - shpBB.GetLeft();
			double dy = chBB.GetTop() - shpBB.GetTop();

			// resize parent shape
			shpBB.Union(chBB);
			MoveTo(shpBB.GetPosition().x, shpBB.GetPosition().y);
			m_nRectSize = wxRealPoint(shpBB.GetSize().x, shpBB.GetSize().y);

			// move its "1st level" children if neccessary
			if((dx < 0) || (dy < 0))
			{
				node = GetFirstChildNode();
				while(node)
				{
					pChild = (wxSFShapeBase*)node->GetData();
					if(dx < 0)pChild->MoveBy(abs((int)dx), 0);
					if(dy < 0)pChild->MoveBy(0, abs((int)dy));

					node = node->GetNext();
				}
			}
		}
	}
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:52,代码来源:RectShape.cpp

示例5: 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

示例6: 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

示例7: Update

void wxSFGridShape::Update()
{
    wxSFShapeBase *pShape;

    // check an existence of already assigned shapes
    for(size_t i = 0; i < m_arrCells.GetCount(); )
    {
        if( !GetChild(m_arrCells[i])) m_arrCells.RemoveAt(i);
		else
			i++;
    }

    // check whether all child shapes' IDs are present in the cells array...
    SerializableList::compatibility_iterator node = GetFirstChildNode();
    while(node)
    {
        pShape = (wxSFShapeBase*)node->GetData();
        if( m_arrCells.Index(pShape->GetId()) == wxNOT_FOUND ) m_arrCells.Add(pShape->GetId());

        node = node->GetNext();
    }

    // do self-alignment
    DoAlignment();

    // do alignment of shape's children
    this->DoChildrenLayout();

    // fit the shape to its children
    this->FitToChildren();

    // do it recursively on all parent shapes
    if( GetParentShape() )GetParentShape()->Update();
}
开发者ID:kaustubhcs,项目名称:codelite,代码行数:34,代码来源:GridShape.cpp

示例8: FitToChildren

void wxSFGridShape::FitToChildren()
{
    // HINT: overload it for custom actions...

    wxSFShapeBase* pChild;

    // get bounding box of the shape and children set be inside it
    wxRealPoint nAbsPos = GetAbsolutePosition();
    wxRect chBB = wxRect(nAbsPos.x, nAbsPos.y, 0, 0);

    SerializableList::compatibility_iterator node = GetFirstChildNode();
    while(node)
    {
        pChild = (wxSFShapeBase*)node->GetData();

        if( pChild->GetStyle() & sfsALWAYS_INSIDE )
        {
            pChild->GetCompleteBoundingBox(chBB, bbSELF | bbCHILDREN);
        }
        node = node->GetNext();
    }

    // do not let the grid shape 'disappear' due to zero sizes...
    if( (!chBB.GetWidth() || !chBB.GetHeight()) && !m_nCellSpace )
    {
        chBB.SetWidth( 10 );
        chBB.SetHeight( 10 );
    }

    m_nRectSize = wxRealPoint(chBB.GetSize().x + 2*m_nCellSpace, chBB.GetSize().y + 2*m_nCellSpace);
}
开发者ID:kaustubhcs,项目名称:codelite,代码行数:31,代码来源:GridShape.cpp

示例9: OnTopHandle

void wxSFRectShape::OnTopHandle(wxSFShapeHandle& handle)
{
	// HINT: overload it for custom actions...

    wxSFShapeBase *pChild;

	//double dy = (double)handle.GetPosition().y - GetAbsolutePosition().y;
	double dy = (double)handle.GetDelta().y;

	// update position of children
	if( !ContainsStyle( sfsLOCK_CHILDREN ) )
	{
		SerializableList::compatibility_iterator node = GetFirstChildNode();
		while(node)
		{
			pChild = (wxSFShapeBase*)node->GetData();
			if( pChild->GetVAlign() == valignNONE )
			{
				pChild->MoveBy(0, -dy);
			}
			node = node->GetNext();
		}
	}
	// update position and size of the shape
	m_nRectSize.y -= dy;
	m_nRelativePosition.y += dy;
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:27,代码来源:RectShape.cpp

示例10: ProcessElement

void udCPPEnumElementProcessor::ProcessElement(wxSFShapeBase *element)
{	
	udClassAlgorithm *pAlg = (udClassAlgorithm*) m_pParentGenerator->GetActiveAlgorithm();
	
	/*// check whether the enum is already processed
    if( pAlg->GetProcessedElements().IndexOf(element) != wxNOT_FOUND ) return;*/
	
	if( pAlg->GetGenMode() == udGenerator::genDECLARATION )
	{
		udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
		udEnumElementItem *pEnum = (udEnumElementItem*) udPROJECT::GetDiagramElement( element, udfOMIT_LINKS );
		if( pEnum )
		{
			// get enumeration values
			wxArrayString arrValues;
			SerializableList::compatibility_iterator node = pEnum->GetFirstChildNode();
			while( node )
			{
				arrValues.Add( ((udCodeItem*)node->GetData())->ToString(udCodeItem::cfDECLARATION, pLang) );
				node = node->GetNext();
			}
			
			// write enumeration code
			//pLang->SingleLineCommentCmd( wxT("Enumeration '") + pEnum->GetName() + wxT("'") );
			
			pLang->EnumCmd( pLang->MakeValidIdentifier( pEnum->GetName() ), arrValues, pLang->MakeValidIdentifier( pEnum->GetInstanceName() ) );
			pLang->NewLine();
		}
	}
}
开发者ID:LETARTARE,项目名称:CodeDesigner,代码行数:30,代码来源:CPPElementProcessors.cpp

示例11: DrawContent

void wxSFThumbnail::DrawContent(wxDC& dc)
{
	// HINT: overload it for custom actions...
	
	wxSFShapeBase *pShape;
	
	SerializableList::compatibility_iterator node = m_pCanvas->GetDiagramManager()->GetRootItem()->GetFirstChildNode();
	while( node )
	{
		pShape = wxDynamicCast( node->GetData(), wxSFShapeBase );
		
		if( pShape )
		{
			if( (m_nThumbStyle & tsSHOW_CONNECTIONS) && pShape->IsKindOf(CLASSINFO(wxSFLineShape)) ) pShape->Draw( dc, sfWITHOUTCHILDREN );
			else if( m_nThumbStyle & tsSHOW_ELEMENTS )
			{
				if( pShape->IsKindOf(CLASSINFO(wxSFBitmapShape)) ) 
				{
					dc.SetPen( wxPen( *wxBLACK, 1, wxDOT) );
					dc.SetBrush( *wxWHITE_BRUSH );
					
					dc.DrawRectangle( pShape->GetBoundingBox() );
					
					dc.SetBrush( wxNullBrush );
					dc.SetPen( wxNullPen );
				}
				else if( !pShape->IsKindOf(CLASSINFO(wxSFLineShape)) ) pShape->Draw( dc, sfWITHOUTCHILDREN );
			}
		}
						
		node = node->GetNext();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:33,代码来源:Thumbnail.cpp

示例12: GetSibbling

xsSerializable* xsSerializable::GetSibbling(wxClassInfo *type)
{
    wxASSERT( m_pParentItem );

    if( m_pParentItem )
    {
		SerializableList::compatibility_iterator node = m_pParentItem->GetChildrenList().Find( this );
		while( node )
		{
			node = node->GetNext();
			
			if( node && (node->GetData()->IsKindOf( type ) ) ) return node->GetData();
		}
    }

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

示例13: GetCreateTableSql

wxString MySqlDbAdapter::GetCreateTableSql(Table* tab, bool dropTable)
{
	//TODO:SQL:
	wxString str = wxT("");
	if (dropTable) str = wxString::Format(wxT("SET FOREIGN_KEY_CHECKS = 0;\nDROP TABLE IF EXISTS `%s` ;\nSET FOREIGN_KEY_CHECKS = 1; \n"),tab->GetName().c_str());
	str.append(wxString::Format(wxT("CREATE TABLE `%s` (\n"),tab->GetName().c_str()));



	SerializableList::compatibility_iterator node = tab->GetFirstChildNode();
	while( node ) {
		Column* col = NULL;
		if( node->GetData()->IsKindOf( CLASSINFO(Column)) ) col = (Column*) node->GetData();
		if(col)	str.append(wxString::Format(wxT("\t`%s` %s"),col->GetName().c_str(), col->GetType()->ReturnSql().c_str()));

		Constraint* constr = wxDynamicCast(node->GetData(),Constraint);
		if (constr) {
			if (constr->GetType() == Constraint::primaryKey) str.append(wxString::Format(wxT("\tPRIMARY KEY (`%s`) \n"), constr->GetLocalColumn().c_str()));
		}

		node = node->GetNext();
		if (node) {
			if (wxDynamicCast(node->GetData(),Column)) str.append(wxT(",\n ")) ;
			else if ((constr = wxDynamicCast(node->GetData(),Constraint))) {
				if (constr->GetType() == Constraint::primaryKey) str.append(wxT(",\n ")) ;
			}

		}
		//else  str.append(wxT("\n ")) ;
	}

	/*	Column* col = tab->GetFristColumn();
		while (col) {
			str.append(wxString::Format(wxT("\t`%s` %s"),col->getName().c_str(), col->getPType()->ReturnSql().c_str()));
			col = wxDynamicCast(col->GetSibbling(),Column);
			if (col) str.append(wxT(",\n ")) ;
			else  str.append(wxT("\n ")) ;
		}*/

	str.append(wxT("\n) ENGINE=INNODB;\n"));
	str.append(wxT("-- -------------------------------------------------------------\n"));
	return str;
}
开发者ID:05storm26,项目名称:codelite,代码行数:43,代码来源:MySqlDbAdapter.cpp

示例14: wxObject

xsSerializable::xsSerializable(const xsSerializable& obj)
: wxObject(obj)
{
	m_pParentManager = NULL;
    m_pParentItem = NULL;
    m_fSerialize = obj.m_fSerialize;
	m_fClone = obj.m_fClone;
    m_nId = obj.m_nId;

    XS_SERIALIZE(m_nId, wxT("id"));
	
	// copy serialized children as well
	SerializableList::compatibility_iterator node = obj.GetFirstChildNode();
	while( node )
	{
		if( node->GetData()->IsSerialized() ) AddChild( (xsSerializable*)node->GetData()->Clone() );
		node = node->GetNext();
	}
}
开发者ID:05storm26,项目名称:codelite,代码行数:19,代码来源:XmlSerializer.cpp

示例15: GetAlterTableConstraintSql

wxString MySqlDbAdapter::GetAlterTableConstraintSql(Table* tab)
{
	//TODO:SQL:
	wxString str =  wxString::Format(wxT("-- ---------- CONSTRAINTS FOR TABLE `%s` \n"),tab->GetName().c_str());
	str.append(wxT("-- -------------------------------------------------------------\n"));
	wxString prefix = wxString::Format(wxT("ALTER TABLE `%s` "),tab->GetName().c_str());

	SerializableList::compatibility_iterator node = tab->GetFirstChildNode();
	while( node ) {
		Constraint* constr = NULL;
		constr = wxDynamicCast(node->GetData(), Constraint);
		if (constr) {
			if (constr->GetType() == Constraint::foreignKey) {
				str.append(prefix + wxString::Format(wxT("ADD CONSTRAINT `%s` FOREIGN KEY (`%s`) REFERENCES `%s`(`%s`) " ), constr->GetName().c_str(), constr->GetLocalColumn().c_str(), constr->GetRefTable().c_str(), constr->GetRefCol().c_str()));
				str.append(wxT("ON UPDATE "));
				switch(constr->GetOnUpdate()) {
				case Constraint::restrict:
					str.append(wxT("RESTRICT "));
					break;
				case Constraint::cascade:
					str.append(wxT("CASCADE "));
					break;
				case Constraint::setNull:
					str.append(wxT("SET NULL "));
					break;
				case Constraint::noAction:
					str.append(wxT("NO ACTION "));
					break;
				}
				str.append(wxT("ON DELETE "));
				switch(constr->GetOnDelete()) {
				case Constraint::restrict:
					str.append(wxT("RESTRICT "));
					break;
				case Constraint::cascade:
					str.append(wxT("CASCADE "));
					break;
				case Constraint::setNull:
					str.append(wxT("SET NULL "));
					break;
				case Constraint::noAction:
					str.append(wxT("NO ACTION "));
					break;
				}
				str.append(wxT("; \n"));
			}
		}//if (constr->GetType() == Constraint::primaryKey) str.append(prefix + wxString::Format(wxT("ADD CONSTRAINT `%s` PRIMARY KEY (`%s`); \n"), constr->GetName().c_str(), constr->GetLocalColumn().c_str()));


		node = node->GetNext();
	}
	str.append(wxT("-- -------------------------------------------------------------\n"));
	return str;
}
开发者ID:05storm26,项目名称:codelite,代码行数:54,代码来源:MySqlDbAdapter.cpp


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