本文整理汇总了C++中Procedure::ensureChildrenLoaded方法的典型用法代码示例。如果您正苦于以下问题:C++ Procedure::ensureChildrenLoaded方法的具体用法?C++ Procedure::ensureChildrenLoaded怎么用?C++ Procedure::ensureChildrenLoaded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure::ensureChildrenLoaded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//! recreate html page if something changes
void MetadataItemPropertiesPanel::update()
{
Database* db = dynamic_cast<Database*>(objectM);
if (db && !db->isConnected())
{
objectM = 0;
if (MetadataItemPropertiesFrame* f = getParentFrame())
f->Close();
// MB: This code used to use:
//f->removePanel(this);
// which would allow us to mix property pages from different
// databases in the same Frame, but there are some mysterious
// reasons why it causes heap corruption with MSVC
return;
}
// if table or view columns change, we need to reattach
if (objectM->getType() == ntTable || objectM->getType() == ntView) // also observe columns
{
Relation* r = dynamic_cast<Relation*>(objectM);
if (!r)
return;
SubjectLocker locker(r);
r->ensureChildrenLoaded();
for (ColumnPtrs::iterator it = r->begin(); it != r->end(); ++it)
(*it)->attachObserver(this, false);
}
// if description of procedure params change, we need to reattach
if (objectM->getType() == ntProcedure)
{
Procedure* p = dynamic_cast<Procedure*>(objectM);
if (!p)
return;
SubjectLocker locker(p);
p->ensureChildrenLoaded();
for (ParameterPtrs::iterator it = p->begin(); it != p->end(); ++it)
(*it)->attachObserver(this, false);
}
// with this set to false updates to the same page do not show the
// "Please wait while the data is being loaded..." temporary page
// this results in less flicker, but may also seem less responsive
if (!htmlReloadRequestedM)
requestLoadPage(false);
}
示例2: tokenizer
//.........这里部分代码省略.........
nameM.get());
if (!objectM)
objectTypeM = ntUnknown;
}
else if (objectTypeM == ntUnknown) // find relation
{
if (!databaseM)
return;
objectM = databaseM->findRelation(nameM);
if (objectM)
objectTypeM = objectM->getType();
}
return;
}
}
// GRANT role_name TO ...
nameM.setFromSql(tokenStringsM[1]);
objectM = databaseM->findByNameAndType(ntRole, nameM.get());
if (objectM)
objectTypeM = ntRole;
return;
}
// COMMENT ON COLUMN table.column IS
// COMMENT ON PARAMETER procedure.parameter IS
if (actionM == actCOMMENT && tokensM[1] == kwON)
{
Identifier parent(tokenStringsM[3]);
Identifier child(tokenStringsM[4]);
if (tokensM[2] == kwCOLUMN)
{
if (Relation* r = databaseM->findRelation(parent))
{
r->ensureChildrenLoaded();
if (ColumnPtr c = r->findColumn(child.get()))
{
objectTypeM = ntColumn;
objectM = c.get();
return;
}
}
}
if (tokensM[2] == kwPARAMETER)
{
Procedure* p = dynamic_cast<Procedure *>(
databaseM->findByNameAndType(ntProcedure, parent.get()));
if (p)
{
p->ensureChildrenLoaded();
if (ParameterPtr par = p->findParameter(child.get()))
{
objectTypeM = ntParameter;
objectM = par.get();
return;
}
}
}
}
// get object type
while (objectTypeM == ntUnknown && typeTokenIndex < tokensM.size())
{
switch (tokensM[typeTokenIndex])
{
case kwDATABASE:
objectTypeM = ntDatabase; break;