SObjectizer  5.7
Functions | Variables
so_5::prio Namespace Reference

Helpers for working with priorities. More...

Functions

bool has_next (priority_t p)
 Is there higher priority? More...
 
priority_t next (priority_t p)
 Get the next priority value. More...
 
bool has_prev (priority_t p)
 Is there lower priority? More...
 
priority_t prev (priority_t p)
 Get the previous priority value. More...
 
template<typename Lambda >
void for_each_priority (Lambda l)
 Does enumeration of all priorities. More...
 

Variables

const priority_t default_priority = p0
 Default priority value. More...
 
const unsigned int total_priorities_count
 Total count of priorities. More...
 
Constants with priority values.
const priority_t p0 = priority_t::p0
 
const priority_t p1 = priority_t::p1
 
const priority_t p2 = priority_t::p2
 
const priority_t p3 = priority_t::p3
 
const priority_t p4 = priority_t::p4
 
const priority_t p5 = priority_t::p5
 
const priority_t p6 = priority_t::p6
 
const priority_t p7 = priority_t::p7
 

Detailed Description

Helpers for working with priorities.

Since
v.5.5.8

Function Documentation

◆ for_each_priority()

template<typename Lambda >
void so_5::prio::for_each_priority ( Lambda  l)

Does enumeration of all priorities.

Since
v.5.5.8
Note
Performs enumeration from priority_t::p_min to priority_t::p_max (inclusive).
Template Parameters
Lambdaa lambda with the prototype:
return_type lambda(so_5::priority_t);
Return value from that lambda will be ignored and discarded.
Example:
// Fill the new cooperation with agents with different priorities.
[&]( so_5::coop_t & coop ) {
// Creation of new agent with next priority.
coop.make_agent< my_prio_agent >( prio, ... );
} );
} );
Examples:
so_5/prio_work_stealing/main.cpp.

◆ has_next()

bool so_5::prio::has_next ( priority_t  p)
inline

Is there higher priority?

Since
v.5.5.8

◆ has_prev()

bool so_5::prio::has_prev ( priority_t  p)
inline

Is there lower priority?

Since
v.5.5.8
Examples:
so_5/prio_work_stealing/main.cpp.

◆ next()

priority_t so_5::prio::next ( priority_t  p)
inline

Get the next priority value.

Since
v.5.5.8
Returns
next priority value if p is less than priority_t::p_max or priority_t::p_max instead.
Examples:
so_5/dispatcher_restarts/main.cpp, so_5/make_pipeline/main.cpp, so_5/mutable_msg_agents/main.cpp, and so_5/redirect_and_transform/main.cpp.

◆ prev()

priority_t so_5::prio::prev ( priority_t  p)
inline

Get the previous priority value.

Since
v.5.5.8
Returns
previous priority value if p is greater than priority_t::p_min or priority_t::p_min instead.
Examples:
so_5/make_pipeline/main.cpp, and so_5/prio_work_stealing/main.cpp.

Variable Documentation

◆ default_priority

const priority_t so_5::prio::default_priority = p0

Default priority value.

Since
v.5.5.8

◆ p0

const priority_t so_5::prio::p0 = priority_t::p0

◆ p1

const priority_t so_5::prio::p1 = priority_t::p1

◆ p2

const priority_t so_5::prio::p2 = priority_t::p2

◆ p3

const priority_t so_5::prio::p3 = priority_t::p3

◆ p4

const priority_t so_5::prio::p4 = priority_t::p4

◆ p5

const priority_t so_5::prio::p5 = priority_t::p5

◆ p6

const priority_t so_5::prio::p6 = priority_t::p6

◆ p7

const priority_t so_5::prio::p7 = priority_t::p7

◆ total_priorities_count

const unsigned int so_5::prio::total_priorities_count
Initial value:
=
static_cast< unsigned int >( p7 ) -
static_cast< unsigned int >( p0 ) + 1
const priority_t p7
Definition: priority.hpp:86
const priority_t p0
Definition: priority.hpp:79

Total count of priorities.

Since
v.5.5.8
Examples:
so_5/prio_work_stealing/main.cpp.