コード例 #1
0
    void decomposeProperty(const Sample<T>& sample, PropertyBag& targetbag)
    {
        std::string tname = detail::DataSourceTypeInfo<T>::getType();
        targetbag.setType("Sample");
        //std::string str;

        assert( targetbag.empty() );

        bool result =true;
        //std::stringstream out;
        //out << i+1;
        //str = out.str();

        Property<PropertyBag>* el_bag = new Property<PropertyBag>("SampleValue", "Sample Value"); 
        Property<T> el("SampleValue" , "Sample value ",sample.ValueGet())  ;
        if(    el.getTypeInfo()->decomposeType(el.getDataSource(),el_bag->value()) )
        {
            //log(Debug)<<"Element type "<<el.getType()<<" is a bag"<<endlog();
            targetbag.add( el_bag ); // Put variables in the bag
        }
        else
        {
            //log(Debug)<<"Element type "<<el.getType()<<" is not a bag"<<endlog();
            //For Property
            targetbag.add( new Property<T>("SampleValue" ,"Sample Value",sample.ValueGet() )); // Put variables in the bag
        }
    };