Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <type_traits> 7 : 8 : #include "ControlSystem/Protocols/Submeasurement.hpp" 9 : #include "Utilities/ProtocolHelpers.hpp" 10 : #include "Utilities/TMPL.hpp" 11 : 12 : namespace control_system::protocols { 13 : /*! 14 : * \brief Definition of a measurement for the control systems 15 : * 16 : * A class conforming to this protocol is referenced from each control 17 : * system to define measurements to be made. Multiple control systems 18 : * can share the same measurement. 19 : * 20 : * A conforming class must provide a `submeasurements` type alias to a 21 : * `tmpl::list` of structs conforming to the Submeasurement protocol. 22 : * 23 : * Here's an example for a class conforming to this protocol: 24 : * 25 : * \snippet Helpers/ControlSystem/Examples.hpp Measurement 26 : */ 27 1 : struct Measurement { 28 : template <typename ConformingType> 29 0 : struct test { 30 0 : using submeasurements = typename ConformingType::submeasurements; 31 : 32 : static_assert( 33 : tmpl::all<submeasurements, 34 : tt::assert_conforms_to<tmpl::_1, Submeasurement>>::value); 35 : }; 36 : }; 37 : } // namespace control_system::protocols