27 #ifndef EMBB_MTAPI_AFFINITY_H_ 28 #define EMBB_MTAPI_AFFINITY_H_ 30 #include <embb/mtapi/c/mtapi.h> 31 #include <embb/mtapi/internal/check_status.h> 58 : affinity_(other.affinity_) {
69 affinity_ = other.affinity_;
81 Init(initial_affinity);
93 mtapi_status_t status;
94 mtapi_boolean_t ia = initial_affinity ? MTAPI_TRUE : MTAPI_FALSE;
96 internal::CheckStatus(status);
107 mtapi_status_t status;
108 mtapi_boolean_t st = state ? MTAPI_TRUE : MTAPI_FALSE;
110 internal::CheckStatus(status);
122 mtapi_status_t status;
123 mtapi_boolean_t state =
125 internal::CheckStatus(status);
126 return (state != MTAPI_FALSE) ?
true :
false;
147 #endif // EMBB_MTAPI_AFFINITY_H_ Definition: lock_free_mpmc_queue.h:40
bool Get(mtapi_uint_t worker)
Gets affinity to the given worker.
Definition: affinity.h:119
void Set(mtapi_uint_t worker, bool state)
Sets affinity to the given worker.
Definition: affinity.h:103
Describes the affinity of an Action or Task to a worker thread of a Node.
Definition: affinity.h:41
Affinity(bool initial_affinity)
Constructs an Affinity object with the given initial affinity.
Definition: affinity.h:78
mtapi_uint64_t mtapi_affinity_t
Core affinity type.
Definition: mtapi.h:350
mtapi_affinity_t GetInternal() const
Returns the internal representation of this object.
Definition: affinity.h:136
mtapi_boolean_t mtapi_affinity_get(mtapi_affinity_t *mask, const mtapi_uint_t core_num, mtapi_status_t *status)
Returns the affinity that corresponds to the given core_num for this affinity mask.
void operator=(Affinity const &other)
Copies an Affinity object.
Definition: affinity.h:66
void mtapi_affinity_set(mtapi_affinity_t *mask, const mtapi_uint_t core_num, const mtapi_boolean_t affinity, mtapi_status_t *status)
This function is used to change the default values of an affinity mask object.
Affinity()
Constructs an Affinity object.
Definition: affinity.h:47
void mtapi_affinity_init(mtapi_affinity_t *mask, const mtapi_boolean_t affinity, mtapi_status_t *status)
This function initializes an affinity mask object.
void Init(bool initial_affinity)
Initializes an Affinity object with the given initial affinity.
Definition: affinity.h:90
Affinity(Affinity const &other)
Copies an Affinity object.
Definition: affinity.h:55