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


C++ DataPtr::IsClass方法代码示例

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


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

示例1: InterpretField


//.........这里部分代码省略.........
            choice->a_IsDropDown.Set( true );
            choice->a_IsReadOnly.Set( readOnly );

            container->AddChild(choice);
        }
        else
        {
            if ( field->m_DataClass == Reflect::GetClass<BoolData>() )
            {
                CheckBoxPtr checkBox = CreateControl<CheckBox>();
                checkBox->a_IsReadOnly.Set( readOnly );
                checkBox->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
                container->AddChild( checkBox );
            }
            else
            {
                ValuePtr value = CreateControl<Value>();
                value->a_IsReadOnly.Set( readOnly );
                value->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
                container->AddChild( value );
            }
        }
    }

    //
    // Setup label
    //

    LabelPtr label = NULL;

    {
        V_Control::const_iterator itr = container->GetChildren().begin();
        V_Control::const_iterator end = container->GetChildren().end();
        for( ; itr != end; ++itr )
        {
            Label* label = Reflect::SafeCast<Label>( *itr );
            if (label)
            {
                break;
            }
        }
    }

    if (!label.ReferencesObject())
    {
        label = CreateControl<Label>();

        tstring temp;
        field->GetProperty( TXT( "UIName" ), temp );
        if ( temp.empty() )
        {
            bool converted = Helium::ConvertString( field->m_Name, temp );
            HELIUM_ASSERT( converted );
        }

        label->BindText( temp );
        label->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );

        container->InsertChild(0, label);
    }

    //
    // Bind data
    //

    std::vector<Data*> ser;

    {
        std::vector<Reflect::Object*>::const_iterator itr = instances.begin();
        std::vector<Reflect::Object*>::const_iterator end = instances.end();
        for ( ; itr != end; ++itr )
        {
            DataPtr s = field->CreateData();

            if (!s->IsClass(Reflect::GetClass<ContainerData>()))
            {
                s->ConnectField(*itr, field);

                ser.push_back(s);

                m_Datas.push_back(s);
            }
        }
    }

    Helium::SmartPtr< MultiStringFormatter<Data> > data = new MultiStringFormatter<Data>( ser );

    container->Bind( data );

    //
    // Set default
    //

    DataPtr defaultData = field->CreateDefaultData();
    if (defaultData.ReferencesObject())
    {
        tstringstream defaultStream;
        *defaultData >> defaultStream;
        container->a_Default.Set( defaultStream.str() );
    }
开发者ID:euler0,项目名称:Helium,代码行数:101,代码来源:ReflectValueInterpreter.cpp

示例2: InterpretField


//.........这里部分代码省略.........
        value->a_IsReadOnly.Set( readOnly );
        value->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );
        container->AddChild( value );
    }


    //
    // Setup label
    //

    LabelPtr label = NULL;

    {
        V_Control::const_iterator itr = container->GetChildren().begin();
        V_Control::const_iterator end = container->GetChildren().end();
        for( ; itr != end; ++itr )
        {
            Label* label = Reflect::SafeCast<Label>( *itr );
            if (label)
            {
                break;
            }
        }
    }

    if (!label.ReferencesObject())
    {
        label = CreateControl< Label >();

        tstring temp;
        field->GetProperty( TXT( "UIName" ), temp );
        if ( temp.empty() )
        {
            bool converted = Helium::ConvertString( field->m_Name, temp );
            HELIUM_ASSERT( converted );
        }

        label->BindText( temp );
        label->a_HelpText.Set( field->GetProperty( TXT( "HelpText" ) ) );

        container->InsertChild(0, label);
    }

    //
    // Create type m_FinderSpecific data bound to this and additional instances
    //

    std::vector<Data*> ser;

    {
        std::vector<Reflect::Object*>::const_iterator itr = instances.begin();
        std::vector<Reflect::Object*>::const_iterator end = instances.end();
        for ( ; itr != end; ++itr )
        {
            DataPtr s = field->CreateData();

            if (s->IsClass(Reflect::GetClass<ContainerData>()))
            {
                return;
            }

            s->ConnectField(*itr, field);

            ser.push_back(s);

            m_Datas.push_back(s);
        }
    }

    //
    // Create data and bind
    //

    Helium::SmartPtr< MultiStringFormatter<Data> > data = new MultiStringFormatter<Data>( ser );

    if (changingDelegate.Valid())
    {
        data->AddChangingListener( changingDelegate );
    }

    {
        std::vector<ContainerPtr>::const_iterator itr = groups.begin();
        std::vector<ContainerPtr>::const_iterator end = groups.end();
        for ( ; itr != end; ++itr )
        {
            (*itr)->Bind( data );
        }
    }

    //
    // Set default
    //

    DataPtr defaultData = field->CreateDefaultData();
    if (defaultData.ReferencesObject())
    {
        tstringstream defaultStream;
        *defaultData >> defaultStream;
        container->a_Default.Set( defaultStream.str() );
    }
开发者ID:,项目名称:,代码行数:101,代码来源:


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