micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T > Struct Template Reference

Logical AND comparator struct template. More...

#include <micro-os-plus/micro-test-plus.h>

Inheritance diagram for micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >:

Public Member Functions

constexpr and_ (const Lhs_T &lhs={}, const Rhs_T &rhs={})
 Constructs a logical AND comparator for the given operands.
constexpr auto lhs (void) const
 Retrieves the left-hand operand.
constexpr operator bool () const
 Conversion operator to boolean.
constexpr auto rhs (void) const
 Retrieves the right-hand operand.

Public Attributes

const Lhs_T lhs_ {}
 Stores the left-hand operand.
const Rhs_T rhs_ {}
 Stores the right-hand operand.
const bool value_ {}
 Stores the result of the logical AND operation.

Detailed Description

template<class Lhs_T, class Rhs_T>
struct micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >
Template Parameters
Lhs_TThe type of the left-hand operand.
Rhs_TThe type of the right-hand operand.

The and_ struct template provides a type-safe mechanism for evaluating the logical conjunction (AND) of two operands within the framework.

This comparator supports a wide range of operand types, applying the generic getter to ensure correct value extraction for both custom and standard types. The result of the logical AND operation is stored in the value_ member for efficient access.

The implementation is optimised for use in embedded environments and supports both compile-time and run-time evaluation.

All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 1177 of file detail.h.

Constructor & Destructor Documentation

◆ and_()

template<class Lhs_T, class Rhs_T>
micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_ ( const Lhs_T & lhs = {},
const Rhs_T & rhs = {} )
inlineconstexpr
Parameters
lhsThe left-hand operand.
rhsThe right-hand operand.

Evaluates the logical conjunction of the provided operands at construction, supporting both custom and standard types. The result is stored in the value_ member for efficient access.

Definition at line 1190 of file detail.h.

1190 {}, const Rhs_T& rhs = {})
1191 : lhs_{ lhs }, rhs_{ rhs },
1193 {
1194 }
Logical AND comparator struct template.
Definition detail.h:1178
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Definition detail.h:1244
const bool value_
Stores the result of the logical AND operation.
Definition detail.h:1262
const Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:1257
constexpr auto lhs(void) const
Retrieves the left-hand operand.
Definition detail.h:1226
const Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:1252

References lhs().

Member Function Documentation

◆ lhs()

template<class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::lhs ( void ) const
inlinenodiscardconstexpr
Parameters
None.
Returns
The extracted left-hand operand.

Returns the value of the left-hand operand, applying the generic getter to ensure correct extraction for both custom and standard types.

Definition at line 1226 of file detail.h.

1227 {
1228 return get (lhs_);
1229 }
constexpr auto get(const T &t)
Generic getter function template for value retrieval.
Definition detail.h:223

References micro_os_plus::micro_test_plus::detail::get(), and lhs_.

Referenced by and_(), and micro_os_plus::micro_test_plus::test_reporter::operator<<().

◆ operator bool()

template<class Lhs_T, class Rhs_T>
micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::operator bool ( ) const
inlinenodiscardconstexpr
Parameters
None.
Return values
trueBoth operands evaluate to true.
falseAt least one operand evaluates to false.

Returns the result of the logical AND operation.

Definition at line 1208 of file detail.h.

1209 {
1210 return value_;
1211 }

References value_.

◆ rhs()

template<class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::rhs ( void ) const
inlinenodiscardconstexpr
Parameters
None.
Returns
The extracted right-hand operand.

Returns the value of the right-hand operand, applying the generic getter to ensure correct extraction for both custom and standard types.

Definition at line 1244 of file detail.h.

1245 {
1246 return get (rhs_);
1247 }

References micro_os_plus::micro_test_plus::detail::get(), and rhs_.

Referenced by micro_os_plus::micro_test_plus::test_reporter::operator<<().

Member Data Documentation

◆ lhs_

template<class Lhs_T, class Rhs_T>
const Lhs_T micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::lhs_ {}

Definition at line 1252 of file detail.h.

1252{};

Referenced by lhs().

◆ rhs_

template<class Lhs_T, class Rhs_T>
const Rhs_T micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::rhs_ {}

Definition at line 1257 of file detail.h.

1257{};

Referenced by rhs().

◆ value_

template<class Lhs_T, class Rhs_T>
const bool micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::value_ {}

Definition at line 1262 of file detail.h.

1262{};

Referenced by operator bool().


The documentation for this struct was generated from the following file: