emlabcpp
modern opinionated embedded C++ library
|
MIT License. More...
Namespaces | |
bits | |
cfg | |
MIT License. | |
coro | |
MIT License. | |
detail | |
impl | |
MIT License. | |
iterators | |
MIT License. | |
pmr | |
MIT License. | |
protocol | |
MIT License. | |
rpc | |
MIT License. | |
testing | |
MIT License. | |
Classes | |
struct | convert_to |
Object with operator() that constructs object of type T out of passed-in value. More... | |
class | bounded |
The bounded class represents a wrapper over type T constrained between MinVal and MaxVal as compile-time constants. More... | |
class | defer |
The defer class stores a callable object and ensures it is executed when the defer object goes out of scope. More... | |
class | bounded_view |
class | cobs_encoder |
TODO: make this no inline. More... | |
struct | cobs_decoder |
class | decode_cobs_iter |
class | contiguous_request_adapter |
class | contiguous_object_handle |
class | contiguous_array_handle |
class | contiguous_node |
class | contiguous_tree |
class | derived_storage |
class | function_view |
class | function_view< ReturnType(ArgTypes...) > |
class | point |
Class implementing multidimensional point in coordinate system of dimension N. More... | |
struct | pose_distance |
distance between two poses in space, represented as 'space distance' and 'angular distance' More... | |
struct | pose |
represents orientation and position in 3D space More... | |
class | quaternion |
API and behavior of this is inspired by tf::Quaternion. More... | |
class | simplex |
class | vec_point_base |
class | vector |
class | linked_list_node_base |
class | linked_list_node |
class | matrix |
class | transposed_matrix |
class | identity_matrix |
class | rowcol_submatrix |
struct | string_buffer |
struct | generic_iterator |
generic_iterator simplifies custom iterator implementation using CRTP. More... | |
class | generic_iterator_base |
struct | matcher |
struct | min_max |
A structure representing a range defined by a minimum and a maximum value. More... | |
struct | outcome |
outcome represents tristate resut of some operation, which can succeed, fail or produce an error. More... | |
struct | physical_quantity |
physical_quantity represents all physical units defined using the International System of Units and more. More... | |
struct | pid_coefficients |
struct | pid_config |
Structure to configure the pid regulator. More... | |
struct | pid |
Implementation of PID regulator, the object should be constructed and populated with pid<T>::conf structure with configuration values (p,i,d coeficients, min/max output vals). More... | |
class | quantity |
Class representing generic quantity. More... | |
class | tagged_quantity |
Class represents a quantity that uses tags to distinguish quantities instead of inheritance. More... | |
struct | result |
result represents an result of some operation, as an alternative to returning just bool with true/false value. More... | |
class | static_circular_buffer_iterator |
class | static_circular_buffer |
Class implementing circular buffer of any type for up to N elements. More... | |
class | static_function_base |
class | static_function_base< ReturnType(ArgTypes...), Capacity, Align > |
struct | static_storage |
Continuous data container that can contain N of uninitialized elements. More... | |
class | static_vector |
Data container for up to N elements. More... | |
struct | status |
struct | iterator_of |
struct | data_iterator_of |
struct | is_view |
struct | are_same |
struct | are_same< T, Ts... > |
struct | are_same<> |
struct | tuple_has_type |
struct | tuple_has_type< T, std::tuple< Us... > > |
struct | is_std_tuple |
struct | is_std_array |
struct | is_std_vector |
struct | static_size |
struct | signature_of |
struct | signature_of< ReturnType(Class::*)(Args...) > |
struct | signature_of< ReturnType(Class::*)(Args...) const > |
struct | signature_of< ReturnType(Args...) > |
struct | mapped |
struct | mapped< Container, UnaryCallable > |
struct | tag |
struct | select_utype |
struct | type_map |
struct | type_map< std::tuple< Ts... >, Fun > |
struct | type_tag |
struct | index_of |
struct | index_of< T, std::variant< Ts... > > |
class | view |
Generic class to represent view of some container. More... | |
class | zip_iterator |
zip_ierator iterates over a group of iterators, where value is a tuple of references to value for each iterator. More... | |
Typedefs | |
template<std::size_t N> | |
using | line = std::array< point< N >, 2 > |
template<std::size_t N> | |
using | triangle = simplex< point< N >, 2 > |
template<typename Signature , std::size_t Capacity> | |
using | static_function = static_function_base< Signature, Capacity, alignof(void *) > |
using | value_type = T |
using | reference = T & |
using | const_reference = T const & |
using | pointer = T * |
using | const_pointer = T const * |
using | size_type = std::size_t |
template<typename Container > | |
using | iterator_of_t = typename iterator_of< Container >::type |
template<typename Container > | |
using | data_iterator_of_t = typename data_iterator_of< Container >::type |
template<typename Container , typename UnaryCallable > | |
using | mapped_t = typename mapped< Container, UnaryCallable >::type |
template<std::size_t N> | |
using | select_utype_t = typename select_utype< N >::type |
template<typename T , template< typename > class Fun> | |
using | type_map_t = typename type_map< T, Fun >::type |
template<typename T , typename Variant > | |
using | index_of_v = index_of< T, Variant >::value |
using | unitless = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 0 > |
using | length = physical_quantity< 1, 0, 0, 0, 0, 0, 0, 0, 0 > |
using | mass = physical_quantity< 0, 1, 0, 0, 0, 0, 0, 0, 0 > |
using | timeq = physical_quantity< 0, 0, 1, 0, 0, 0, 0, 0, 0 > |
using | current = physical_quantity< 0, 0, 0, 1, 0, 0, 0, 0, 0 > |
using | temp = physical_quantity< 0, 0, 0, 0, 1, 0, 0, 0, 0 > |
using | amount_of_substance = physical_quantity< 0, 0, 0, 0, 0, 1, 0, 0, 0 > |
using | luminous_intensity = physical_quantity< 0, 0, 0, 0, 0, 0, 1, 0, 0 > |
using | angle = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 1, 0 > |
using | byte = physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 1 > |
using | acceleration = physical_quantity< 1, 0, -2, 0, 0, 0, 0, 0, 0 > |
using | angular_velocity = physical_quantity< 0, 0, -1, 0, 0, 0, 0, 1, 0 > |
using | area = physical_quantity< 2, 0, 0, 0, 0, 0, 0, 0, 0 > |
using | volume = physical_quantity< 3, 0, 0, 0, 0, 0, 0, 0, 0 > |
using | velocity = physical_quantity< 1, 0, -1, 0, 0, 0, 0, 0, 0 > |
using | frequency = physical_quantity< 0, 0, -1, 0, 0, 0, 0, 0, 0 > |
using | force = physical_quantity< 1, 1, -2, 0, 0, 0, 0, 0, 0 > |
using | power = physical_quantity< 2, 1, -3, 0, 0, 0, 0, 0, 0 > |
using | voltage = physical_quantity< 2, 1, -3, -1, 0, 0, 0, 0, 0 > |
using | resistance = physical_quantity< 2, 1, -3, -2, 0, 0, 0, 0, 0 > |
using | distance = length |
using | radius = length |
Enumerations | |
enum class | contiguous_tree_type : uint8_t { VALUE = 1 , OBJECT = 2 , ARRAY = 3 } |
enum class | contiguous_container_type : uint8_t { ARRAY = 1 , OBJECT = 2 } |
enum class | contiguous_request_adapter_errors : uint8_t { MISSING_NODE = 1 , WRONG_TYPE = 2 , CHILD_MISSING = 3 , FULL = 4 } |
enum class | outcome_e : uint8_t { SUCCESS = 0 , FAILURE = 1 , ERROR = 2 } |
enum class | result_e : uint8_t { SUCCESS = 0 , ERROR = 1 } |
Functions | |
template<typename T > | |
constexpr int | sign (T const &val) |
returns sign of variable T: -1,0,1 More... | |
template<typename T > | |
constexpr T | ceil_to (T val, T base) |
takes an value val and rounds it up to nearest multiply of base More... | |
template<additive_operators T, arithmetic_operators U> | |
constexpr U | map_range (T input, T from_min, T from_max, U to_min, U to_max) |
maps input value 'input' from input range to equivalent value in output range More... | |
template<container Container> | |
constexpr std::size_t | cont_size (Container const &cont) noexcept |
Returns the size of the container, regardless of what it is. More... | |
template<typename T > | |
constexpr bool | almost_equal (T const &lh, T const &rh, float const eps=default_epsilon) |
Two items 'lh' and 'rh' are almost equal if their difference is smaller than value 'eps'. More... | |
template<referenceable_container Container, typename Iterator = iterator_of_t< Container >> | |
constexpr view< Iterator > | tail (Container &&cont, int const step=1) |
Returns range over Container, which skips first item of container. More... | |
template<referenceable_container Container, typename Iterator = iterator_of_t< Container >> | |
constexpr view< Iterator > | init (Container &&cont, int const step=1) |
Returns range over Container, which skips last item of container. More... | |
template<range_container Container, container_invocable< Container > PredicateCallable = std::identity> | |
constexpr auto | find_if (Container &&cont, PredicateCallable &&f=std::identity()) |
Returns iterator for first item, for which call to predicate f(*iter) holds true. More... | |
template<gettable_container Container, container_invocable< Container > PredicateCallable = std::identity> | |
requires (!range_container< Container >) const expr std | |
Returns index of an element in tuple 't', for which call to predicate f(x) holds true, otherwise returns index of 'past the end' item - size of the tuple. More... | |
template<container Container, typename T > | |
constexpr auto | find (Container &&cont, T const &item) |
Finds first item in container 'cont' that is equal to 'item', returns iterator for container, or index for tuples. More... | |
template<container Container, typename T > | |
constexpr bool | contains (Container const &cont, T const &item) |
Checks if container cont contains at least one occurence of item , returns true/false. More... | |
template<gettable_container Container, container_invocable< Container > UnaryCallable> | |
requires (!range_container< Container >) const expr void for_each(Container &&cont | |
Applies unary callable 'f' to each element of container 'cont'. More... | |
template<range_container Container, container_invocable< Container > UnaryCallable> | |
constexpr void | for_each (Container &&cont, UnaryCallable &&f) |
Applies unary callable 'f' to each element of container 'cont'. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr min_max< T > | min_max_elem (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies unary callable 'f(x)' to each element of container 'cont', returns the largest and the smallest return value. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr T | max_elem (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies unary callable 'f(x)' to each element of container 'cont', returns the largest return value of 'f(x)' calls. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr T | min_elem (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies unary callable 'f(x) to each element of container 'cont‘, returns the smallest return value of 'f(x)’ calls. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity> | |
constexpr std::size_t | count (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies the predicate 'f(x)' to each element of container 'cont' and returns the count of items, for which f(x) returned 'true'. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr T | sum (Container &&cont, UnaryCallable &&f=std::identity(), T init={}) |
Applies f(x) to each item of container 'cont', returns the sum of all the return values of each call to 'f(x)' and 'init' item. More... | |
template<container Container, typename T , typename BinaryCallable > | |
constexpr T | accumulate (Container &&cont, T init, BinaryCallable &&f) |
Applies callable 'f(init,x)' to each element of container 'x' and actual value of 'init' in iteration, returns a result of last application. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr T | avg (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies callable 'f(x)' to each element of container 'cont' and returns the average value of each call. More... | |
template<container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
constexpr T | variance (Container &&cont, UnaryCallable &&f=std::identity()) |
Applies callable 'f(x)' to each element of container 'cont' and returns the variance of values returned from the call. More... | |
template<container LhContainer, container RhContainer, typename BinaryCallable > | |
constexpr void | for_cross_joint (LhContainer &&lh_cont, RhContainer &&rh_cont, BinaryCallable &&f) |
Applies binary callable 'f(x,y)' to each combination of items x from lh_cont and y from rh_cont More... | |
template<container Container, container_invocable< Container > PredicateCallable = std::identity> | |
constexpr bool | any_of (Container &&cont, PredicateCallable &&f=std::identity()) |
Returns true if call to predicate 'f(x)' returns true for at least one item x in 'cont'. More... | |
template<container Container, container_invocable< Container > PredicateCallable = std::identity> | |
constexpr bool | none_of (Container &&cont, PredicateCallable &&f=std::identity()) |
Returns true if call to predicate 'f(x)' returns false for all items in 'cont'. More... | |
template<container Container, container_invocable< Container > PredicateCallable = std::identity> | |
constexpr bool | all_of (Container &&cont, PredicateCallable &&f=std::identity()) |
Returns true if call to predicate 'f(x)' returns true for all items in 'cont'. More... | |
template<range_container LhContainer, range_container RhContainer, typename BinaryPredicateCallable = std::equal_to< void >> | |
constexpr bool | equal (LhContainer &&lh, RhContainer &&rh, BinaryPredicateCallable &&f=std::equal_to< void >{}) |
Returns true if containers 'lh' and 'rh' has same size and calls to predicate f - f(lh[i],rh[i]) return true for each item. More... | |
template<impl::map_f_collectable ResultContainer, container Container, container_invocable< Container > UnaryCallable = std::identity> | |
ResultContainer | map_f (Container &&cont, UnaryCallable &&f=std::identity()) |
Calls callable f(x) for each item in container 'cont' (or tuple) and stores result in 'ResultContainer', which is returned. More... | |
template<std::size_t N, range_container Container, container_invocable< Container > UnaryCallable = std::identity, typename T = std::decay_t< mapped_t< Container, UnaryCallable > >> | |
std::array< T, N > | map_f_to_a (Container &&cont, UnaryCallable &&f=std::identity()) requires(!static_sized< Container >) |
Calls callable f(cont[i]) for i = 0...N and stores the result in array of an size N. More... | |
template<range_container Container, typename T , container_invocable< Container > UnaryCallable = std::identity> | |
constexpr T | joined (Container &&cont, T const &val, UnaryCallable &&f=std::identity()) |
Function applies callable f to each item in container cont and contacts results with operator+, val is used as a separator between the items. More... | |
template<container Container, typename Iterator > | |
void | copy (Container &&cont, Iterator iter) |
template<std::size_t N, typename NullCallable > | |
constexpr void | for_each_index (NullCallable &&f) |
Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N. More... | |
template<std::size_t N, typename PredicateCallable > | |
constexpr std::size_t | find_if_index (PredicateCallable &&f) |
Executes unary callable f() with template argument of type 'std::size_t', which ranges from 0 to N until first call that returns true. More... | |
template<std::size_t i, typename PredicateCallable > | |
constexpr bool | until_index (PredicateCallable &&f) |
Executes predicate f() with template argument of type 'std::size_t', which ranges from 0 to i until first call that returns true. More... | |
template<bounded_derived IndexType, typename Callable > | |
requires (!requires(Callable f) { { f.template operator()< 0 >() } -> std::same_as< void >;}) const expr auto select_index(IndexType i | |
Function expectes bounded value as index input and callable. More... | |
select_index (i, [&res, &f]< std::size_t i >() { res=f.template operator()< i >();}) | |
template<bounded_derived IndexType, typename Callable > | |
requires | requires (Callable f) |
constexpr void | select_index (IndexType i, Callable &&f) |
template<typename... Args, std::size_t N = sizeof...( Args )> | |
constexpr std::array< std::byte, N > | bytes (Args const &... args) |
Conveft the provided arguments into array of std::byte. More... | |
template<typename Arr , typename... Arrs> | |
constexpr auto | merge_arrays (Arr &&first, Arrs &&... arrs) |
Expects multiple std::arrays on input, and merges all together into one std::array instance. More... | |
template<std::size_t N, typename T > | |
constexpr std::array< T, N > | filled (T const &item) |
Constructs an array filled with value x More... | |
template<typename T , typename Container , typename Iterator = iterator_of_t< Container >> | |
view< iterators::convert_iterator< T, Iterator > > | convert_view (Container &&cont) |
template<typename T , typename Iterator > | |
constexpr view< iterators::convert_iterator< T, Iterator > > | convert_view_n (Iterator begin, std::size_t n) |
template<typename Enum > | |
requires (std::is_enum_v< Enum >) auto convert_enum(Enum val) | |
Returns a string-like name of the enum value val More... | |
template<typename Container > | |
auto | enumerate (Container &&cont) |
std::tuple< bool, view< std::byte * > > | encode_cobs (view< std::byte const * > source, view< std::byte * > target) |
Encodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer. More... | |
std::tuple< bool, view< std::byte * > > | decode_cobs (view< std::byte const * > source, view< std::byte * > target) |
Decodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer. More... | |
template<typename Iter > | |
view< decode_cobs_iter< Iter >, decode_cobs_iter< Iter > > | cobs_decode_view (view< Iter > data) |
template<decomposable_0 T> | |
constexpr std::tuple | decompose (T &&) |
template<typename T , typename Tuple > | |
constexpr T | compose (Tuple tpl) |
EMLABCPP_GENERATE_DECOMPOSE (16, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) template< typename T > using decomposed_type | |
template<std::size_t N> | |
constexpr float | distance_of (line< N > const &l, point< N > const &p) |
template<std::size_t N> | |
constexpr float | distance_of (point< N > const &p, line< N > const &line) |
template<std::size_t N> | |
constexpr point< N > | point_cast (vector< N > const &v) |
template<std::size_t N> | |
constexpr vector< N > | vector_cast (point< N > const &p) |
template<std::size_t N> | |
constexpr point< N > | operator* (point< N > a, point< N > const &b) |
Multiplication of points multiplies each coordinate of A by coordinate of B on same dimension. More... | |
template<std::size_t N> | |
constexpr vector< N > | operator- (point< N > a, point< N > const &b) |
Returns a result of subtraction of A from B, viz -= operator. More... | |
template<std::size_t N> | |
constexpr point< N > | operator+ (point< N > a, vector< N > const &b) |
Returns a result of addition a to b, viz += operator. More... | |
template<std::size_t N> | |
constexpr point< N > | operator- (point< N > a, vector< N > const &b) |
Returns a result of subtraction a to b, viz += operator. More... | |
template<std::size_t N> | |
constexpr float | distance_of (point< N > const &a, point< N > const &b) |
Returns euclidian distance of point A from point B. More... | |
template<std::size_t N> | |
constexpr float | point_angle (point< N > const &a, point< N > const &b) |
template<std::size_t N> | |
std::vector< point< N > > | lineary_interpolate_path (std::vector< point< N > > const &ipath, float d_step) |
template<std::size_t N> | |
constexpr float | axis_projection_distance (point< N > const &a, vector< N > const &axis_direction) |
Function to calculate distance of projection of point A. More... | |
constexpr std::size_t | steps (pose_distance dist, float dist_step, float angle_step) |
returns steps necessary for linear interpolation of distance between poses 'dis', such that: More... | |
constexpr bool | operator< (pose const &x, pose const &y) |
constexpr bool | operator== (pose const &x, pose const &y) |
compares poses on their position and orientation More... | |
constexpr bool | operator!= (pose const &x, pose const &y) |
negation of operator== between poses More... | |
constexpr pose_distance | distance_of (pose const &x, pose const &y) |
returns PoseDistance between provided poses More... | |
constexpr pose | lin_interp (pose const &from, pose const &goal, float factor) |
linear interpolation between base se and goal pose, with factor 0 'base' is returned, with factor 1 'goal' is returned. More... | |
std::vector< pose > | lineary_interpolate_path (std::vector< pose > const &ipath, float d_step, float a_step) |
constexpr point< 3 > | transform (point< 3 > const &a, pose const &transformation) |
Point A is rotated based on 'transformation' orientation and than moved based on 'transformation' position. More... | |
constexpr vector< 3 > | transform (vector< 3 > const &v, pose const &transformation) |
constexpr pose | transform (pose const &x, pose const &transformation) |
Pose X is rotated based on 'transformation' orientation and than moved based on 'transformation' position. More... | |
template<typename T > | |
constexpr auto | transform (min_max< T > const &mm, pose const &transformation) |
constexpr pose | inverse (pose const &x) |
template<typename T > | |
constexpr auto | inverse_transform (T const &item, pose const &transformation) |
constexpr pose | rotate (pose const &x, quaternion const &quat) |
Pose X is rotated based on quaternion 'quad'. More... | |
constexpr quaternion | inverse (quaternion const &q) |
constexpr quaternion | operator- (quaternion const &q) |
constexpr float | dot (quaternion const &q, quaternion const &s) |
constexpr float | norm2_of (quaternion const &q) |
constexpr float | angle_shortest_path (quaternion const &m, quaternion const &n) |
constexpr quaternion | slerp (quaternion const &q, quaternion const &s, float f) |
constexpr bool | operator== (quaternion const &q, quaternion const &s) |
constexpr bool | operator!= (quaternion const &q, quaternion const &s) |
constexpr bool | operator< (quaternion const &q, quaternion const &s) |
constexpr quaternion | operator* (quaternion const &q, quaternion const &s) |
constexpr quaternion | operator* (quaternion const &q, point< 3 > const &x) |
constexpr quaternion | operator* (point< 3 > const &x, quaternion const &q) |
constexpr quaternion | operator+ (quaternion const &lh, quaternion const &rh) |
constexpr bool | almost_equal (quaternion const &q, quaternion const &s, float eps=default_epsilon) |
constexpr quaternion | shortest_arc_quat (point< 3 > x, point< 3 > y) |
constexpr point< 3 > | rotate (point< 3 > const &x, quaternion const &q) |
constexpr quaternion | rotate (quaternion const &x, quaternion const &q) |
constexpr vector< 3 > | rotate (vector< 3 > const &v, quaternion const &q) |
template<std::size_t N, std::size_t U> | |
constexpr point< N > | center_of (simplex< point< N >, U > const &s) |
template<std::size_t N> | |
constexpr float | volume_of (simplex< point< N >, N > const &simplex) |
template<typename Item , std::size_t N> | |
constexpr bool | operator< (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
template<typename Item , std::size_t N> | |
constexpr bool | operator> (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
template<typename Item , std::size_t N> | |
constexpr bool | operator<= (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
template<typename Item , std::size_t N> | |
constexpr bool | operator>= (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
template<typename Item , std::size_t N> | |
constexpr bool | operator== (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
template<typename Item , std::size_t N> | |
constexpr bool | operator!= (simplex< Item, N > const &lh, simplex< Item, N > const &rh) |
point< 3 > | get_triangle_sphere_center (triangle< 3 > const &tri) |
constexpr vector< 3 > | normal_of (triangle< 3 > const &tri) |
constexpr triangle< 3 > | transform (triangle< 3 > const &t, pose const &transformation) |
template<std::size_t N> | |
constexpr triangle< N > | scale (triangle< N > const &t, point< N > const &scales) |
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >> | |
constexpr Derived | operator* (vec_point_base< Derived, N > const &a, T s) |
Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More... | |
template<typename Derived , std::size_t N, typename T > | |
constexpr Derived | operator* (T s, vec_point_base< Derived, N > const &a) |
Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More... | |
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >> | |
constexpr Derived | operator/ (vec_point_base< Derived, N > const &a, T s) |
Divides each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More... | |
template<typename Derived , std::size_t N> | |
constexpr float | dot (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b) |
Calculates the dot product between A and B. More... | |
template<typename Derived , std::size_t N> | |
constexpr auto | length2_of (vec_point_base< Derived, N > const &a) |
Returns squared distance of A from [0,0,0], this is a squared length of vector represented by A. More... | |
template<typename Derived , std::size_t N> | |
constexpr float | length_of (vec_point_base< Derived, N > const &a) |
Returns distance of A from [0,0,0], this is a length of vector represented by A. More... | |
template<typename Derived , std::size_t N> | |
constexpr Derived | normalized (vec_point_base< Derived, N > const &a) |
Calculates normalized version of A, this means that length(A) equals to 1. More... | |
template<typename Derived , std::size_t N> | |
constexpr Derived | abs (vec_point_base< Derived, N > const &a) |
Creates absolute version of A - removing signs on all dimensions. More... | |
template<typename Derived , std::size_t N> | |
constexpr Derived | max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b) |
template<typename Derived , std::size_t N> | |
constexpr Derived const & | min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b) |
template<typename Derived , std::size_t N> | |
constexpr Derived | dimensional_max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b) |
Calculates a C, where C[i] = max(A[i], B[i]) holds for 0 <= i < N. More... | |
template<typename Derived , std::size_t N> | |
constexpr Derived | dimensional_min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b) |
Calculates a C, where C[i] = min(A[i], B[i]) holds for 0 <= i < N. More... | |
template<typename Container , typename UnaryFunction = std::identity, typename Derived = std::decay_t< mapped_t< Container, UnaryFunction > >> | |
constexpr min_max< Derived > | dimensional_min_max_elem (Container const &cont, UnaryFunction &&f=std::identity{}) |
template<typename Derived , std::size_t N> | |
constexpr Derived | lin_interp (vec_point_base< Derived, N > const &from, vec_point_base< Derived, N > const &goal, float factor) |
template<std::size_t N> | |
constexpr vector< N > | operator+ (vector< N > lh, vector< N > const &rh) |
constexpr vector< 3 > | cross_product (vector< 3 > const &a, vector< 3 > const &b) |
Calculates cross product between points A and B. More... | |
constexpr vector< 2 > | normal_of (vector< 2 > const &a) |
Returns a normal to a point A in two dimensions. More... | |
template<std::size_t N> | |
constexpr float | vector_angle (vector< N > const &a, vector< N > const &b) |
template<matrix_like LH, matrix_like RH> | |
requires (LH::rows==RH::rows &&LH::cols==RH::cols) const expr auto operator | |
template<matrix_like M> | |
requires (M::rows==2 &&M::cols==2) const expr auto determinant(M const &m) | |
template<matrix_like M> | |
requires (M::rows > 2 &&M::cols==M::rows) const expr auto determinant(M const &m) | |
template<matrix_like M> | |
requires (M::rows==1 &&M::cols==1) const expr matrix< M | |
template<std::size_t N> | |
std::ostream & | operator<< (std::ostream &os, string_buffer< N > const &sb) |
template<typename... Callables> | |
matcher (Callables &&...) -> matcher< std::decay_t< Callables >... > | |
template<typename Variant , typename... Callables> | |
decltype(auto) | match (Variant &&var, Callables &&... cals) |
template<typename Variant , typename... Callables> | |
decltype(auto) | apply_on_match (Variant &&var, Callables &&... cals) |
template<typename T , typename Compare > | |
constexpr T const & | clamp (T const &x, min_max< T > const &mm, Compare &&comp) |
template<typename T > | |
constexpr T const & | clamp (T const &x, min_max< T > const &mm) |
template<typename T , typename... Args> | |
requires (std::same_as< Args, min_max< T > > &&...) const expr min_max< T > intersection(min_max< T > const &head | |
f (args) | |
template<typename T > | |
constexpr min_max< T > | expand (min_max< T > const &mm, T const &val) |
template<typename T > | |
constexpr bool | contains (min_max< T > const &mm, T const &val) |
template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1> | |
constexpr auto | operator* (physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 > lh, physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 > rh) |
Multiplication of physical_quantity multiplies the internal values and the result is a type, where the exponents of each side of the multiplication are added together. More... | |
template<int Len0, int Mass0, int Time0, int Current0, int Temp0, int Mol0, int Li0, int Angle0, int Byte0, int Len1, int Mass1, int Time1, int Current1, int Temp1, int Mol1, int Li1, int Angle1, int Byte1> | |
constexpr auto | operator/ (physical_quantity< Len0, Mass0, Time0, Current0, Temp0, Mol0, Li0, Angle0, Byte0 > lh, physical_quantity< Len1, Mass1, Time1, Current1, Temp1, Mol1, Li1, Angle1, Byte1 > rh) |
Divison of physical_quantiy divides the internal values and the result is a type, where the exponents of each side of the multiplication are subtracted. More... | |
template<int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte> | |
constexpr auto | sqrt (physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte > val) |
Square root of physical quantity is square root of it's value and the exponents are divided in half. More... | |
template<int Power, int Len, int Mass, int Time, int Current, int Temp, int Mol, int Li, int Angle, int Byte> | |
constexpr auto | pow (physical_quantity< Len, Mass, Time, Current, Temp, Mol, Li, Angle, Byte > val) |
Power of physical quantity is power of root of it's value and the exponents are multiplied by the value. More... | |
template<typename TimeType > | |
void | update_limits (pid< TimeType > &pid, min_max< float > lim) |
template<typename TimeType > | |
void | update_output (pid< TimeType > &pid, float output) |
template<typename TimeType > | |
float | update (pid< TimeType > &pid, TimeType now, float measured, float desired) |
Call this reularly, the meaning of time value 'now' is up to you, just be consistent. More... | |
template<typename TimeType > | |
void | reset (pid< TimeType > &pid, TimeType now, float last_measured) |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator+ (quantity< Derived, ValueType > lhs, quantity< Derived, ValueType > const rhs) |
Sum of quantities with same Derived and value_type. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator- (quantity< Derived, ValueType > lhs, quantity< Derived, ValueType > const rhs) |
Subtraction of quantities with same Derived and value_type. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator- (quantity< Derived, ValueType > const val) |
Provides negation of the quantity. More... | |
template<typename Derived , typename ValueType , arithmetic_like RhValueType> | |
constexpr bool | operator< (quantity< Derived, ValueType > const lhs, RhValueType const rhs) |
Provides abillity to compare quantity with non-quantity arithmetic value. More... | |
template<typename Derived , typename ValueType , arithmetic_like LhValueType> | |
constexpr bool | operator< (LhValueType const lhs, quantity< Derived, ValueType > const rhs) |
Provides abillity to compare quantity with non-quantity arithmetic value. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator* (quantity< Derived, ValueType > q, arithmetic auto const val) |
Multiplication of quantity by it's value_type. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator/ (quantity< Derived, ValueType > q, arithmetic auto const val) |
Division of quantity by it's value_type. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | abs (quantity< Derived, ValueType > const q) |
Quantity with absolute value of internal value. More... | |
template<typename Derived , typename ValueType > | |
constexpr auto | cos (quantity< Derived, ValueType > const u) |
Returns cosinus of the quantity as scalar. More... | |
template<typename Derived , typename ValueType > | |
constexpr auto | sin (quantity< Derived, ValueType > const u) |
Returns sinus of the quantity as scalar. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | max (quantity< Derived, ValueType > const lh, quantity< Derived, ValueType > const rh) |
Quantity with maximum value of one of the quantities. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | min (quantity< Derived, ValueType > const lh, quantity< Derived, ValueType > const rh) |
Quantity with minimum value of one of the quantities. More... | |
template<typename Derived , typename ValueType > | |
constexpr Derived | operator* (ValueType const val, quantity< Derived, ValueType > const q) |
Multiplication of value_type by quantity returns quantity. More... | |
template<typename Derived , typename ValueType > | |
constexpr ValueType | operator/ (ValueType const val, quantity< Derived, ValueType > const q) |
Division of value_type by quantity returns quantity. More... | |
template<typename Numeric > | |
constexpr view< iterators::numeric_iterator< Numeric > > | range (Numeric from, Numeric to) |
Builds numeric view over interval [from, to) More... | |
template<typename Numeric > | |
constexpr view< iterators::numeric_iterator< Numeric > > | range (Numeric to) |
Builds numeric view over interval [0, to) More... | |
template<typename T , std::size_t N> | |
auto | operator<=> (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh) |
template<typename T , std::size_t N> | |
bool | operator== (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh) |
template<typename T , std::size_t N> | |
bool | operator!= (static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh) |
template<typename T , std::size_t N> | |
requires (trivial_for_static_storage< T >) struct static_storage< T | |
constexpr pointer | data () noexcept |
Returns pointer to first item of the storage. More... | |
template<typename... Args> | |
constexpr T & | emplace_item (size_type const i, Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args... >) |
Constructs an item at position i with arguments args... More... | |
constexpr void | delete_item (size_type const i) noexcept(std::is_nothrow_destructible_v< T >) |
Deconstructs an item at position i. More... | |
constexpr reference | operator[] (size_type const i) noexcept |
Provides a reference to item at position i. More... | |
template<typename T , std::size_t N> | |
auto | operator<=> (static_vector< T, N > const &lh, static_vector< T, N > const &rh) |
template<typename T , std::size_t N> | |
bool | operator== (static_vector< T, N > const &lh, static_vector< T, N > const &rh) |
template<typename T , std::size_t N> | |
bool | operator!= (static_vector< T, N > const &lh, static_vector< T, N > const &rh) |
template<typename T , std::size_t N> | |
void | swap (static_vector< T, N > const &lh, static_vector< T, N > const &rh) noexcept |
template<typename T > | |
auto | pretty_type_name () |
template<std::size_t N> | |
requires (sizeof(uint8_t)==N) struct select_utype< N > | |
template<std::size_t N> | |
requires (sizeof(uint16_t)==N) struct select_utype< N > | |
template<std::size_t N> | |
requires (sizeof(uint32_t)==N) struct select_utype< N > | |
template<std::size_t N> | |
requires (sizeof(uint64_t)==N) struct select_utype< N > | |
template<typename IteratorLh , typename IteratorRh > | |
constexpr bool | operator== (view< IteratorLh > const &lh, view< IteratorRh > const &rh) |
template<typename IteratorLh , typename IteratorRh > | |
constexpr bool | operator!= (view< IteratorLh > const &lh, view< IteratorRh > const &rh) |
template<range_container Container> | |
view (Container &cont) -> view< iterator_of_t< Container > > | |
The container deduction guide uses iterator_of_t. More... | |
template<typename Iter > | |
constexpr view< Iter > | view_n (Iter begin, std::size_t const n) |
Creates view over 'n' items of dataset starting at 'begin' This does not check validity of the range! More... | |
template<data_container Container> | |
constexpr auto | data_view (Container &cont) |
template<range_container Container> | |
constexpr view< iterator_of_t< Container > > | trim_view (Container &cont, float const r) |
Creates the view over over Container, where we ignore first r*size/2 items and last r*size/2 items. More... | |
constexpr auto | reversed (referenceable_container auto &container) -> view< decltype(std::rbegin(container)) > |
Returns view to the Container in reverse order. More... | |
template<typename Iterator , typename EndIterator > | |
void | string_serialize_view (auto &&w, view< Iterator, EndIterator > const &output) |
template<typename Visitor , typename Variant > | |
decltype(auto) | visit_index (Visitor &&vis, Variant const &var) |
template<typename Visitor , typename Variant > | |
decltype(auto) | visit (Visitor &&vis, Variant &&var) |
Reimplementation of std::visit . More... | |
template<typename Visitor , typename Variant > | |
decltype(auto) | apply_on_visit (Visitor &&vis, Variant &&var) |
Combines visit and std::apply into one step - provided variant is expanded with visit and apply is called on the present alternative, items from apply are passed to calle to visitor vis . More... | |
template<typename... Iterators> | |
constexpr zip_iterator< Iterators... > | operator+ (zip_iterator< Iterators... > lh, std::ptrdiff_t m) |
template<typename... Iterators> | |
constexpr bool | operator!= (zip_iterator< Iterators... > const &lh, zip_iterator< Iterators... > const &rh) |
template<range_container... Ts> | |
auto | zip (Ts &&... cont) |
Creates a view of zip iterators for specified containers. More... | |
template<typename TuplesTuple , std::size_t... ItemIndexes, std::size_t... TupleIndexes> | |
auto | tuple_zip_impl (TuplesTuple &&tpls, std::index_sequence< ItemIndexes... >, std::index_sequence< TupleIndexes... >) |
template<gettable_container Tuple, gettable_container... Tuples> | |
auto | zip (Tuple &&frst, Tuples &&... tpls) |
Zips a set of gettable containers of same size into a tuples. More... | |
Variables | |
constexpr float | default_epsilon = 1.19e-07f |
UnaryCallable && | f |
T | res {} |
template<std::size_t N> | |
constexpr auto | bounded_constant = bounded< std::size_t, N, N >{} |
Simple type alias for bounded index constants. More... | |
template<typename T > | |
concept | bounded_derived = requires( T val ) { detail::bounded_derived_test( val ); } |
Concept that matchestype deriving from bounded. More... | |
template<typename T > | |
concept | additive_operators |
template<typename T > | |
concept | multiplicative_operators |
template<typename T > | |
concept | arithmetic_operators = additive_operators< T > && multiplicative_operators< T > |
template<typename T > | |
concept | arithmetic_assignment |
template<typename T > | |
concept | arithmetic_like = arithmetic_operators< T > && arithmetic_assignment< T > |
template<typename T > | |
concept | arithmetic = std::integral< T > || std::floating_point< T > |
template<typename T > | |
concept | gettable_container |
template<typename T > | |
concept | range_container |
so, std::ranges::range is meh because it expects return of begin() being input_output_iterator, which has to be def.constructible More... | |
template<typename T > | |
concept | data_container |
template<typename T > | |
concept | container = range_container< T > || gettable_container< T > || data_container< T > |
template<typename T > | |
concept | referenceable_container |
template<typename T , typename ValueType > | |
concept | range_container_with |
template<typename T , typename Iterator > | |
concept | range_container_with_iter |
template<typename T , typename ValueType > | |
concept | data_container_with |
template<typename T , typename DataIterator > | |
concept | data_container_with_iter |
template<typename T > | |
concept | static_sized |
template<typename UnaryCallable , typename Container > | |
concept | container_invocable |
template<typename UnaryCallable , typename ReturnValue , typename... Args> | |
concept | invocable_returning |
template<typename T > | |
concept | ostreamlike |
template<typename T > | |
concept | ostreamable |
template<typename T , typename Variant > | |
concept | alternative_of |
Thanks for the solution goes to PJBoy@libera. More... | |
template<typename T , typename Tuple > | |
concept | element_of |
template<typename T > | |
concept | with_value_type = requires { typename T::value_type; } |
template<typename T , typename Signature > | |
concept | with_signature = std::same_as< typename signature_of< T >::signature, Signature > |
template<typename T > | |
concept | with_push_back |
template<typename T , typename U > | |
concept | some = std::same_as< std::remove_cv_t< T >, U > |
template<typename T > | |
concept | decomposable |
template<typename T > | |
concept | decomposable_0 = decomposable< T > && ( detail::decompose_count< T >() == 0 ) |
constexpr quaternion | neutral_quat { 0.f, 0.f, 0.f, 1.f } |
template<typename T > | |
concept | vec_point_derived = requires( T val ) { detail::vec_point_derived_test( val ); } |
constexpr vector< 3 > | x_axis { 1, 0, 0 } |
instances of constants in the code for X/Y/Z axis More... | |
constexpr vector< 3 > | y_axis { 0, 1, 0 } |
constexpr vector< 3 > | z_axis { 0, 0, 1 } |
template<typename M > | |
concept | matrix_like |
template<typename T > | |
concept | is_string_buffer_v = bits::is_string_buffer< T >::value |
template<typename Derived > | |
concept | nothrow_dereference |
template<typename Derived > | |
concept | nothrow_add_assign |
template<typename Derived > | |
concept | nothrow_sub_assign |
template<typename Derived > | |
concept | nothrow_threeway_compare |
template<typename Derived > | |
concept | nothrow_equality_compare |
Args const & | args |
constexpr angle | pi = angle{ 3.14159265358979323846f } |
Constants of units that are relevant for us. More... | |
template<typename T > | |
concept | quantity_derived = requires( T val ) { detail::quantity_derived_test( val ); } |
Concept satisfies any type T that inherits from any form of quantity<U> . More... | |
template<typename T > | |
concept | trivial_for_static_storage |
N | |
template<typename T > | |
constexpr bool | is_view_v = is_view< T >::value |
template<typename... Ts> | |
constexpr bool | are_same_v = are_same< Ts... >::value |
template<typename T , typename... Us> | |
constexpr bool | tuple_has_type_v = tuple_has_type< T, Us... >::value |
template<typename T > | |
constexpr bool | is_std_tuple_v = is_std_tuple< T >::value |
template<typename T > | |
constexpr bool | is_std_array_v = is_std_array< T >::value |
template<typename T > | |
constexpr bool | is_std_vector_v = is_std_vector< T >::value |
template<typename T > | |
constexpr std::size_t | static_size_v = static_size< T >::value |
Marked deprecated on 19.4.2021. More... | |
template<typename T > | |
constexpr bool | has_static_size_v = static_sized< T > |
UnaryCallable | |
MIT License.
Copyright (c) 2025 Jan Veverak Koniarik
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
class emlabcpp::function_view |
struct emlabcpp::pose_distance |
struct emlabcpp::generic_iterator |
generic_iterator simplifies custom iterator implementation using CRTP.
Users inherit from generic_iterator and pass their class as the Derived template argument. It relies on std::iterator_traits<Derived> for type definitions and provides additional methods based on those implemented in the Derived class.
struct emlabcpp::pid_config |
Structure to configure the pid regulator.
Class Members | ||
---|---|---|
pid_coefficients | coefficients | |
min_max< float > | limits | limits the output of the pid regulator and internal anti-windup mechanism |
class emlabcpp::static_function_base |
struct emlabcpp::iterator_of |
iterator_of is structure where iterator_of<Container>::type returns type of iterator that is returned by cont.begin();
Class Members | ||
---|---|---|
typedef decltype(begin(declval< add_lvalue_reference_t< Container > >())) | type |
struct emlabcpp::data_iterator_of |
data_iterator_of is structure where data_iterator_of<Container>::type returns type of pointer that is returned by cont.data();
Class Members | ||
---|---|---|
typedef decltype(data(declval< add_lvalue_reference_t< Container > >())) | type |
struct emlabcpp::are_same |
are_same<Ts..>::value is true if all Ts... are equal types.
struct emlabcpp::tuple_has_type |
tuple_has_type<T, Tuple>::value is true if Tuple s std::tuple and contains type T
struct emlabcpp::signature_of |
struct emlabcpp::signature_of< ReturnType(Args...) > |
struct emlabcpp::mapped |
mapped<T,F>::type is type returned by instance of F::operator() when applied on items from instance of T. It can differentiate between tuples or containers
struct emlabcpp::select_utype |
struct emlabcpp::type_map |
struct emlabcpp::type_map< std::tuple< Ts... >, Fun > |
struct emlabcpp::type_tag |
struct emlabcpp::index_of |
using emlabcpp::acceleration = typedef physical_quantity< 1, 0, -2, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::amount_of_substance = typedef physical_quantity< 0, 0, 0, 0, 0, 1, 0, 0, 0 > |
using emlabcpp::angle = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 1, 0 > |
using emlabcpp::angular_velocity = typedef physical_quantity< 0, 0, -1, 0, 0, 0, 0, 1, 0 > |
using emlabcpp::area = typedef physical_quantity< 2, 0, 0, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::byte = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 1 > |
using emlabcpp::const_pointer = typedef T const* |
using emlabcpp::const_reference = typedef T const& |
using emlabcpp::current = typedef physical_quantity< 0, 0, 0, 1, 0, 0, 0, 0, 0 > |
using emlabcpp::data_iterator_of_t = typedef typename data_iterator_of< Container >::type |
using emlabcpp::distance = typedef length |
using emlabcpp::force = typedef physical_quantity< 1, 1, -2, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::frequency = typedef physical_quantity< 0, 0, -1, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::index_of_v = typedef index_of< T, Variant >::value |
using emlabcpp::iterator_of_t = typedef typename iterator_of< Container >::type |
using emlabcpp::length = typedef physical_quantity< 1, 0, 0, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::line = typedef std::array< point< N >, 2 > |
using emlabcpp::luminous_intensity = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 1, 0, 0 > |
using emlabcpp::mapped_t = typedef typename mapped< Container, UnaryCallable >::type |
using emlabcpp::mass = typedef physical_quantity< 0, 1, 0, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::pointer = typedef T* |
using emlabcpp::power = typedef physical_quantity< 2, 1, -3, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::radius = typedef length |
using emlabcpp::reference = typedef T& |
using emlabcpp::resistance = typedef physical_quantity< 2, 1, -3, -2, 0, 0, 0, 0, 0 > |
using emlabcpp::select_utype_t = typedef typename select_utype< N >::type |
using emlabcpp::size_type = typedef std::size_t |
using emlabcpp::static_function = typedef static_function_base< Signature, Capacity, alignof( void* ) > |
using emlabcpp::temp = typedef physical_quantity< 0, 0, 0, 0, 1, 0, 0, 0, 0 > |
using emlabcpp::timeq = typedef physical_quantity< 0, 0, 1, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::triangle = typedef simplex< point< N >, 2 > |
using emlabcpp::type_map_t = typedef typename type_map< T, Fun >::type |
using emlabcpp::unitless = typedef physical_quantity< 0, 0, 0, 0, 0, 0, 0, 0, 0 > |
Type alieases of physical quantity for used quantities.
using emlabcpp::value_type = typedef T |
using emlabcpp::velocity = typedef physical_quantity< 1, 0, -1, 0, 0, 0, 0, 0, 0 > |
using emlabcpp::voltage = typedef physical_quantity< 2, 1, -3, -1, 0, 0, 0, 0, 0 > |
using emlabcpp::volume = typedef physical_quantity< 3, 0, 0, 0, 0, 0, 0, 0, 0 > |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
constexpr |
Quantity with absolute value of internal value.
|
constexpr |
|
constexpr |
Applies callable 'f(init,x)' to each element of container 'x' and actual value of 'init' in iteration, returns a result of last application.
NOLINT(bugprone-use-after-move)
References f, for_each(), and init().
|
constexpr |
|
constexpr |
References all_of(), and almost_equal().
|
constexpr |
Two items 'lh' and 'rh' are almost equal if their difference is smaller than value 'eps'.
References abs().
|
constexpr |
References dot(), norm2_of(), and sqrt().
|
constexpr |
decltype( auto ) emlabcpp::apply_on_match | ( | Variant && | var, |
Callables &&... | cals | ||
) |
References apply_on_visit().
decltype( auto ) emlabcpp::apply_on_visit | ( | Visitor && | vis, |
Variant && | var | ||
) |
Combines visit
and std::apply
into one step - provided variant is expanded with visit
and apply
is called on the present alternative, items from apply
are passed to calle to visitor vis
.
References visit().
|
constexpr |
Applies callable 'f(x)' to each element of container 'cont' and returns the average value of each call.
References cont_size(), f, for_each(), and res.
|
constexpr |
Function to calculate distance of projection of point A.
That point is projected on axis defined only by it's direction - 'axis_direction'. The distance of that projection from the [0,0,0] coordinate is returned.
References dot(), and vector_cast().
|
constexpr |
Conveft the provided arguments into array of std::byte.
References args.
|
constexpr |
takes an value val
and rounds it up to nearest multiply of base
|
constexpr |
References avg(), point_cast(), sum(), and vector_cast().
|
constexpr |
References clamp().
|
constexpr |
References emlabcpp::min_max< T >::max(), and emlabcpp::min_max< T >::min().
view< decode_cobs_iter< Iter >, decode_cobs_iter< Iter > > emlabcpp::cobs_decode_view | ( | view< Iter > | data | ) |
|
constexpr |
References args.
|
constexprnoexcept |
Returns the size of the container, regardless of what it is.
|
constexpr |
Checks if container cont
contains at least one occurence of item
, returns true/false.
References cont_size(), and find().
|
constexpr |
References emlabcpp::min_max< T >::max(), and emlabcpp::min_max< T >::min().
view< iterators::convert_iterator< T, Iterator > > emlabcpp::convert_view | ( | Container && | cont | ) |
|
constexpr |
References view_n().
void emlabcpp::copy | ( | Container && | cont, |
Iterator | iter | ||
) |
References for_each().
|
constexpr |
Returns cosinus of the quantity as scalar.
|
constexpr |
Applies the predicate 'f(x)' to each element of container 'cont' and returns the count of items, for which f(x) returned 'true'.
References f, for_each(), and res.
|
constexpr |
Calculates cross product between points A and B.
|
constexprnoexcept |
Returns pointer to first item of the storage.
|
constexpr |
|
inline |
Decodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer.
Note that this does not expect 0 at the end.
References emlabcpp::view< Iterator, EndIterator >::begin(), emlabcpp::view< Iterator, EndIterator >::end(), emlabcpp::view< Iterator, EndIterator >::front(), emlabcpp::cobs_decoder::iter(), and tail().
|
constexpr |
|
constexprnoexcept |
Deconstructs an item at position i.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
References clamp(), dot(), and length2_of().
|
constexpr |
References distance_of().
|
constexpr |
returns PoseDistance between provided poses
References angle_shortest_path(), distance_of(), emlabcpp::pose::orientation, and emlabcpp::pose::position.
|
constexpr |
|
constexpr |
emlabcpp::EMLABCPP_GENERATE_DECOMPOSE | ( | 16 | , |
a0 | , | ||
a1 | , | ||
a2 | , | ||
a3 | , | ||
a4 | , | ||
a5 | , | ||
a6 | , | ||
a7 | , | ||
a8 | , | ||
a9 | , | ||
a10 | , | ||
a11 | , | ||
a12 | , | ||
a13 | , | ||
a14 | , | ||
a15 | |||
) |
|
constexprnoexcept |
Constructs an item at position i with arguments args...
References args.
|
inline |
Encodes data from source range into target buffer with Consistent Overhead Byte Stuffing (COBS) encoding, returns bool indicating whenever conversion succeeded and subview used for conversion from target buffer.
Note that this does not store 0 at the end.
References emlabcpp::cobs_encoder::insert().
auto emlabcpp::enumerate | ( | Container && | cont | ) |
|
constexpr |
Returns true if containers 'lh' and 'rh' has same size and calls to predicate f
- f(lh[i],rh[i])
return true for each item.
Default callable is equality. all 0 <= i < size()
|
constexpr |
References emlabcpp::min_max< T >::max(), and emlabcpp::min_max< T >::min().
emlabcpp::f | ( | args | ) |
|
constexpr |
|
constexpr |
Finds first item in container 'cont' that is equal to 'item', returns iterator for container, or index for tuples.
References find_if().
|
constexpr |
Returns iterator for first item, for which call to predicate f(*iter) holds true.
end() iterator is returned otherwise. The end() iterator is taken once, before the container is iterated.
References f.
|
constexpr |
|
constexpr |
Applies binary callable 'f(x,y)' to each combination of items x
from lh_cont
and y
from rh_cont
References f, and for_each().
|
constexpr |
Applies unary callable 'f' to each element of container 'cont'.
References f.
|
constexpr |
References cross_product(), normalized(), point_cast(), and vector_cast().
|
constexpr |
Returns range over Container, which skips last item of container.
References emlabcpp::pose::orientation, and emlabcpp::pose::position.
|
constexpr |
|
constexpr |
References inverse(), and transform().
|
constexpr |
|
constexpr |
|
constexpr |
Returns distance of A from [0,0,0], this is a length of vector represented by A.
References length2_of(), and sqrt().
|
constexpr |
linear interpolation between base se and goal pose, with factor 0 'base' is returned, with factor 1 'goal' is returned.
With factor 0.5, pose between 'base' and 'goal' pose is returned
References emlabcpp::pose::orientation, emlabcpp::pose::position, and slerp().
|
constexpr |
|
inline |
References distance_of(), lin_interp(), range(), and res.
|
inline |
References distance_of(), lin_interp(), range(), res, and steps().
ResultContainer emlabcpp::map_f | ( | Container && | cont, |
UnaryCallable && | f = std::identity() |
||
) |
Calls callable f(x)
for each item in container 'cont' (or tuple) and stores result in 'ResultContainer', which is returned.
The behavior depends on what kind of 'ResultContainer' is used, rules are in this order:
res[i] = f(cont[i])
is used for i = 0...Npush_back(x)
method, that is used to insert result of calls to f(x)
insert(x)
method is used to insert result of calls to f(x)
References f, for_each(), and res.
std::array< T, N > emlabcpp::map_f_to_a | ( | Container && | cont, |
UnaryCallable && | f = std::identity() |
||
) |
Calls callable f(cont[i])
for i = 0...N and stores the result in array of an size N.
Calls callable f(cont[i]) for i = 0...N and stores the result in array of an appropiate size.
The function requires size 'N' as template parameter
THe size N
is infered from container.
References f.
|
constexpr |
maps input value 'input' from input range to equivalent value in output range
decltype( auto ) emlabcpp::match | ( | Variant && | var, |
Callables &&... | cals | ||
) |
References visit().
emlabcpp::matcher | ( | Callables && | ... | ) | -> matcher< std::decay_t< Callables >... > |
|
constexpr |
Quantity with maximum value of one of the quantities.
|
constexpr |
|
constexpr |
Applies unary callable 'f(x)' to each element of container 'cont', returns the largest return value of 'f(x)' calls.
Returns lowest value of the return type if container is empty.
References f, for_each(), std::numeric_limits< T >::lowest(), and max().
|
constexpr |
Expects multiple std::arrays on input, and merges all together into one std::array instance.
References f.
|
constexpr |
Quantity with minimum value of one of the quantities.
|
constexpr |
|
constexpr |
Applies unary callable 'f(x) to each element of container 'cont‘, returns the smallest return value of 'f(x)’ calls.
Returns maximum value of the return type if container is empty.
References f, for_each(), max(), and min().
|
constexpr |
Applies unary callable 'f(x)' to each element of container 'cont', returns the largest and the smallest return value.
of 'f(x)' calls. Returns the default value of the 'f(x)' return type if container is empty.
References f, for_each(), std::numeric_limits< T >::lowest(), max(), min(), and res.
|
constexpr |
|
constexpr |
References dot().
References cross_product().
Returns a normal to a point A in two dimensions.
|
constexpr |
Calculates normalized version of A, this means that length(A) equals to 1.
References length_of().
negation of operator== between poses
|
constexpr |
|
constexpr |
bool emlabcpp::operator!= | ( | static_circular_buffer< T, N > const & | lh, |
static_circular_buffer< T, N > const & | rh | ||
) |
bool emlabcpp::operator!= | ( | static_vector< T, N > const & | lh, |
static_vector< T, N > const & | rh | ||
) |
|
constexpr |
|
constexpr |
|
constexpr |
Multiplication of physical_quantity multiplies the internal values and the result is a type, where the exponents of each side of the multiplication are added together.
|
constexpr |
|
constexpr |
Multiplication of quantity by it's value_type.
|
constexpr |
|
constexpr |
|
constexpr |
Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic.
|
constexpr |
Multiplication of value_type by quantity returns quantity.
|
constexpr |
|
constexpr |
Returns a result of addition a to b, viz += operator.
|
constexpr |
Sum of quantities with same Derived and value_type.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Returns a result of subtraction of A from B, viz -= operator.
References vector_cast().
|
constexpr |
Returns a result of subtraction a to b, viz += operator.
|
constexpr |
Provides negation of the quantity.
|
constexpr |
Subtraction of quantities with same Derived and value_type.
|
constexpr |
|
constexpr |
Divison of physical_quantiy divides the internal values and the result is a type, where the exponents of each side of the multiplication are subtracted.
|
constexpr |
Division of quantity by it's value_type.
|
constexpr |
Division of value_type by quantity returns quantity.
|
constexpr |
|
constexpr |
Provides abillity to compare quantity with non-quantity arithmetic value.
References emlabcpp::pose::orientation, and emlabcpp::pose::position.
|
constexpr |
Provides abillity to compare quantity with non-quantity arithmetic value.
|
constexpr |
std::ostream& emlabcpp::operator<< | ( | std::ostream & | os, |
string_buffer< N > const & | sb | ||
) |
|
constexpr |
auto emlabcpp::operator<=> | ( | static_circular_buffer< T, N > const & | lh, |
static_circular_buffer< T, N > const & | rh | ||
) |
auto emlabcpp::operator<=> | ( | static_vector< T, N > const & | lh, |
static_vector< T, N > const & | rh | ||
) |
compares poses on their position and orientation
References emlabcpp::pose::orientation, and emlabcpp::pose::position.
|
constexpr |
|
constexpr |
References equal().
bool emlabcpp::operator== | ( | static_circular_buffer< T, N > const & | lh, |
static_circular_buffer< T, N > const & | rh | ||
) |
bool emlabcpp::operator== | ( | static_vector< T, N > const & | lh, |
static_vector< T, N > const & | rh | ||
) |
|
constexpr |
|
constexpr |
|
constexprnoexcept |
Provides a reference to item at position i.
|
constexpr |
References vector_angle(), and vector_cast().
|
constexpr |
|
constexpr |
Power of physical quantity is power of root of it's value and the exponents are multiplied by the value.
auto emlabcpp::pretty_type_name | ( | ) |
|
constexpr |
Builds numeric view over interval [from, to)
|
constexpr |
Builds numeric view over interval [0, to)
emlabcpp::requires | ( | !range_container< Container > | ) | const |
Returns index of an element in tuple 't', for which call to predicate f(x) holds true, otherwise returns index of 'past the end' item - size of the tuple.
References f, and emlabcpp::impl::find_if_impl().
emlabcpp::requires | ( | !range_container< Container > | ) | const && |
Applies unary callable 'f' to each element of container 'cont'.
emlabcpp::requires | ( | !requires(Callable f) { { f.template operator()< 0 >() } -> std::same_as< void >;} | ) | const |
requires emlabcpp::requires | ( | Callable | f | ) |
References f.
emlabcpp::requires | ( | LH::rows | = =RH::rows &&LH::cols==RH::cols | ) | const |
References range().
emlabcpp::requires | ( | M::rows | , |
2 &&M::cols | = = M::rows |
||
) | const & |
emlabcpp::requires | ( | M::rows | = = 1 && M::cols == 1 | ) | const |
References res.
emlabcpp::requires | ( | M::rows | = = 2 && M::cols == 2 | ) | const & |
emlabcpp::requires | ( | sizeof(uint16_t) | = = N | ) |
emlabcpp::requires | ( | sizeof(uint32_t) | = = N | ) |
emlabcpp::requires | ( | sizeof(uint64_t) | = = N | ) |
emlabcpp::requires | ( | sizeof(uint8_t) | = = N | ) |
emlabcpp::requires | ( | std::is_enum_v< Enum > | ) |
Returns a string-like name of the enum value val
emlabcpp::requires | ( | std::same_as< Args, min_max< T > > && | ... | ) | const & |
emlabcpp::requires | ( | trivial_for_static_storage< T > | ) |
void emlabcpp::reset | ( | pid< TimeType > & | pid, |
TimeType | now, | ||
float | last_measured | ||
) |
|
constexpr |
Returns view to the Container in reverse order.
References container.
|
constexpr |
References inverse().
|
constexpr |
Pose X is rotated based on quaternion 'quad'.
References emlabcpp::pose::orientation, and emlabcpp::pose::position.
|
constexpr |
References inverse().
|
constexpr |
References point_cast(), rotate(), and vector_cast().
|
constexpr |
emlabcpp::select_index | ( | i | , |
[&res, &f] < std::size_t i >() { res=f.template operator()< i >();} | |||
) |
|
constexpr |
References f.
|
constexpr |
References cross_product(), default_epsilon, dot(), normalized(), sqrt(), and vector_cast().
|
constexpr |
returns sign of variable T: -1,0,1
|
constexpr |
Returns sinus of the quantity as scalar.
|
constexpr |
References angle_shortest_path(), dot(), f, and sin().
|
constexpr |
Square root of physical quantity is square root of it's value and the exponents are divided in half.
|
constexpr |
returns steps necessary for linear interpolation of distance between poses 'dis', such that:
References emlabcpp::pose_distance::angle_dist, emlabcpp::pose_distance::dist, and max().
void emlabcpp::string_serialize_view | ( | auto && | w, |
view< Iterator, EndIterator > const & | output | ||
) |
|
constexpr |
Applies f(x) to each item of container 'cont', returns the sum of all the return values of each call to 'f(x)' and 'init' item.
|
noexcept |
|
constexpr |
Returns range over Container, which skips first item of container.
References emlabcpp::cfg::next().
|
constexpr |
References emlabcpp::min_max< T >::max(), emlabcpp::min_max< T >::min(), and transform().
|
constexpr |
Point A is rotated based on 'transformation' orientation and than moved based on 'transformation' position.
References emlabcpp::pose::orientation, emlabcpp::pose::position, rotate(), and vector_cast().
Pose X is rotated based on 'transformation' orientation and than moved based on 'transformation' position.
References emlabcpp::pose::orientation, emlabcpp::pose::position, and transform().
|
constexpr |
References transform().
|
constexpr |
References emlabcpp::pose::orientation, emlabcpp::pose::position, rotate(), and vector_cast().
|
constexpr |
Creates the view over over Container, where we ignore first r*size/2 items and last r*size/2 items.
This can be used to get the dataset without first/last 5% for example, by using r=0.1
auto emlabcpp::tuple_zip_impl | ( | TuplesTuple && | tpls, |
std::index_sequence< ItemIndexes... > | , | ||
std::index_sequence< TupleIndexes... > | |||
) |
References f.
|
constexpr |
float emlabcpp::update | ( | pid< TimeType > & | pid, |
TimeType | now, | ||
float | measured, | ||
float | desired | ||
) |
Call this reularly, the meaning of time value 'now' is up to you, just be consistent.
Algorithm changes it's internal value output to the value that should be set to a 'thing' that controls measured_ value. It tries to control the 'thing' so the measured eventually converges to 'desired' value
improvements from naive PID:
References emlabcpp::pid< TimeType >::cfg, clamp(), emlabcpp::pid_config::coefficients, emlabcpp::pid_coefficients::d, emlabcpp::pid_coefficients::i, emlabcpp::pid< TimeType >::i_sum, emlabcpp::pid< TimeType >::last_measured, emlabcpp::pid< TimeType >::last_time, emlabcpp::pid_config::limits, emlabcpp::pid< TimeType >::output, and emlabcpp::pid_coefficients::p.
void emlabcpp::update_output | ( | pid< TimeType > & | pid, |
float | output | ||
) |
|
constexpr |
Applies callable 'f(x)' to each element of container 'cont' and returns the variance of values returned from the call.
The f
is applied twice to each element.
References avg(), cont_size(), f, res, and sum().
|
constexpr |
References dot(), length2_of(), and sqrt().
|
constexpr |
emlabcpp::view | ( | Container & | cont | ) | -> view< iterator_of_t< Container > > |
The container deduction guide uses iterator_of_t.
|
constexpr |
Creates view over 'n' items of dataset starting at 'begin' This does not check validity of the range!
References emlabcpp::cfg::next().
decltype( auto ) emlabcpp::visit | ( | Visitor && | vis, |
Variant && | var | ||
) |
Reimplementation of std::visit
.
This one trades worse complexity (linear) in favor of less assembly generated.
References visit_index().
decltype( auto ) emlabcpp::visit_index | ( | Visitor && | vis, |
Variant const & | var | ||
) |
|
constexpr |
References abs(), copy(), N, range(), and emlabcpp::simplex< Item, N >::size().
auto emlabcpp::zip | ( | Ts &&... | cont | ) |
Creates a view of zip iterators for specified containers.
Beware that the function does not check that containers have same size of ranges. If the size differs, increments of begin iterator will never equal to the end iterator.
References view().
auto emlabcpp::zip | ( | Tuple && | frst, |
Tuples &&... | tpls | ||
) |
Zips a set of gettable containers of same size into a tuples.
zip(tuple<A,B>(), tuple<C,D>()) -> tuple<tuple<A,C>, <tuple<B,d>>;
References tuple_zip_impl().
concept emlabcpp::additive_operators |
arithmetic related concepts
concept emlabcpp::alternative_of |
Thanks for the solution goes to PJBoy@libera.
|
constexpr |
Args const& emlabcpp::args |
concept emlabcpp::arithmetic = std::integral< T > || std::floating_point< T > |
concept emlabcpp::arithmetic_assignment |
concept emlabcpp::arithmetic_like = arithmetic_operators< T > && arithmetic_assignment< T > |
concept emlabcpp::arithmetic_operators = additive_operators< T > && multiplicative_operators< T > |
|
constexpr |
Simple type alias for bounded index constants.
concept emlabcpp::bounded_derived = requires( T val ) { detail::bounded_derived_test( val ); } |
Concept that matchestype deriving from bounded.
concept emlabcpp::container = range_container< T > || gettable_container< T > || data_container< T > |
concept emlabcpp::container_invocable |
concept emlabcpp::data_container |
concept emlabcpp::data_container_with |
concept emlabcpp::data_container_with_iter |
concept emlabcpp::decomposable |
concept emlabcpp::decomposable_0 = decomposable< T > && ( detail::decompose_count< T >() == 0 ) |
|
constexpr |
concept emlabcpp::element_of |
auto emlabcpp::f |
concept emlabcpp::gettable_container |
container related concepts
|
constexpr |
has_static_size<T>::value is true in case type T have size deduceable at compile time
concept emlabcpp::invocable_returning |
|
constexpr |
|
constexpr |
|
constexpr |
concept emlabcpp::is_string_buffer_v = bits::is_string_buffer< T >::value |
|
constexpr |
concept emlabcpp::matrix_like |
concept emlabcpp::multiplicative_operators |
emlabcpp::N |
|
constexpr |
concept emlabcpp::nothrow_add_assign |
concept emlabcpp::nothrow_dereference |
concept emlabcpp::nothrow_equality_compare |
concept emlabcpp::nothrow_sub_assign |
concept emlabcpp::nothrow_threeway_compare |
concept emlabcpp::ostreamable |
concept emlabcpp::ostreamlike |
Constants of units that are relevant for us.
concept emlabcpp::quantity_derived = requires( T val ) { detail::quantity_derived_test( val ); } |
Concept satisfies any type T
that inherits from any form of quantity<U>
.
concept emlabcpp::range_container |
so, std::ranges::range is meh because it expects return of begin() being input_output_iterator, which has to be def.constructible
concept emlabcpp::range_container_with |
concept emlabcpp::range_container_with_iter |
concept emlabcpp::referenceable_container |
return emlabcpp::res {} |
concept emlabcpp::some = std::same_as< std::remove_cv_t< T >, U > |
|
constexpr |
Marked deprecated on 19.4.2021.
concept emlabcpp::static_sized |
concept emlabcpp::trivial_for_static_storage |
|
constexpr |
emlabcpp::UnaryCallable |
concept emlabcpp::vec_point_derived = requires( T val ) { detail::vec_point_derived_test( val ); } |
concept emlabcpp::with_push_back |
concept emlabcpp::with_signature = std::same_as< typename signature_of< T >::signature, Signature > |
concept emlabcpp::with_value_type = requires { typename T::value_type; } |
|
constexpr |
instances of constants in the code for X/Y/Z axis
|
constexpr |
|
constexpr |