qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::CoreSet Class Reference

Manages a set of core identifiers. More...

#include <qb/coreset.h>

Public Member Functions

 CoreSet (CoreIdSet const &set) noexcept
 Construct a CoreSet with a specific set of cores.
CoreId resolve (std::size_t id) const noexcept
 Resolve a core ID to its index in the set.
const CoreIdSetraw () const noexcept
 Get the raw set of core IDs.
uint32_t getSize () const noexcept
 Get the size of the core set.
uint32_t getNbCore () const noexcept
 Get the number of cores in the set.

Static Public Member Functions

static CoreSet build (uint32_t nb_core=std::thread::hardware_concurrency()) noexcept
 Build a CoreSet with a specified number of cores.

Detailed Description

Manages a set of core identifiers.

CoreSet provides functionality to manage and manipulate sets of core identifiers. It is used to specify which cores should be used for actor execution and communication.

Constructor & Destructor Documentation

◆ CoreSet()

qb::CoreSet::CoreSet ( CoreIdSet const & set)
explicitnoexcept

Construct a CoreSet with a specific set of cores.

Parameters
setSet of core IDs to include

Member Function Documentation

◆ build()

CoreSet qb::CoreSet::build ( uint32_t nb_core = std::thread::hardware_concurrency())
staticnodiscardnoexcept

Build a CoreSet with a specified number of cores.

Parameters
nb_coreNumber of cores to include (defaults to hardware concurrency)
Returns
Newly created CoreSet

Creates a CoreSet containing sequential core IDs from 0 to nb_core-1. If nb_core is not specified, it uses the number of hardware threads available.

◆ resolve()

CoreId qb::CoreSet::resolve ( std::size_t id) const
nodiscardnoexcept

Resolve a core ID to its index in the set.

Parameters
idCore ID to resolve
Returns
Index of the core in the set

◆ raw()

const CoreIdSet & qb::CoreSet::raw ( ) const
nodiscardnoexcept

Get the raw set of core IDs.

Returns
Reference to the underlying set of core IDs

◆ getSize()

uint32_t qb::CoreSet::getSize ( ) const
nodiscardnoexcept

Get the size of the core set.

Returns
Number of cores in the set

◆ getNbCore()

uint32_t qb::CoreSet::getNbCore ( ) const
nodiscardnoexcept

Get the number of cores in the set.

Returns
Number of cores