Function count

Summary

#include <include/flecs/addons/cpp/world.hpp>

(1) int count(flecs::id_t component_id) const

(2) int count(flecs::entity_t first, flecs::entity_t second) const

(3) template <typename T>
    int count() const

(4) template <typename First>
    int count(flecs::entity_t second) const

(5) template <typename First, typename Second>
    int count() const

Function overload

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

int count(flecs::id_t component_id) const

Description

Count entities matching a component.

Parameters

component_id - The component id.

Source

Lines 603-605 in include/flecs/addons/cpp/world.hpp.

int count(flecs::id_t component_id) const {
    return ecs_count_id(m_world, component_id);
}

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

int count(flecs::entity_t first, flecs::entity_t second) const

Description

Count entities matching a pair.

Parameters

first - The first element of the pair.

second - The second element of the pair.

Source

Lines 612-614 in include/flecs/addons/cpp/world.hpp.

int count(flecs::entity_t first, flecs::entity_t second) const {
    return ecs_count_id(m_world, ecs_pair(first, second));
}

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

template <typename T>
int count() const

Description

Count entities matching a component.

Template Parameters

T - The component type.

Source

Lines 620-623 in include/flecs/addons/cpp/world.hpp.

template <typename T>
int count() const {
    return count(_::cpp_type<T>::id(m_world));
}

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

template <typename First>
int count(flecs::entity_t second) const

Description

Count entities matching a pair.

Template Parameters

First - The first element of the pair.

Parameters

second - The second element of the pair.

Source

Lines 630-633 in include/flecs/addons/cpp/world.hpp.

template <typename First>
int count(flecs::entity_t second) const {
    return count(_::cpp_type<First>::id(m_world), second);
}

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

template <typename First, typename Second>
int count() const

Description

Count entities matching a pair.

Template Parameters

First - The first element of the pair.

Second - The second element of the pair.

Source

Lines 640-645 in include/flecs/addons/cpp/world.hpp.

template <typename First, typename Second>
int count() const {
    return count( 
        _::cpp_type<First>::id(m_world),
        _::cpp_type<Second>::id(m_world));
}