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


C++ Relation::ensureChildrenLoaded方法代码示例

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


在下文中一共展示了Relation::ensureChildrenLoaded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
开发者ID:cyborgve,项目名称:FlameRobin,代码行数:51,代码来源:MetadataItemPropertiesFrame.cpp


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