BIMHome v1.0.0
BIMHome接口文档说明

◆ convertFromIF() [3/3]

template<typename C , typename P >
void convertFromIF ( const std::vector< std::shared_ptr< P > > &  parents,
std::vector< std::shared_ptr< C > > &  childs 
)

将父类智能指针的向量转换为子类智能指针的向量

遍历父类智能指针向量,使用 dynamic_pointer_cast 将每个父类智能指针转换为子类智能指针,并添加到子类智能指针向量中。

模板参数
C子类类型
P父类类型
参数
[in]parents父类智能指针的向量
[out]childs子类智能指针的向量