65template <
typename Signature>
68template <
typename R,
typename... Args>
73 static constexpr fl::size argCount()
FL_NO_EXCEPT {
return sizeof...(Args); }
82 if (!jsonArgs.is_array()) {
83 result.setError(
"arguments must be a JSON array");
87 fl::size count = jsonArgs.size();
88 if (count !=
sizeof...(Args)) {
89 result.setError(
"argument count mismatch: expected " +
100 template <fl::size... Is>
101 static void convertArgs(
const json& jsonArgs, args_tuple& tuple,
104 int dummy[] = {0, (convertArg<Is>(jsonArgs, tuple,
result), 0)...};
108 template <fl::size I>
109 static void convertArg(
const json& jsonArgs, args_tuple& tuple, TypeConversionResult&
result)
FL_NO_EXCEPT {
110 if (
result.hasError())
return;
113 using StorageType =
typename fl::tuple_element<I, args_tuple>::type;
117 TypeConversionResult convResult =
fl::get<1>(convTuple);
122 for (fl::size i = 0; i < convResult.warnings().size(); i++) {
125 if (convResult.hasError()) {
145 if (!jsonArgs.is_array()) {
146 result.setError(
"arguments must be a JSON array");
150 if (jsonArgs.size() != 0) {
151 result.setError(
"argument count mismatch: expected 0, got " +
static constexpr fl::size argCount() FL_NO_EXCEPT
static fl::tuple< args_tuple, TypeConversionResult > convert(const json &jsonArgs) FL_NO_EXCEPT
FastLED's Elegant JSON Library: fl::json
tuple< typename fl::decay< Ts >::type... > make_tuple(Ts &&... args) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
constexpr int type_rank< T >::value
expected< T, E > result
Alias for expected (Rust-style naming)
string to_string(T value) FL_NO_EXCEPT
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NO_EXCEPT
typename make_index_sequence_impl< N >::type make_index_sequence
Base definition for an LED controller.
fl::ConstSpanWrapper< T > type
fl::ConstSpanWrapper< double > type
typename fl::remove_cv< typename fl::remove_reference< T >::type >::type type
fl::ConstSpanWrapper< float > type
fl::ConstSpanWrapper< int > type
fl::ConstSpanWrapper< fl::string > type
static fl::tuple< T, TypeConversionResult > convert(const json &j) FL_NO_EXCEPT