dl
dl_component.h 文件参考

组件系统 更多...

#include <typeinfo>
#include <typeindex>
#include <string>
#include <vector>
#include <array>
#include <functional>
#include "dl_type.h"
#include "math/dl_align.h"
#include "math/dl_coor.h"

浏览该文件的源代码.

class  dl::Cpt::Variable< T, UID >
 变量,注意模板参数 需要实例化后不重复 更多...
 
class  dl::Cpt::Function< T, UID >
 由于this指针在构造完成之前无效,不能在初始化列表构造 更多...
 
class  dl::AnyType
 任意类型包装 更多...
 
class  dl::VectorAny
 任意对象容器(组件) 更多...
 
class  dl::Components
 组件容器 更多...
 

命名空间

namespace  dl
 
namespace  dl::Cpt
 子组件命名空间
 

函数

Componentsdl::createComponents (std::string_view name={})
 
template<typename T>
std::vector< T * > dl::Cpt::GetComp (std::vector< Components * > &vec)
 从vector<Components*>返回指定类型的所有组件
 
template<typename T>
Tdl::Cpt::GetFirst (std::vector< Components * > &vec)
 从vector<Components*>返回指定类型的第一个元素
 
template<typename T>
Tdl::Cpt::GetN (std::vector< Components * > &vec, size_t n)
 从vector<Components*>返回指定类型的第n个元素
 

详细描述

组件系统

版本
1.0
作者
lveyou
日期
22-01-01
注解
用于取代绑定于代码的静态继承关系,动态化功能组件
避免使用std::any,以完全掌控性能
如果没有组件需求,直接使用vector<any>即可
组件仅仅是{AnyType,VectorAny}的组合
命名缩写规范:ele表示多个Components(单个元素)、cpt表示Components、comp表示单个组件

在文件 dl_component.h 中定义.