本文整理汇总了C++中SerializableList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializableList::end方法的具体用法?C++ SerializableList::end怎么用?C++ SerializableList::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializableList
的用法示例。
在下文中一共展示了SerializableList::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRemoveColumnClick
void TableSettings::OnRemoveColumnClick(wxCommandEvent& event)
{
Column *col = GetColumn( GetSelectedColumnName() );
if( col ) {
// delete associated keys
SerializableList keys;
GetConstraints( keys, col->GetName() );
for(SerializableList::iterator it = keys.begin(); it != keys.end(); ++it ) {
Constraint *key = (Constraint*) *it;
m_lstKeys.DeleteObject( key );
delete key;
}
// delete the column
m_lstColumns.DeleteObject( col );
delete col;
UpdateView();
}
}
示例2: ProcessClassMembers
void udCPPClassElementProcessor::ProcessClassMembers(wxSFShapeBase* element)
{
SerializableList lstMembers;
umlClassDiagram::GetClassMembers( (umlClassItem*)element, CLASSINFO(udMemberDataLinkItem), (udLanguage::ACCESSTYPE)-1, lstMembers );
if( !lstMembers.IsEmpty() )
{
udMemberDataItem *pVar;
udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
pLang->SingleLineCommentCmd( wxT("member data initialization") );
for( SerializableList::iterator it = lstMembers.begin(); it != lstMembers.end(); ++it )
{
pVar = (udMemberDataItem*)((udMemberDataLinkItem*)*it)->GetOriginal();
if( !pVar->GetValue().IsEmpty() ) pLang->WriteCodeBlocks( pVar->ToString( udCodeItem::cfDEFINITION, pLang ) );
}
pLang->NewLine();
}
}
示例3: ProcessClassDeclaration
void udCPPClassElementProcessor::ProcessClassDeclaration(wxSFShapeBase* element)
{
udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
udClassAlgorithm *pAlg = (udClassAlgorithm*) m_pParentGenerator->GetActiveAlgorithm();
// get base classes if exists
ShapeList lstBases;
umlClassDiagram::GetBaseClasses( (umlClassItem*)element, lstBases );
int nTemplateIndex = 0;
wxString sBases;
for( ShapeList::iterator it = lstBases.begin(); it != lstBases.end(); ++it )
{
if( it != lstBases.begin() ) sBases << wxT(", ");
sBases << pLang->MakeValidIdentifier( udPROJECT::GetDiagramElement(*it)->GetName() );
// add template parameter if exists
umlClassTemplateItem *pTemplate = wxDynamicCast( *it, umlClassTemplateItem );
if( pTemplate )
{
// find corespondent template binding connection
ShapeList lstConnections;
element->GetShapeManager()->GetAssignedConnections( element, CLASSINFO(umlTemplateBindItem), wxSFShapeBase::lineSTARTING, lstConnections );
if( !lstConnections.IsEmpty() )
{
// append bind type to the base name
udTemplateBindElementItem *pBindElement = wxDynamicCast( udPROJECT::GetDiagramElement( lstConnections.Item(nTemplateIndex)->GetData() ), udTemplateBindElementItem );
if( pBindElement )
{
sBases << wxT("<") << pBindElement->GetBindType() << wxT(">");
}
}
nTemplateIndex++;
}
}
udClassElementItem *pClass = (udClassElementItem*) udPROJECT::GetDiagramElement(element);
//generate comment if requested
pLang->WriteCodeBlocks( udGenerator::GetComment( pClass, pLang) );
// write template definition if needed
udClassTemplateElementItem *pClassTempl = wxDynamicCast( pClass, udClassTemplateElementItem );
if( pClassTempl )
{
pLang->WriteCodeBlocks( wxT("template <typename ") + pClassTempl->GetTemplateName() + wxT(">") );
}
// generate class declaration
pLang->ClassDeclCmd( pLang->MakeValidIdentifier( pClass->GetName() ), sBases );
pLang->BeginCmd();
// declare class members
int nAccessType = 0;
wxClassInfo *pPrevType;
SerializableList lstMembers;
ShapeList lstAssocs;
while( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) != wxEmptyString )
{
pLang->WriteCodeBlocks( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) + wxT(":") );
pLang->IncIndentation();
lstMembers.Clear();
lstAssocs.Clear();
pPrevType = NULL;
// process associations
umlClassDiagram::GetClassAssociations( (umlClassItem*) element, CLASSINFO(wxSFLineShape), wxSFLineShape::lineSTARTING, (udLanguage::ACCESSTYPE) nAccessType, lstAssocs );
for( ShapeList::iterator it = lstAssocs.begin(); it != lstAssocs.end(); ++it )
{
udElementProcessor *pProcessor = pAlg->GetElementProcessor( (*it)->GetClassInfo()->GetClassName() );
if( pProcessor ) pProcessor->ProcessElement( *it );
}
// process class members
umlClassDiagram::GetClassMembers( (umlClassItem*) element, CLASSINFO(udMemberDataLinkItem), (udLanguage::ACCESSTYPE) nAccessType, lstMembers);
umlClassDiagram::GetClassMembers( (umlClassItem*) element, CLASSINFO(udMemberFunctionLinkItem), (udLanguage::ACCESSTYPE) nAccessType, lstMembers);
for( SerializableList::iterator it = lstMembers.begin(); it != lstMembers.end(); ++it )
{
if( pPrevType && ((*it)->GetClassInfo() != pPrevType) ) pLang->NewLine();
// generate comment
pLang->WriteCodeBlocks( udGenerator::GetComment( ((udCodeLinkItem*)*it)->GetOriginal(), pLang ) );
// generate function decl
pLang->WriteCodeBlocks( ((udCodeLinkItem*)*it)->ToString( udCodeItem::cfDECLARATION, pLang ) );
pPrevType = (*it)->GetClassInfo();
}
nAccessType++;
pLang->DecIndentation();
pLang->NewLine();
}
//.........这里部分代码省略.........
示例4: ProcessClassDefinition
void udCPPClassElementProcessor::ProcessClassDefinition(wxSFShapeBase* element)
{
udLanguage *pLang = m_pParentGenerator->GetActiveLanguage();
int nAccessType = 0;
udFunctionItem *pFcn;
SerializableList lstMembers;
while( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) != wxEmptyString )
{
lstMembers.Clear();
umlClassDiagram::GetClassMembers( (umlClassItem*) element, CLASSINFO(udMemberFunctionLinkItem), (udLanguage::ACCESSTYPE) nAccessType, lstMembers);
if( !lstMembers.IsEmpty() )
{
pLang->SingleLineCommentCmd( pLang->GetAccessTypeString( (udLanguage::ACCESSTYPE) nAccessType ) + wxT(" function members of '") + udPROJECT::GetDiagramElement(element)->GetName() + wxT("' class") );
}
for( SerializableList::iterator it = lstMembers.begin(); it != lstMembers.end(); ++it )
{
pFcn = (udFunctionItem*)((udCodeLinkItem*)*it)->GetOriginal();
// generate non-abstract functions only
if( pFcn->GetFunctionModifer() == udLanguage::FM_ABSTRACT ) continue;
// write template definition if needed
udClassTemplateElementItem *pClassTempl = wxDynamicCast( udPROJECT::GetDiagramElement(element), udClassTemplateElementItem );
if( pClassTempl )
{
pLang->WriteCodeBlocks( wxT("template <typename ") + pClassTempl->GetTemplateName() + wxT(">") );
}
if( pFcn->GetImplementation() == uddvFUNCTION_USERIMPLEMENTATION )
{
pLang->WriteCodeBlocks( pFcn->ToString( udCodeItem::cfDEFINITION, pLang ) );
pLang->BeginCmd();
if( pFcn->IsKindOf( CLASSINFO(udConstructorFunctionItem) ) ) ProcessClassMembers( element );
/*if( pFcn->GetCode().IsEmpty() ) pLang->WriteCodeBlocks( pLang->Dummy() );
else
{*/
// insert code marks here needed for code synchronization
pLang->SingleLineCommentCmd( udGenerator::GetBeginCodeMark( pFcn ) );
pLang->WriteCodeBlocks( pFcn->GetCode() );
pLang->SingleLineCommentCmd( udGenerator::GetEndCodeMark( pFcn ) );
/*}*/
pLang->EndCmd();
pLang->NewLine();
}
}
nAccessType++;
}
}
示例5: OnColumnChanged
void TableSettings::OnColumnChanged(wxDataViewEvent& event)
{
Column *col = reinterpret_cast<Column*>(m_dvColumns->GetItemData( event.GetItem() ) );
if( col ) {
wxVariant val;
event.GetModel()->GetValue( val, event.GetItem(), event.GetColumn() );
if( ! val.IsNull() ) {
switch( event.GetColumn() ) {
case 0: {
// rename local columns in keys
SerializableList keys;
GetConstraints( keys, col->GetName() );
for(SerializableList::iterator it = keys.begin(); it != keys.end(); ++it ) {
Constraint *key = (Constraint*) *it;
if( key->GetType() == Constraint::primaryKey ) key->SetName( wxT("PK_") + val.GetString() );
key->SetLocalColumn( val.GetString() );
}
// rename table column
col->SetName( val.GetString() );
break;
}
case 1: {
col->SetType( m_pDbAdapter->GetDbTypeByName( val.GetString() ) );
break;
}
case 2: {
long s1, s2;
s1 = s2 = 0;
wxSscanf( val.GetString(), wxT("%ld,%ld"), &s1, &s2 );
IDbType *type = col->GetType();
if( type->HaveSize() ) type->SetSize( s1 );
else {
m_infobar->ShowMessage( wxT("This data type doesn't support size definition."), wxICON_WARNING );
Refresh();
}
if( type->HaveSize2() ) type->SetSize2( s1 );
else {
m_infobar->ShowMessage( wxT("This data type doesn't support size definition."), wxICON_WARNING );
Refresh();
}
break;
}
case 3: {
IDbType *type = col->GetType();
if( type->HaveNotNull() ) type->SetNotNull( val.GetBool() );
else {
m_infobar->ShowMessage( wxT("This data type doesn't support NOT NULL feature."), wxICON_WARNING );
Refresh();
}
break;
}
case 4: {
IDbType *type = col->GetType();
if( type->HaveAutoIncrement() ) type->SetAutoIncrement( val.GetBool() );
else {
m_infobar->ShowMessage( wxT("This data type doesn't support AUTOINCREMENT feature."), wxICON_WARNING );
Refresh();
}
break;
}
case 5: {
Constraint *key = GetConstraint( Constraint::primaryKey, col->GetName() );
if( key ) {
// remove primary key if exists
m_lstKeys.DeleteObject( key );
delete key;
} else {
// create new primary key
key = new Constraint( wxT("PK_") + col->GetName(),
col->GetName(),
Constraint::primaryKey,
Constraint::noAction,
Constraint::noAction );
m_lstKeys.Append( key );
}
break;
}
}
}
}
event.Skip();
UpdateView();
}
示例6: _DeserializeObjects
void wxSFDiagramManager::_DeserializeObjects(xsSerializable* parent, wxXmlNode* node)
{
wxSFShapeBase *pShape;
wxXS::IntArray arrNewIDs;
SerializableList lstForUpdate;
wxXmlNode* shapeNode = node->GetChildren();
while(shapeNode)
{
if(shapeNode->GetName() == wxT("object"))
{
#if wxVERSION_NUMBER < 2900
pShape = AddShape((wxSFShapeBase*)wxCreateDynamicObject(shapeNode->GetPropVal(wxT("type"), wxT(""))), parent, wxPoint(0, 0), true, sfDONT_SAVE_STATE);
#else
pShape = AddShape((wxSFShapeBase*)wxCreateDynamicObject(shapeNode->GetAttribute(wxT("type"), wxT(""))), parent, wxPoint(0, 0), true, sfDONT_SAVE_STATE);
#endif
if(pShape)
{
// store new assigned ID
lstForUpdate.Append( pShape );
pShape->GetChildrenRecursively( NULL, lstForUpdate );
for( SerializableList::iterator it = lstForUpdate.begin(); it != lstForUpdate.end(); ++it )
{
arrNewIDs.Add( (*it)->GetId() );
}
// deserialize stored content
pShape->DeserializeObject(shapeNode);
// update handle in line shapes
if( pShape->IsKindOf( CLASSINFO(wxSFLineShape) ) )
{
pShape->CreateHandles();
m_lstLinesForUpdate.Append(pShape);
}
else if( pShape->IsKindOf( CLASSINFO(wxSFGridShape) ) )
{
m_lstGridsForUpdate.Append(pShape);
}
// store information about IDs' changes and re-assign shapes' IDs
int newId, i = 0;
for( SerializableList::iterator it = lstForUpdate.begin(); it != lstForUpdate.end(); ++it )
{
newId = arrNewIDs[i++];
if( newId != (*it)->GetId() )
{
m_lstIDPairs.Append( new IDPair((*it)->GetId(), newId) );
(*it)->SetId( newId );
}
}
// deserialize child objects
_DeserializeObjects(pShape, shapeNode);
arrNewIDs.Clear();
lstForUpdate.Clear();
}
else
{
// there are some unsupported shapes so the diagrams must be cleared because of possible damage
RemoveAll();
m_lstLinesForUpdate.Clear();
m_lstGridsForUpdate.Clear();
wxMessageBox( wxT("Deserialization couldn't be completed because not of all shapes are accepted."), wxT("wxShapeFramework"), wxOK | wxICON_WARNING );
return;
}
}
else if(shapeNode->GetName() == m_sRootName + wxT("_properties"))
{
m_pRoot->DeserializeObject(shapeNode->GetChildren());
}
shapeNode = shapeNode->GetNext();
}
}