neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::ecs Namespace Reference

Namespaces

namespace  chrono
 
namespace  detail
 

Classes

struct  clock
 
class  component
 
class  component_base
 
struct  component_mutex
 
struct  dont_lock_t
 
class  ecs
 
class  entity
 
class  entity_archetype
 
struct  entity_info
 
struct  entity_life_span
 
class  i_component
 
class  i_component_base
 
struct  i_component_data
 
class  i_ecs
 
class  i_entity_archetype
 
class  i_shared_component
 
class  i_system
 
class  scoped_component_lock
 
struct  shared
 
class  shared_component
 
class  shared_component_scoped_lock
 
class  system
 
class  time
 

Typedefs

typedef scalar time_interval
 
typedef std::optional< time_intervaloptional_time_interval
 
typedef int64_t step_time_interval
 
typedef std::optional< step_time_intervaloptional_step_time_interval
 
typedef step_time_interval step_time
 
typedef std::optional< step_timeoptional_step_time
 
typedef neolib::uuid entity_archetype_id
 
typedef neolib::uuid component_id
 
typedef neolib::uuid system_id
 
typedef voidhandle_t
 
typedef neolib::cookie id_t
 
typedef id_t handle_id
 
typedef id_t entity_id
 
template<class _Ty >
using ecs_data_type_t = std::remove_cv_t< std::remove_reference_t< _Ty > >
 

Enumerations

enum class  component_data_field_type : uint32_t {
  Invalid = 0x00000000 , Bool = 0x00000001 , Int8 = 0x00000002 , Uint8 = 0x00000003 ,
  Int16 = 0x00000004 , Uint16 = 0x00000005 , Int32 = 0x00000006 , Uint32 = 0x00000007 ,
  Int64 = 0x00000008 , Uint64 = 0x00000009 , Float32 = 0x0000000A , Float64 = 0x0000000B ,
  Scalar = Float64 , BasicVec2 = 0x00000100 , BasicVec3 = 0x00000200 , BasicVec4 = 0x00000300 ,
  Vec2 = BasicVec2 | Float64 , Vec3 = BasicVec3 | Float64 , Vec4 = BasicVec4 | Float64 , Vec2f = BasicVec2 | Float32 ,
  Vec3f = BasicVec3 | Float32 , Vec4f = BasicVec4 | Float32 , Vec2i32 = BasicVec2 | Int32 , Vec3i32 = BasicVec3 | Int32 ,
  Vec4i32 = BasicVec4 | Int32 , Vec2u32 = BasicVec2 | Uint32 , Vec3u32 = BasicVec3 | Uint32 , Vec4u32 = BasicVec4 | Uint32 ,
  Vec2i64 = BasicVec2 | Int64 , Vec3i64 = BasicVec3 | Int64 , Vec4i64 = BasicVec4 | Int64 , Vec2u64 = BasicVec2 | Uint64 ,
  Vec3u64 = BasicVec3 | Uint64 , Vec4u64 = BasicVec4 | Uint64 , Triangle = Vec3u32 , Face = Triangle ,
  BasicMat22 = 0x00000400 , BasicMat33 = 0x00000500 , BasicMat44 = 0x00000600 , Mat22 = BasicMat22 | Float64 ,
  Mat33 = BasicMat33 | Float64 , Mat44 = BasicMat44 | Float64 , Aabb = 0x00001000 , Aabb2d = 0x00002000 ,
  String = 0x00010000 , Enum = 0x000B0000 , Uuid = 0x000C0000 , Id = 0x000D0000 ,
  SmallId = 0x000E0000 , ComponentData = 0x000F0000 , Optional = 0x01000000 , Array = 0x02000000 ,
  Shared = 0x04000000 , Cache = 0x40000000 , Internal = 0x80000000
}
 
enum class  ecs_flags : uint32_t {
  None = 0x0000 , PopulateEntityInfo = 0x0001 , Turbo = 0x0002 , CreatePaused = 0x0004 ,
  NoThreads = 0x0008 , Default = PopulateEntityInfo | Turbo
}
 

Functions

step_time_interval to_step_time (time_interval aTime, step_time_interval aStepInterval)
 
step_time_interval to_step_time (optional_time_interval &aTime, step_time_interval aStepInterval)
 
time_interval from_step_time (step_time_interval aStepTime)
 
step_time_interval to_step_time (const i_ecs &aEcs, time_interval aTime)
 
template<typename T >
bool batchable (const std::optional< T > &lhs, const std::optional< T > &rhs)
 
template<typename Data >
bool batchable (const shared< Data > &lhs, const shared< Data > &rhs)
 
constexpr component_data_field_type operator| (component_data_field_type aLhs, component_data_field_type aRhs)
 
constexpr component_data_field_type operator& (component_data_field_type aLhs, component_data_field_type aRhs)
 
constexpr component_data_field_typeoperator|= (component_data_field_type &aLhs, component_data_field_type aRhs)
 
constexpr component_data_field_typeoperator&= (component_data_field_type &aLhs, component_data_field_type aRhs)
 
constexpr ecs_flags operator| (ecs_flags aLhs, ecs_flags aRhs)
 
constexpr ecs_flags operator& (ecs_flags aLhs, ecs_flags aRhs)
 
constexpr ecs_flagsoperator|= (ecs_flags &aLhs, ecs_flags aRhs)
 
constexpr ecs_flagsoperator&= (ecs_flags &aLhs, ecs_flags aRhs)
 

Variables

constexpr id_t null_id = 0
 
constexpr entity_id null_entity = 0
 
const struct neolib::ecs::dont_lock_t dont_lock
 

Typedef Documentation

◆ component_id

◆ ecs_data_type_t

template<class _Ty >
using neolib::ecs::ecs_data_type_t = typedef std::remove_cv_t<std::remove_reference_t<_Ty> >

Definition at line 47 of file i_component_data.hpp.

◆ entity_archetype_id

◆ entity_id

Definition at line 51 of file ecs_ids.hpp.

◆ handle_id

Definition at line 50 of file ecs_ids.hpp.

◆ handle_t

Definition at line 47 of file ecs_ids.hpp.

◆ id_t

Definition at line 48 of file ecs_ids.hpp.

◆ optional_step_time

Definition at line 60 of file chrono.hpp.

◆ optional_step_time_interval

◆ optional_time_interval

Definition at line 56 of file chrono.hpp.

◆ step_time

◆ step_time_interval

◆ system_id

◆ time_interval

Definition at line 55 of file chrono.hpp.

Enumeration Type Documentation

◆ component_data_field_type

Enumerator
Invalid 
Bool 
Int8 
Uint8 
Int16 
Uint16 
Int32 
Uint32 
Int64 
Uint64 
Float32 
Float64 
Scalar 
BasicVec2 
BasicVec3 
BasicVec4 
Vec2 
Vec3 
Vec4 
Vec2f 
Vec3f 
Vec4f 
Vec2i32 
Vec3i32 
Vec4i32 
Vec2u32 
Vec3u32 
Vec4u32 
Vec2i64 
Vec3i64 
Vec4i64 
Vec2u64 
Vec3u64 
Vec4u64 
Triangle 
Face 
BasicMat22 
BasicMat33 
BasicMat44 
Mat22 
Mat33 
Mat44 
Aabb 
Aabb2d 
String 
Enum 
Uuid 
Id 
SmallId 
ComponentData 
Optional 
Array 
Shared 
Cache 
Internal 

Definition at line 51 of file i_component_data.hpp.

◆ ecs_flags

Enumerator
None 
PopulateEntityInfo 
Turbo 
CreatePaused 
NoThreads 
Default 

Definition at line 53 of file i_ecs.hpp.

Function Documentation

◆ batchable() [1/2]

template<typename Data >
bool neolib::ecs::batchable ( const shared< Data > &  lhs,
const shared< Data > &  rhs 
)
inline

Definition at line 62 of file component.hpp.

◆ batchable() [2/2]

template<typename T >
bool neolib::ecs::batchable ( const std::optional< T > &  lhs,
const std::optional< T > &  rhs 
)
inline

Definition at line 56 of file component.hpp.

◆ from_step_time()

time_interval neolib::ecs::from_step_time ( step_time_interval  aStepTime)
inline

Definition at line 76 of file chrono.hpp.

◆ operator&() [1/2]

constexpr component_data_field_type neolib::ecs::operator& ( component_data_field_type  aLhs,
component_data_field_type  aRhs 
)
inlineconstexpr

Definition at line 115 of file i_component_data.hpp.

◆ operator&() [2/2]

constexpr ecs_flags neolib::ecs::operator& ( ecs_flags  aLhs,
ecs_flags  aRhs 
)
inlineconstexpr

Definition at line 69 of file i_ecs.hpp.

◆ operator&=() [1/2]

constexpr component_data_field_type & neolib::ecs::operator&= ( component_data_field_type aLhs,
component_data_field_type  aRhs 
)
inlineconstexpr

Definition at line 125 of file i_component_data.hpp.

◆ operator&=() [2/2]

constexpr ecs_flags & neolib::ecs::operator&= ( ecs_flags aLhs,
ecs_flags  aRhs 
)
inlineconstexpr

Definition at line 79 of file i_ecs.hpp.

◆ operator|() [1/2]

constexpr component_data_field_type neolib::ecs::operator| ( component_data_field_type  aLhs,
component_data_field_type  aRhs 
)
inlineconstexpr

Definition at line 110 of file i_component_data.hpp.

◆ operator|() [2/2]

constexpr ecs_flags neolib::ecs::operator| ( ecs_flags  aLhs,
ecs_flags  aRhs 
)
inlineconstexpr

Definition at line 64 of file i_ecs.hpp.

◆ operator|=() [1/2]

constexpr component_data_field_type & neolib::ecs::operator|= ( component_data_field_type aLhs,
component_data_field_type  aRhs 
)
inlineconstexpr

Definition at line 120 of file i_component_data.hpp.

◆ operator|=() [2/2]

constexpr ecs_flags & neolib::ecs::operator|= ( ecs_flags aLhs,
ecs_flags  aRhs 
)
inlineconstexpr

Definition at line 74 of file i_ecs.hpp.

◆ to_step_time() [1/3]

step_time_interval neolib::ecs::to_step_time ( const i_ecs aEcs,
time_interval  aTime 
)
inline

Definition at line 98 of file clock.hpp.

◆ to_step_time() [2/3]

step_time_interval neolib::ecs::to_step_time ( optional_time_interval aTime,
step_time_interval  aStepInterval 
)
inline

Definition at line 68 of file chrono.hpp.

◆ to_step_time() [3/3]

step_time_interval neolib::ecs::to_step_time ( time_interval  aTime,
step_time_interval  aStepInterval 
)
inline

Definition at line 62 of file chrono.hpp.

Variable Documentation

◆ dont_lock

const struct neolib::ecs::dont_lock_t neolib::ecs::dont_lock

◆ null_entity

constexpr entity_id neolib::ecs::null_entity = 0
constexpr

Definition at line 52 of file ecs_ids.hpp.

◆ null_id

constexpr id_t neolib::ecs::null_id = 0
constexpr

Definition at line 49 of file ecs_ids.hpp.