Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
Metadata.h
1// ============================================================
2// File: declarative/Metadata.h
3// Core metadata types for declarative pipeline construction
4// ============================================================
5
6#pragma once
7
8#include <string_view>
9#include <array>
10#include <cstdint>
11#include <cstddef>
12#include "FrameMetadata.h"
13#include "ImageMetadata.h"
14
15namespace apra {
16
17// ============================================================
18// Constants for fixed-capacity arrays
19// ============================================================
20inline constexpr size_t MAX_FRAME_TYPES = 8;
21inline constexpr size_t MAX_IMAGE_TYPES = 8;
22inline constexpr size_t MAX_ENUM_VALUES = 16;
23
24// ============================================================
25// Module Category (Primary classification - single value)
26// ============================================================
27enum class ModuleCategory {
28 Source, // Produces frames (RTSP, file, camera)
29 Sink, // Consumes frames (file writer, display)
30 Transform, // Transforms frames (decoder, encoder, filter)
31 Analytics, // Analyzes frames (motion detection, object detection)
32 Controller, // Controls other modules (REST API, scheduler)
33 Utility // Helper modules (queue, tee, mux)
34};
35
36// Use the canonical types from existing headers - no duplication
39
40// ============================================================
41// Pin Definition
42// Describes an input or output pin on a module
43//
44// Usage:
45// constexpr auto pin = PinDef::create("input", {"RawImagePlanar", "RawImagePacked"}, true, "desc");
46// Or for single frame type:
47// constexpr auto pin = PinDef::create("output", "H264Frame");
48// ============================================================
49struct PinDef {
50 std::string_view name;
51 std::array<std::string_view, MAX_FRAME_TYPES> frame_types{};
52 size_t frame_type_count = 0;
53 bool required = true;
54 std::string_view description = "";
55 MemType memType = FrameMetadata::HOST; // Memory location (HOST, CUDA_DEVICE, etc.)
56
57 // Supported pixel formats (empty = any format accepted)
58 std::array<ImageType, MAX_IMAGE_TYPES> image_types{};
59 size_t image_type_count = 0;
60
61 // Default constructor
62 constexpr PinDef() = default;
63
64 // Access frame types count
65 constexpr size_t frameTypeCount() const { return frame_type_count; }
66
67 // Check if a frame type is accepted
68 constexpr bool acceptsFrameType(std::string_view ft) const {
69 for (size_t i = 0; i < frame_type_count; ++i) {
70 if (frame_types[i] == ft) return true;
71 }
72 return false;
73 }
74
75 // Access image types count
76 constexpr size_t imageTypeCount() const { return image_type_count; }
77
78 // Check if an image type is supported (empty list = any type accepted)
79 constexpr bool acceptsImageType(ImageType it) const {
80 if (image_type_count == 0) return true; // No restriction
81 for (size_t i = 0; i < image_type_count; ++i) {
82 if (image_types[i] == it) return true;
83 }
84 return false;
85 }
86
87 // Check if this pin has image type restrictions
88 constexpr bool hasImageTypeRestrictions() const {
89 return image_type_count > 0;
90 }
91
92 // Factory for single frame type
93 static constexpr PinDef create(
94 std::string_view name_,
95 std::string_view frame_type,
96 bool required_ = true,
97 std::string_view description_ = "",
99 ) {
100 PinDef p;
101 p.name = name_;
102 p.frame_types[0] = frame_type;
103 p.frame_type_count = 1;
104 p.required = required_;
105 p.description = description_;
106 p.memType = memType_;
107 return p;
108 }
109
110 // Factory for two frame types
111 static constexpr PinDef create(
112 std::string_view name_,
113 std::string_view ft1, std::string_view ft2,
114 bool required_ = true,
115 std::string_view description_ = "",
117 ) {
118 PinDef p;
119 p.name = name_;
120 p.frame_types[0] = ft1;
121 p.frame_types[1] = ft2;
122 p.frame_type_count = 2;
123 p.required = required_;
124 p.description = description_;
125 p.memType = memType_;
126 return p;
127 }
128
129 // Factory for three frame types
130 static constexpr PinDef create(
131 std::string_view name_,
132 std::string_view ft1, std::string_view ft2, std::string_view ft3,
133 bool required_ = true,
134 std::string_view description_ = "",
136 ) {
137 PinDef p;
138 p.name = name_;
139 p.frame_types[0] = ft1;
140 p.frame_types[1] = ft2;
141 p.frame_types[2] = ft3;
142 p.frame_type_count = 3;
143 p.required = required_;
144 p.description = description_;
145 p.memType = memType_;
146 return p;
147 }
148
149 // Factory for four frame types
150 static constexpr PinDef create(
151 std::string_view name_,
152 std::string_view ft1, std::string_view ft2,
153 std::string_view ft3, std::string_view ft4,
154 bool required_ = true,
155 std::string_view description_ = "",
157 ) {
158 PinDef p;
159 p.name = name_;
160 p.frame_types[0] = ft1;
161 p.frame_types[1] = ft2;
162 p.frame_types[2] = ft3;
163 p.frame_types[3] = ft4;
164 p.frame_type_count = 4;
165 p.required = required_;
166 p.description = description_;
167 p.memType = memType_;
168 return p;
169 }
170
171 // Convenience factories for CUDA modules
172 static constexpr PinDef cudaInput(
173 std::string_view name_,
174 std::string_view frame_type,
175 std::string_view description_ = ""
176 ) {
177 return create(name_, frame_type, true, description_, FrameMetadata::CUDA_DEVICE);
178 }
179
180 static constexpr PinDef cudaOutput(
181 std::string_view name_,
182 std::string_view frame_type,
183 std::string_view description_ = ""
184 ) {
185 return create(name_, frame_type, true, description_, FrameMetadata::CUDA_DEVICE);
186 }
187
188 // Builder method to add image type restrictions
189 // Usage: PinDef::create(...).withImageTypes({ImageType::BGR, ImageType::RGB})
190 constexpr PinDef withImageType(ImageType it) const {
191 PinDef p = *this;
193 p.image_types[p.image_type_count++] = it;
194 }
195 return p;
196 }
197
198 constexpr PinDef withImageTypes(ImageType it1) const {
199 return withImageType(it1);
200 }
201
202 constexpr PinDef withImageTypes(ImageType it1, ImageType it2) const {
203 PinDef p = withImageType(it1);
204 return p.withImageType(it2);
205 }
206
207 constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3) const {
208 PinDef p = withImageTypes(it1, it2);
209 return p.withImageType(it3);
210 }
211
212 constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3, ImageType it4) const {
213 PinDef p = withImageTypes(it1, it2, it3);
214 return p.withImageType(it4);
215 }
216};
217
218// ============================================================
219// Property Definition with Static/Dynamic distinction
220// Describes a configurable property on a module
221// ============================================================
222struct PropDef {
224 enum class Mutability {
225 Static, // Set at construction, cannot change
226 Dynamic // Can be modified at runtime via Controller
227 };
228
229 std::string_view name;
232
233 // Required flag: true = mandatory (user must provide), false = optional (uses default)
234 bool required = false;
235
236 // Numeric values stored directly for type safety
237 int64_t int_default = 0;
238 int64_t int_min = 0;
239 int64_t int_max = 0;
240 double float_default = 0.0;
241 double float_min = 0.0;
242 double float_max = 0.0;
243 bool bool_default = false;
244
245 // String values
246 std::string_view string_default = "";
247 std::string_view regex_pattern = "";
248
249 // Enum values - fixed capacity array
250 std::array<std::string_view, MAX_ENUM_VALUES> enum_values{};
252
253 // Documentation
254 std::string_view description = "";
255 std::string_view unit = ""; // e.g., "ms", "percent", "pixels"
256
257 // Default constructor
258 constexpr PropDef() = default;
259
260 // ========================================================
261 // Factory methods for clean declaration syntax
262 // ========================================================
263
264 static constexpr PropDef Integer(
265 std::string_view name,
266 int64_t default_val,
267 int64_t min_val,
268 int64_t max_val,
269 std::string_view desc = "",
271 ) {
272 PropDef p;
273 p.name = name;
275 p.mutability = mut;
276 p.int_default = default_val;
277 p.int_min = min_val;
278 p.int_max = max_val;
279 p.description = desc;
280 return p;
281 }
282
283 static constexpr PropDef Floating(
284 std::string_view name,
285 double default_val,
286 double min_val,
287 double max_val,
288 std::string_view desc = "",
290 ) {
291 PropDef p;
292 p.name = name;
294 p.mutability = mut;
295 p.float_default = default_val;
296 p.float_min = min_val;
297 p.float_max = max_val;
298 p.description = desc;
299 return p;
300 }
301
302 static constexpr PropDef Boolean(
303 std::string_view name,
304 bool default_val,
305 std::string_view desc = "",
307 ) {
308 PropDef p;
309 p.name = name;
311 p.mutability = mut;
312 p.bool_default = default_val;
313 p.description = desc;
314 return p;
315 }
316
317 static constexpr PropDef Text(
318 std::string_view name,
319 std::string_view default_val,
320 std::string_view desc = "",
321 std::string_view regex = "",
323 ) {
324 PropDef p;
325 p.name = name;
326 p.type = Type::Text;
327 p.mutability = mut;
328 p.string_default = default_val;
329 p.regex_pattern = regex;
330 p.description = desc;
331 return p;
332 }
333
334 // Enum factory with up to 4 values (most common case)
335 static constexpr PropDef Enum(
336 std::string_view name,
337 std::string_view default_val,
338 std::string_view v1, std::string_view v2,
339 std::string_view desc = "",
341 ) {
342 PropDef p;
343 p.name = name;
345 p.mutability = mut;
346 p.string_default = default_val;
347 p.enum_values[0] = v1;
348 p.enum_values[1] = v2;
349 p.enum_value_count = 2;
350 p.description = desc;
351 return p;
352 }
353
354 static constexpr PropDef Enum(
355 std::string_view name,
356 std::string_view default_val,
357 std::string_view v1, std::string_view v2, std::string_view v3,
358 std::string_view desc = "",
360 ) {
361 PropDef p;
362 p.name = name;
364 p.mutability = mut;
365 p.string_default = default_val;
366 p.enum_values[0] = v1;
367 p.enum_values[1] = v2;
368 p.enum_values[2] = v3;
369 p.enum_value_count = 3;
370 p.description = desc;
371 return p;
372 }
373
374 static constexpr PropDef Enum(
375 std::string_view name,
376 std::string_view default_val,
377 std::string_view v1, std::string_view v2,
378 std::string_view v3, std::string_view v4,
379 std::string_view desc = "",
381 ) {
382 PropDef p;
383 p.name = name;
385 p.mutability = mut;
386 p.string_default = default_val;
387 p.enum_values[0] = v1;
388 p.enum_values[1] = v2;
389 p.enum_values[2] = v3;
390 p.enum_values[3] = v4;
391 p.enum_value_count = 4;
392 p.description = desc;
393 return p;
394 }
395
396 // ========================================================
397 // Convenience: Dynamic variants
398 // ========================================================
399
400 static constexpr PropDef DynamicInt(
401 std::string_view name,
402 int64_t default_val,
403 int64_t min_val,
404 int64_t max_val,
405 std::string_view desc = ""
406 ) {
407 return Integer(name, default_val, min_val, max_val, desc, Mutability::Dynamic);
408 }
409
410 static constexpr PropDef DynamicFloat(
411 std::string_view name,
412 double default_val,
413 double min_val,
414 double max_val,
415 std::string_view desc = ""
416 ) {
417 return Floating(name, default_val, min_val, max_val, desc, Mutability::Dynamic);
418 }
419
420 static constexpr PropDef DynamicBool(
421 std::string_view name,
422 bool default_val,
423 std::string_view desc = ""
424 ) {
425 return Boolean(name, default_val, desc, Mutability::Dynamic);
426 }
427
428 static constexpr PropDef DynamicString(
429 std::string_view name,
430 std::string_view default_val,
431 std::string_view desc = "",
432 std::string_view regex = ""
433 ) {
434 return Text(name, default_val, desc, regex, Mutability::Dynamic);
435 }
436
437 static constexpr PropDef DynamicEnum(
438 std::string_view name,
439 std::string_view default_val,
440 std::string_view v1, std::string_view v2,
441 std::string_view desc = ""
442 ) {
443 return Enum(name, default_val, v1, v2, desc, Mutability::Dynamic);
444 }
445
446 static constexpr PropDef DynamicEnum(
447 std::string_view name,
448 std::string_view default_val,
449 std::string_view v1, std::string_view v2, std::string_view v3,
450 std::string_view desc = ""
451 ) {
452 return Enum(name, default_val, v1, v2, v3, desc, Mutability::Dynamic);
453 }
454
455 // ========================================================
456 // Required (mandatory) property variants
457 // User MUST provide these values - no default is used
458 // ========================================================
459
460 static constexpr PropDef RequiredInt(
461 std::string_view name,
462 int64_t min_val,
463 int64_t max_val,
464 std::string_view desc = "",
466 ) {
467 PropDef p;
468 p.name = name;
470 p.mutability = mut;
471 p.required = true;
472 p.int_default = min_val; // Placeholder, not used
473 p.int_min = min_val;
474 p.int_max = max_val;
475 p.description = desc;
476 return p;
477 }
478
479 static constexpr PropDef RequiredFloat(
480 std::string_view name,
481 double min_val,
482 double max_val,
483 std::string_view desc = "",
485 ) {
486 PropDef p;
487 p.name = name;
489 p.mutability = mut;
490 p.required = true;
491 p.float_default = min_val; // Placeholder, not used
492 p.float_min = min_val;
493 p.float_max = max_val;
494 p.description = desc;
495 return p;
496 }
497
498 static constexpr PropDef RequiredString(
499 std::string_view name,
500 std::string_view desc = "",
501 std::string_view regex = "",
503 ) {
504 PropDef p;
505 p.name = name;
506 p.type = Type::Text;
507 p.mutability = mut;
508 p.required = true;
509 p.string_default = ""; // Placeholder, not used
510 p.regex_pattern = regex;
511 p.description = desc;
512 return p;
513 }
514
515 static constexpr PropDef RequiredEnum(
516 std::string_view name,
517 std::string_view v1, std::string_view v2,
518 std::string_view desc = "",
520 ) {
521 PropDef p;
522 p.name = name;
524 p.mutability = mut;
525 p.required = true;
526 p.string_default = v1; // Placeholder, not used
527 p.enum_values[0] = v1;
528 p.enum_values[1] = v2;
529 p.enum_value_count = 2;
530 p.description = desc;
531 return p;
532 }
533
534 static constexpr PropDef RequiredEnum(
535 std::string_view name,
536 std::string_view v1, std::string_view v2, std::string_view v3,
537 std::string_view desc = "",
539 ) {
540 PropDef p;
541 p.name = name;
543 p.mutability = mut;
544 p.required = true;
545 p.string_default = v1; // Placeholder, not used
546 p.enum_values[0] = v1;
547 p.enum_values[1] = v2;
548 p.enum_values[2] = v3;
549 p.enum_value_count = 3;
550 p.description = desc;
551 return p;
552 }
553
554 static constexpr PropDef RequiredEnum(
555 std::string_view name,
556 std::string_view v1, std::string_view v2,
557 std::string_view v3, std::string_view v4,
558 std::string_view desc = "",
560 ) {
561 PropDef p;
562 p.name = name;
564 p.mutability = mut;
565 p.required = true;
566 p.string_default = v1; // Placeholder, not used
567 p.enum_values[0] = v1;
568 p.enum_values[1] = v2;
569 p.enum_values[2] = v3;
570 p.enum_values[3] = v4;
571 p.enum_value_count = 4;
572 p.description = desc;
573 return p;
574 }
575};
576
577// ============================================================
578// Frame Type Attribute Definition
579// Describes attributes of a frame type (e.g., width, height for images)
580// ============================================================
581struct AttrDef {
583
584 std::string_view name;
586 bool required = true;
587 std::array<std::string_view, MAX_ENUM_VALUES> enum_values{};
589 std::string_view description = "";
590
591 // Default constructor
592 constexpr AttrDef() = default;
593
594 // ========================================================
595 // Factory methods
596 // ========================================================
597
598 static constexpr AttrDef Integer(
599 std::string_view name,
600 bool req = true,
601 std::string_view desc = ""
602 ) {
603 AttrDef a;
604 a.name = name;
606 a.required = req;
607 a.description = desc;
608 return a;
609 }
610
611 static constexpr AttrDef Int64(
612 std::string_view name,
613 bool req = true,
614 std::string_view desc = ""
615 ) {
616 AttrDef a;
617 a.name = name;
618 a.type = Type::Int64;
619 a.required = req;
620 a.description = desc;
621 return a;
622 }
623
624 static constexpr AttrDef Floating(
625 std::string_view name,
626 bool req = true,
627 std::string_view desc = ""
628 ) {
629 AttrDef a;
630 a.name = name;
632 a.required = req;
633 a.description = desc;
634 return a;
635 }
636
637 static constexpr AttrDef Boolean(
638 std::string_view name,
639 bool req = true,
640 std::string_view desc = ""
641 ) {
642 AttrDef a;
643 a.name = name;
645 a.required = req;
646 a.description = desc;
647 return a;
648 }
649
650 static constexpr AttrDef Text(
651 std::string_view name,
652 bool req = true,
653 std::string_view desc = ""
654 ) {
655 AttrDef a;
656 a.name = name;
657 a.type = Type::Text;
658 a.required = req;
659 a.description = desc;
660 return a;
661 }
662
663 static constexpr AttrDef Enum(
664 std::string_view name,
665 std::string_view v1, std::string_view v2,
666 bool req = true,
667 std::string_view desc = ""
668 ) {
669 AttrDef a;
670 a.name = name;
672 a.required = req;
673 a.enum_values[0] = v1;
674 a.enum_values[1] = v2;
675 a.enum_value_count = 2;
676 a.description = desc;
677 return a;
678 }
679
680 static constexpr AttrDef Enum(
681 std::string_view name,
682 std::string_view v1, std::string_view v2,
683 std::string_view v3, std::string_view v4,
684 bool req = true,
685 std::string_view desc = ""
686 ) {
687 AttrDef a;
688 a.name = name;
690 a.required = req;
691 a.enum_values[0] = v1;
692 a.enum_values[1] = v2;
693 a.enum_values[2] = v3;
694 a.enum_values[3] = v4;
695 a.enum_value_count = 4;
696 a.description = desc;
697 return a;
698 }
699
700 static constexpr AttrDef IntArray(
701 std::string_view name,
702 bool req = true,
703 std::string_view desc = ""
704 ) {
705 AttrDef a;
706 a.name = name;
708 a.required = req;
709 a.description = desc;
710 return a;
711 }
712};
713
714} // namespace apra
MemType
Definition FrameMetadata.h:58
@ HOST
Definition FrameMetadata.h:59
@ CUDA_DEVICE
Definition FrameMetadata.h:61
ImageType
Definition ImageMetadata.h:11
Definition FrameTypeRegistrations.h:10
ModuleCategory
Definition Metadata.h:27
constexpr size_t MAX_IMAGE_TYPES
Definition Metadata.h:21
constexpr size_t MAX_FRAME_TYPES
Definition Metadata.h:20
constexpr size_t MAX_ENUM_VALUES
Definition Metadata.h:22
Definition Metadata.h:581
static constexpr AttrDef Text(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:650
std::string_view description
Definition Metadata.h:589
static constexpr AttrDef Enum(std::string_view name, std::string_view v1, std::string_view v2, bool req=true, std::string_view desc="")
Definition Metadata.h:663
static constexpr AttrDef IntArray(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:700
bool required
Definition Metadata.h:586
static constexpr AttrDef Int64(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:611
static constexpr AttrDef Integer(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:598
std::string_view name
Definition Metadata.h:584
Type
Definition Metadata.h:582
Type type
Definition Metadata.h:585
static constexpr AttrDef Floating(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:624
static constexpr AttrDef Enum(std::string_view name, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view v4, bool req=true, std::string_view desc="")
Definition Metadata.h:680
static constexpr AttrDef Boolean(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:637
std::array< std::string_view, MAX_ENUM_VALUES > enum_values
Definition Metadata.h:587
constexpr AttrDef()=default
size_t enum_value_count
Definition Metadata.h:588
Definition Metadata.h:49
static constexpr PinDef create(std::string_view name_, std::string_view ft1, std::string_view ft2, std::string_view ft3, std::string_view ft4, bool required_=true, std::string_view description_="", MemType memType_=FrameMetadata::HOST)
Definition Metadata.h:150
constexpr bool hasImageTypeRestrictions() const
Definition Metadata.h:88
constexpr size_t imageTypeCount() const
Definition Metadata.h:76
constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3, ImageType it4) const
Definition Metadata.h:212
MemType memType
Definition Metadata.h:55
static constexpr PinDef create(std::string_view name_, std::string_view ft1, std::string_view ft2, bool required_=true, std::string_view description_="", MemType memType_=FrameMetadata::HOST)
Definition Metadata.h:111
std::array< ImageType, MAX_IMAGE_TYPES > image_types
Definition Metadata.h:58
constexpr PinDef withImageType(ImageType it) const
Definition Metadata.h:190
size_t frame_type_count
Definition Metadata.h:52
constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3) const
Definition Metadata.h:207
static constexpr PinDef cudaOutput(std::string_view name_, std::string_view frame_type, std::string_view description_="")
Definition Metadata.h:180
constexpr PinDef()=default
bool required
Definition Metadata.h:53
static constexpr PinDef cudaInput(std::string_view name_, std::string_view frame_type, std::string_view description_="")
Definition Metadata.h:172
std::string_view description
Definition Metadata.h:54
constexpr PinDef withImageTypes(ImageType it1, ImageType it2) const
Definition Metadata.h:202
size_t image_type_count
Definition Metadata.h:59
std::string_view name
Definition Metadata.h:50
static constexpr PinDef create(std::string_view name_, std::string_view ft1, std::string_view ft2, std::string_view ft3, bool required_=true, std::string_view description_="", MemType memType_=FrameMetadata::HOST)
Definition Metadata.h:130
static constexpr PinDef create(std::string_view name_, std::string_view frame_type, bool required_=true, std::string_view description_="", MemType memType_=FrameMetadata::HOST)
Definition Metadata.h:93
constexpr bool acceptsFrameType(std::string_view ft) const
Definition Metadata.h:68
constexpr PinDef withImageTypes(ImageType it1) const
Definition Metadata.h:198
constexpr size_t frameTypeCount() const
Definition Metadata.h:65
constexpr bool acceptsImageType(ImageType it) const
Definition Metadata.h:79
std::array< std::string_view, MAX_FRAME_TYPES > frame_types
Definition Metadata.h:51
Definition Metadata.h:222
static constexpr PropDef Floating(std::string_view name, double default_val, double min_val, double max_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:283
static constexpr PropDef Enum(std::string_view name, std::string_view default_val, std::string_view v1, std::string_view v2, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:335
static constexpr PropDef DynamicEnum(std::string_view name, std::string_view default_val, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view desc="")
Definition Metadata.h:446
static constexpr PropDef DynamicBool(std::string_view name, bool default_val, std::string_view desc="")
Definition Metadata.h:420
static constexpr PropDef DynamicInt(std::string_view name, int64_t default_val, int64_t min_val, int64_t max_val, std::string_view desc="")
Definition Metadata.h:400
std::string_view regex_pattern
Definition Metadata.h:247
Mutability
Definition Metadata.h:224
Mutability mutability
Definition Metadata.h:231
static constexpr PropDef DynamicFloat(std::string_view name, double default_val, double min_val, double max_val, std::string_view desc="")
Definition Metadata.h:410
static constexpr PropDef Boolean(std::string_view name, bool default_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:302
int64_t int_default
Definition Metadata.h:237
static constexpr PropDef Text(std::string_view name, std::string_view default_val, std::string_view desc="", std::string_view regex="", Mutability mut=Mutability::Static)
Definition Metadata.h:317
static constexpr PropDef Enum(std::string_view name, std::string_view default_val, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view v4, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:374
constexpr PropDef()=default
static constexpr PropDef RequiredFloat(std::string_view name, double min_val, double max_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:479
static constexpr PropDef RequiredEnum(std::string_view name, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:534
size_t enum_value_count
Definition Metadata.h:251
int64_t int_max
Definition Metadata.h:239
static constexpr PropDef RequiredEnum(std::string_view name, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view v4, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:554
Type type
Definition Metadata.h:230
static constexpr PropDef Enum(std::string_view name, std::string_view default_val, std::string_view v1, std::string_view v2, std::string_view v3, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:354
double float_default
Definition Metadata.h:240
static constexpr PropDef RequiredEnum(std::string_view name, std::string_view v1, std::string_view v2, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:515
int64_t int_min
Definition Metadata.h:238
std::array< std::string_view, MAX_ENUM_VALUES > enum_values
Definition Metadata.h:250
static constexpr PropDef DynamicString(std::string_view name, std::string_view default_val, std::string_view desc="", std::string_view regex="")
Definition Metadata.h:428
static constexpr PropDef RequiredInt(std::string_view name, int64_t min_val, int64_t max_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:460
Type
Definition Metadata.h:223
static constexpr PropDef RequiredString(std::string_view name, std::string_view desc="", std::string_view regex="", Mutability mut=Mutability::Static)
Definition Metadata.h:498
bool bool_default
Definition Metadata.h:243
static constexpr PropDef Integer(std::string_view name, int64_t default_val, int64_t min_val, int64_t max_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:264
double float_min
Definition Metadata.h:241
std::string_view unit
Definition Metadata.h:255
static constexpr PropDef DynamicEnum(std::string_view name, std::string_view default_val, std::string_view v1, std::string_view v2, std::string_view desc="")
Definition Metadata.h:437
std::string_view description
Definition Metadata.h:254
std::string_view name
Definition Metadata.h:229
double float_max
Definition Metadata.h:242
bool required
Definition Metadata.h:234
std::string_view string_default
Definition Metadata.h:246