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// ============================================================
37// Path Type - Semantic type for file/directory path properties
38// ============================================================
39enum class PathType {
40 NotAPath, // Regular string, not a filesystem path
41 FilePath, // Single file: /path/to/file.mp4
42 DirectoryPath, // Directory: /path/to/folder/
43 FilePattern, // File with wildcards: frame_????.jpg
44 GlobPattern, // Glob pattern: *.mp4
45 DevicePath, // Device file: /dev/video0
46 NetworkURL // Network URL: rtsp://host/stream (not filesystem)
47};
48
49// ============================================================
50// Path Requirement - Existence and access requirements for paths
51// ============================================================
52enum class PathRequirement {
53 NoValidation, // No validation (for NotAPath or NetworkURL)
54 MustExist, // Path must exist at pipeline start (readers)
55 MayExist, // Path may or may not exist (overwriting writers)
56 MustNotExist, // Path must NOT exist (strict non-overwriting mode)
57 ParentMustExist, // Parent directory must exist, file may not (writers)
58 WillBeCreated // Framework creates parent directories if needed (writers)
59};
60
61// Use the canonical types from existing headers - no duplication
64
65// ============================================================
66// Pin Definition
67// Describes an input or output pin on a module
68//
69// Usage:
70// constexpr auto pin = PinDef::create("input", {"RawImagePlanar", "RawImagePacked"}, true, "desc");
71// Or for single frame type:
72// constexpr auto pin = PinDef::create("output", "H264Frame");
73// ============================================================
74struct PinDef {
75 std::string_view name;
76 std::array<std::string_view, MAX_FRAME_TYPES> frame_types{};
77 size_t frame_type_count = 0;
78 bool required = true;
79 std::string_view description = "";
80 MemType memType = FrameMetadata::HOST; // Memory location (HOST, CUDA_DEVICE, etc.)
81
82 // Supported pixel formats (empty = any format accepted)
83 std::array<ImageType, MAX_IMAGE_TYPES> image_types{};
84 size_t image_type_count = 0;
85
86 // Default constructor
87 constexpr PinDef() = default;
88
89 // Access frame types count
90 constexpr size_t frameTypeCount() const { return frame_type_count; }
91
92 // Check if a frame type is accepted
93 constexpr bool acceptsFrameType(std::string_view ft) const {
94 for (size_t i = 0; i < frame_type_count; ++i) {
95 if (frame_types[i] == ft) return true;
96 }
97 return false;
98 }
99
100 // Access image types count
101 constexpr size_t imageTypeCount() const { return image_type_count; }
102
103 // Check if an image type is supported (empty list = any type accepted)
104 constexpr bool acceptsImageType(ImageType it) const {
105 if (image_type_count == 0) return true; // No restriction
106 for (size_t i = 0; i < image_type_count; ++i) {
107 if (image_types[i] == it) return true;
108 }
109 return false;
110 }
111
112 // Check if this pin has image type restrictions
113 constexpr bool hasImageTypeRestrictions() const {
114 return image_type_count > 0;
115 }
116
117 // Factory for single frame type
118 static constexpr PinDef create(
119 std::string_view name_,
120 std::string_view frame_type,
121 bool required_ = true,
122 std::string_view description_ = "",
124 ) {
125 PinDef p;
126 p.name = name_;
127 p.frame_types[0] = frame_type;
128 p.frame_type_count = 1;
129 p.required = required_;
130 p.description = description_;
131 p.memType = memType_;
132 return p;
133 }
134
135 // Factory for two frame types
136 static constexpr PinDef create(
137 std::string_view name_,
138 std::string_view ft1, std::string_view ft2,
139 bool required_ = true,
140 std::string_view description_ = "",
142 ) {
143 PinDef p;
144 p.name = name_;
145 p.frame_types[0] = ft1;
146 p.frame_types[1] = ft2;
147 p.frame_type_count = 2;
148 p.required = required_;
149 p.description = description_;
150 p.memType = memType_;
151 return p;
152 }
153
154 // Factory for three frame types
155 static constexpr PinDef create(
156 std::string_view name_,
157 std::string_view ft1, std::string_view ft2, std::string_view ft3,
158 bool required_ = true,
159 std::string_view description_ = "",
161 ) {
162 PinDef p;
163 p.name = name_;
164 p.frame_types[0] = ft1;
165 p.frame_types[1] = ft2;
166 p.frame_types[2] = ft3;
167 p.frame_type_count = 3;
168 p.required = required_;
169 p.description = description_;
170 p.memType = memType_;
171 return p;
172 }
173
174 // Factory for four frame types
175 static constexpr PinDef create(
176 std::string_view name_,
177 std::string_view ft1, std::string_view ft2,
178 std::string_view ft3, std::string_view ft4,
179 bool required_ = true,
180 std::string_view description_ = "",
182 ) {
183 PinDef p;
184 p.name = name_;
185 p.frame_types[0] = ft1;
186 p.frame_types[1] = ft2;
187 p.frame_types[2] = ft3;
188 p.frame_types[3] = ft4;
189 p.frame_type_count = 4;
190 p.required = required_;
191 p.description = description_;
192 p.memType = memType_;
193 return p;
194 }
195
196 // Convenience factories for CUDA modules
197 static constexpr PinDef cudaInput(
198 std::string_view name_,
199 std::string_view frame_type,
200 std::string_view description_ = ""
201 ) {
202 return create(name_, frame_type, true, description_, FrameMetadata::CUDA_DEVICE);
203 }
204
205 static constexpr PinDef cudaOutput(
206 std::string_view name_,
207 std::string_view frame_type,
208 std::string_view description_ = ""
209 ) {
210 return create(name_, frame_type, true, description_, FrameMetadata::CUDA_DEVICE);
211 }
212
213 // Builder method to add image type restrictions
214 // Usage: PinDef::create(...).withImageTypes({ImageType::BGR, ImageType::RGB})
215 constexpr PinDef withImageType(ImageType it) const {
216 PinDef p = *this;
218 p.image_types[p.image_type_count++] = it;
219 }
220 return p;
221 }
222
223 constexpr PinDef withImageTypes(ImageType it1) const {
224 return withImageType(it1);
225 }
226
227 constexpr PinDef withImageTypes(ImageType it1, ImageType it2) const {
228 PinDef p = withImageType(it1);
229 return p.withImageType(it2);
230 }
231
232 constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3) const {
233 PinDef p = withImageTypes(it1, it2);
234 return p.withImageType(it3);
235 }
236
237 constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3, ImageType it4) const {
238 PinDef p = withImageTypes(it1, it2, it3);
239 return p.withImageType(it4);
240 }
241};
242
243// ============================================================
244// Property Definition with Static/Dynamic distinction
245// Describes a configurable property on a module
246// ============================================================
247struct PropDef {
249 enum class Mutability {
250 Static, // Set at construction, cannot change
251 Dynamic // Can be modified at runtime via Controller
252 };
253
254 std::string_view name;
257
258 // Required flag: true = mandatory (user must provide), false = optional (uses default)
259 bool required = false;
260
261 // Numeric values stored directly for type safety
262 int64_t int_default = 0;
263 int64_t int_min = 0;
264 int64_t int_max = 0;
265 double float_default = 0.0;
266 double float_min = 0.0;
267 double float_max = 0.0;
268 bool bool_default = false;
269
270 // String values
271 std::string_view string_default = "";
272 std::string_view regex_pattern = "";
273
274 // Enum values - fixed capacity array
275 std::array<std::string_view, MAX_ENUM_VALUES> enum_values{};
277
278 // Documentation
279 std::string_view description = "";
280 std::string_view unit = ""; // e.g., "ms", "percent", "pixels"
281
282 // Path metadata - for file/directory path properties
285
286 // Default constructor
287 constexpr PropDef() = default;
288
289 // ========================================================
290 // Factory methods for clean declaration syntax
291 // ========================================================
292
293 static constexpr PropDef Integer(
294 std::string_view name,
295 int64_t default_val,
296 int64_t min_val,
297 int64_t max_val,
298 std::string_view desc = "",
300 ) {
301 PropDef p;
302 p.name = name;
304 p.mutability = mut;
305 p.int_default = default_val;
306 p.int_min = min_val;
307 p.int_max = max_val;
308 p.description = desc;
309 return p;
310 }
311
312 static constexpr PropDef Floating(
313 std::string_view name,
314 double default_val,
315 double min_val,
316 double max_val,
317 std::string_view desc = "",
319 ) {
320 PropDef p;
321 p.name = name;
323 p.mutability = mut;
324 p.float_default = default_val;
325 p.float_min = min_val;
326 p.float_max = max_val;
327 p.description = desc;
328 return p;
329 }
330
331 static constexpr PropDef Boolean(
332 std::string_view name,
333 bool default_val,
334 std::string_view desc = "",
336 ) {
337 PropDef p;
338 p.name = name;
340 p.mutability = mut;
341 p.bool_default = default_val;
342 p.description = desc;
343 return p;
344 }
345
346 static constexpr PropDef Text(
347 std::string_view name,
348 std::string_view default_val,
349 std::string_view desc = "",
350 std::string_view regex = "",
352 ) {
353 PropDef p;
354 p.name = name;
355 p.type = Type::Text;
356 p.mutability = mut;
357 p.string_default = default_val;
358 p.regex_pattern = regex;
359 p.description = desc;
360 return p;
361 }
362
363 // Enum factory with up to 4 values (most common case)
364 static constexpr PropDef Enum(
365 std::string_view name,
366 std::string_view default_val,
367 std::string_view v1, std::string_view v2,
368 std::string_view desc = "",
370 ) {
371 PropDef p;
372 p.name = name;
374 p.mutability = mut;
375 p.string_default = default_val;
376 p.enum_values[0] = v1;
377 p.enum_values[1] = v2;
378 p.enum_value_count = 2;
379 p.description = desc;
380 return p;
381 }
382
383 static constexpr PropDef Enum(
384 std::string_view name,
385 std::string_view default_val,
386 std::string_view v1, std::string_view v2, std::string_view v3,
387 std::string_view desc = "",
389 ) {
390 PropDef p;
391 p.name = name;
393 p.mutability = mut;
394 p.string_default = default_val;
395 p.enum_values[0] = v1;
396 p.enum_values[1] = v2;
397 p.enum_values[2] = v3;
398 p.enum_value_count = 3;
399 p.description = desc;
400 return p;
401 }
402
403 static constexpr PropDef Enum(
404 std::string_view name,
405 std::string_view default_val,
406 std::string_view v1, std::string_view v2,
407 std::string_view v3, std::string_view v4,
408 std::string_view desc = "",
410 ) {
411 PropDef p;
412 p.name = name;
414 p.mutability = mut;
415 p.string_default = default_val;
416 p.enum_values[0] = v1;
417 p.enum_values[1] = v2;
418 p.enum_values[2] = v3;
419 p.enum_values[3] = v4;
420 p.enum_value_count = 4;
421 p.description = desc;
422 return p;
423 }
424
425 // ========================================================
426 // Convenience: Dynamic variants
427 // ========================================================
428
429 static constexpr PropDef DynamicInt(
430 std::string_view name,
431 int64_t default_val,
432 int64_t min_val,
433 int64_t max_val,
434 std::string_view desc = ""
435 ) {
436 return Integer(name, default_val, min_val, max_val, desc, Mutability::Dynamic);
437 }
438
439 static constexpr PropDef DynamicFloat(
440 std::string_view name,
441 double default_val,
442 double min_val,
443 double max_val,
444 std::string_view desc = ""
445 ) {
446 return Floating(name, default_val, min_val, max_val, desc, Mutability::Dynamic);
447 }
448
449 static constexpr PropDef DynamicBool(
450 std::string_view name,
451 bool default_val,
452 std::string_view desc = ""
453 ) {
454 return Boolean(name, default_val, desc, Mutability::Dynamic);
455 }
456
457 static constexpr PropDef DynamicString(
458 std::string_view name,
459 std::string_view default_val,
460 std::string_view desc = "",
461 std::string_view regex = ""
462 ) {
463 return Text(name, default_val, desc, regex, Mutability::Dynamic);
464 }
465
466 static constexpr PropDef DynamicEnum(
467 std::string_view name,
468 std::string_view default_val,
469 std::string_view v1, std::string_view v2,
470 std::string_view desc = ""
471 ) {
472 return Enum(name, default_val, v1, v2, desc, Mutability::Dynamic);
473 }
474
475 static constexpr PropDef DynamicEnum(
476 std::string_view name,
477 std::string_view default_val,
478 std::string_view v1, std::string_view v2, std::string_view v3,
479 std::string_view desc = ""
480 ) {
481 return Enum(name, default_val, v1, v2, v3, desc, Mutability::Dynamic);
482 }
483
484 // ========================================================
485 // Required (mandatory) property variants
486 // User MUST provide these values - no default is used
487 // ========================================================
488
489 static constexpr PropDef RequiredInt(
490 std::string_view name,
491 int64_t min_val,
492 int64_t max_val,
493 std::string_view desc = "",
495 ) {
496 PropDef p;
497 p.name = name;
499 p.mutability = mut;
500 p.required = true;
501 p.int_default = min_val; // Placeholder, not used
502 p.int_min = min_val;
503 p.int_max = max_val;
504 p.description = desc;
505 return p;
506 }
507
508 static constexpr PropDef RequiredFloat(
509 std::string_view name,
510 double min_val,
511 double max_val,
512 std::string_view desc = "",
514 ) {
515 PropDef p;
516 p.name = name;
518 p.mutability = mut;
519 p.required = true;
520 p.float_default = min_val; // Placeholder, not used
521 p.float_min = min_val;
522 p.float_max = max_val;
523 p.description = desc;
524 return p;
525 }
526
527 static constexpr PropDef RequiredString(
528 std::string_view name,
529 std::string_view desc = "",
530 std::string_view regex = "",
532 ) {
533 PropDef p;
534 p.name = name;
535 p.type = Type::Text;
536 p.mutability = mut;
537 p.required = true;
538 p.string_default = ""; // Placeholder, not used
539 p.regex_pattern = regex;
540 p.description = desc;
541 return p;
542 }
543
544 static constexpr PropDef RequiredEnum(
545 std::string_view name,
546 std::string_view v1, std::string_view v2,
547 std::string_view desc = "",
549 ) {
550 PropDef p;
551 p.name = name;
553 p.mutability = mut;
554 p.required = true;
555 p.string_default = v1; // Placeholder, not used
556 p.enum_values[0] = v1;
557 p.enum_values[1] = v2;
558 p.enum_value_count = 2;
559 p.description = desc;
560 return p;
561 }
562
563 static constexpr PropDef RequiredEnum(
564 std::string_view name,
565 std::string_view v1, std::string_view v2, std::string_view v3,
566 std::string_view desc = "",
568 ) {
569 PropDef p;
570 p.name = name;
572 p.mutability = mut;
573 p.required = true;
574 p.string_default = v1; // Placeholder, not used
575 p.enum_values[0] = v1;
576 p.enum_values[1] = v2;
577 p.enum_values[2] = v3;
578 p.enum_value_count = 3;
579 p.description = desc;
580 return p;
581 }
582
583 static constexpr PropDef RequiredEnum(
584 std::string_view name,
585 std::string_view v1, std::string_view v2,
586 std::string_view v3, std::string_view v4,
587 std::string_view desc = "",
589 ) {
590 PropDef p;
591 p.name = name;
593 p.mutability = mut;
594 p.required = true;
595 p.string_default = v1; // Placeholder, not used
596 p.enum_values[0] = v1;
597 p.enum_values[1] = v2;
598 p.enum_values[2] = v3;
599 p.enum_values[3] = v4;
600 p.enum_value_count = 4;
601 p.description = desc;
602 return p;
603 }
604
605 // ========================================================
606 // Path property factories
607 // Use these for properties that are file/directory paths
608 // ========================================================
609
610 // Single file path (e.g., /path/to/video.mp4)
611 static constexpr PropDef FilePath(
612 std::string_view name,
613 PathRequirement requirement,
614 std::string_view default_val = "",
615 std::string_view desc = "",
617 ) {
618 PropDef p;
619 p.name = name;
620 p.type = Type::Text;
621 p.mutability = mut;
622 p.required = default_val.empty();
623 p.string_default = default_val;
625 p.path_requirement = requirement;
626 p.description = desc;
627 return p;
628 }
629
630 // Directory path (e.g., /path/to/folder/)
631 static constexpr PropDef DirectoryPath(
632 std::string_view name,
633 PathRequirement requirement,
634 std::string_view default_val = "",
635 std::string_view desc = "",
637 ) {
638 PropDef p;
639 p.name = name;
640 p.type = Type::Text;
641 p.mutability = mut;
642 p.required = default_val.empty();
643 p.string_default = default_val;
645 p.path_requirement = requirement;
646 p.description = desc;
647 return p;
648 }
649
650 // File pattern with wildcards (e.g., frame_????.jpg)
651 static constexpr PropDef FilePattern(
652 std::string_view name,
653 PathRequirement requirement,
654 std::string_view default_val = "",
655 std::string_view desc = "",
657 ) {
658 PropDef p;
659 p.name = name;
660 p.type = Type::Text;
661 p.mutability = mut;
662 p.required = default_val.empty();
663 p.string_default = default_val;
665 p.path_requirement = requirement;
666 p.description = desc;
667 return p;
668 }
669
670 // Glob pattern (e.g., *.mp4)
671 static constexpr PropDef GlobPattern(
672 std::string_view name,
673 PathRequirement requirement,
674 std::string_view default_val = "",
675 std::string_view desc = "",
677 ) {
678 PropDef p;
679 p.name = name;
680 p.type = Type::Text;
681 p.mutability = mut;
682 p.required = default_val.empty();
683 p.string_default = default_val;
685 p.path_requirement = requirement;
686 p.description = desc;
687 return p;
688 }
689
690 // Device path (e.g., /dev/video0)
691 static constexpr PropDef DevicePath(
692 std::string_view name,
693 std::string_view default_val = "",
694 std::string_view desc = "",
696 ) {
697 PropDef p;
698 p.name = name;
699 p.type = Type::Text;
700 p.mutability = mut;
701 p.required = default_val.empty();
702 p.string_default = default_val;
704 p.path_requirement = PathRequirement::MustExist; // Device must exist
705 p.description = desc;
706 return p;
707 }
708
709 // Network URL (e.g., rtsp://host/stream) - no filesystem validation
710 static constexpr PropDef NetworkURL(
711 std::string_view name,
712 std::string_view default_val = "",
713 std::string_view desc = "",
715 ) {
716 PropDef p;
717 p.name = name;
718 p.type = Type::Text;
719 p.mutability = mut;
720 p.required = default_val.empty();
721 p.string_default = default_val;
723 p.path_requirement = PathRequirement::NoValidation; // No filesystem validation
724 p.description = desc;
725 return p;
726 }
727
728 // ========================================================
729 // Helper to check if this property is a path type
730 // ========================================================
731 constexpr bool isPath() const {
733 }
734
741};
742
743// ============================================================
744// Frame Type Attribute Definition
745// Describes attributes of a frame type (e.g., width, height for images)
746// ============================================================
747struct AttrDef {
749
750 std::string_view name;
752 bool required = true;
753 std::array<std::string_view, MAX_ENUM_VALUES> enum_values{};
755 std::string_view description = "";
756
757 // Default constructor
758 constexpr AttrDef() = default;
759
760 // ========================================================
761 // Factory methods
762 // ========================================================
763
764 static constexpr AttrDef Integer(
765 std::string_view name,
766 bool req = true,
767 std::string_view desc = ""
768 ) {
769 AttrDef a;
770 a.name = name;
772 a.required = req;
773 a.description = desc;
774 return a;
775 }
776
777 static constexpr AttrDef Int64(
778 std::string_view name,
779 bool req = true,
780 std::string_view desc = ""
781 ) {
782 AttrDef a;
783 a.name = name;
784 a.type = Type::Int64;
785 a.required = req;
786 a.description = desc;
787 return a;
788 }
789
790 static constexpr AttrDef Floating(
791 std::string_view name,
792 bool req = true,
793 std::string_view desc = ""
794 ) {
795 AttrDef a;
796 a.name = name;
798 a.required = req;
799 a.description = desc;
800 return a;
801 }
802
803 static constexpr AttrDef Boolean(
804 std::string_view name,
805 bool req = true,
806 std::string_view desc = ""
807 ) {
808 AttrDef a;
809 a.name = name;
811 a.required = req;
812 a.description = desc;
813 return a;
814 }
815
816 static constexpr AttrDef Text(
817 std::string_view name,
818 bool req = true,
819 std::string_view desc = ""
820 ) {
821 AttrDef a;
822 a.name = name;
823 a.type = Type::Text;
824 a.required = req;
825 a.description = desc;
826 return a;
827 }
828
829 static constexpr AttrDef Enum(
830 std::string_view name,
831 std::string_view v1, std::string_view v2,
832 bool req = true,
833 std::string_view desc = ""
834 ) {
835 AttrDef a;
836 a.name = name;
838 a.required = req;
839 a.enum_values[0] = v1;
840 a.enum_values[1] = v2;
841 a.enum_value_count = 2;
842 a.description = desc;
843 return a;
844 }
845
846 static constexpr AttrDef Enum(
847 std::string_view name,
848 std::string_view v1, std::string_view v2,
849 std::string_view v3, std::string_view v4,
850 bool req = true,
851 std::string_view desc = ""
852 ) {
853 AttrDef a;
854 a.name = name;
856 a.required = req;
857 a.enum_values[0] = v1;
858 a.enum_values[1] = v2;
859 a.enum_values[2] = v3;
860 a.enum_values[3] = v4;
861 a.enum_value_count = 4;
862 a.description = desc;
863 return a;
864 }
865
866 static constexpr AttrDef IntArray(
867 std::string_view name,
868 bool req = true,
869 std::string_view desc = ""
870 ) {
871 AttrDef a;
872 a.name = name;
874 a.required = req;
875 a.description = desc;
876 return a;
877 }
878};
879
880} // 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
PathType
Definition Metadata.h:39
PathRequirement
Definition Metadata.h:52
constexpr size_t MAX_FRAME_TYPES
Definition Metadata.h:20
constexpr size_t MAX_ENUM_VALUES
Definition Metadata.h:22
Definition Metadata.h:747
static constexpr AttrDef Text(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:816
std::string_view description
Definition Metadata.h:755
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:829
static constexpr AttrDef IntArray(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:866
bool required
Definition Metadata.h:752
static constexpr AttrDef Int64(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:777
static constexpr AttrDef Integer(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:764
std::string_view name
Definition Metadata.h:750
Type
Definition Metadata.h:748
Type type
Definition Metadata.h:751
static constexpr AttrDef Floating(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:790
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:846
static constexpr AttrDef Boolean(std::string_view name, bool req=true, std::string_view desc="")
Definition Metadata.h:803
std::array< std::string_view, MAX_ENUM_VALUES > enum_values
Definition Metadata.h:753
constexpr AttrDef()=default
size_t enum_value_count
Definition Metadata.h:754
Definition Metadata.h:74
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:175
constexpr bool hasImageTypeRestrictions() const
Definition Metadata.h:113
constexpr size_t imageTypeCount() const
Definition Metadata.h:101
constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3, ImageType it4) const
Definition Metadata.h:237
MemType memType
Definition Metadata.h:80
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:136
std::array< ImageType, MAX_IMAGE_TYPES > image_types
Definition Metadata.h:83
constexpr PinDef withImageType(ImageType it) const
Definition Metadata.h:215
size_t frame_type_count
Definition Metadata.h:77
constexpr PinDef withImageTypes(ImageType it1, ImageType it2, ImageType it3) const
Definition Metadata.h:232
static constexpr PinDef cudaOutput(std::string_view name_, std::string_view frame_type, std::string_view description_="")
Definition Metadata.h:205
constexpr PinDef()=default
bool required
Definition Metadata.h:78
static constexpr PinDef cudaInput(std::string_view name_, std::string_view frame_type, std::string_view description_="")
Definition Metadata.h:197
std::string_view description
Definition Metadata.h:79
constexpr PinDef withImageTypes(ImageType it1, ImageType it2) const
Definition Metadata.h:227
size_t image_type_count
Definition Metadata.h:84
std::string_view name
Definition Metadata.h:75
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:155
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:118
constexpr bool acceptsFrameType(std::string_view ft) const
Definition Metadata.h:93
constexpr PinDef withImageTypes(ImageType it1) const
Definition Metadata.h:223
constexpr size_t frameTypeCount() const
Definition Metadata.h:90
constexpr bool acceptsImageType(ImageType it) const
Definition Metadata.h:104
std::array< std::string_view, MAX_FRAME_TYPES > frame_types
Definition Metadata.h:76
Definition Metadata.h:247
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:312
static constexpr PropDef DevicePath(std::string_view name, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:691
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:364
constexpr bool isFilesystemPath() const
Definition Metadata.h:735
static constexpr PropDef FilePattern(std::string_view name, PathRequirement requirement, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:651
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:475
static constexpr PropDef DynamicBool(std::string_view name, bool default_val, std::string_view desc="")
Definition Metadata.h:449
static constexpr PropDef FilePath(std::string_view name, PathRequirement requirement, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:611
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:429
static constexpr PropDef NetworkURL(std::string_view name, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:710
PathType path_type
Definition Metadata.h:283
std::string_view regex_pattern
Definition Metadata.h:272
Mutability
Definition Metadata.h:249
Mutability mutability
Definition Metadata.h:256
static constexpr PropDef DynamicFloat(std::string_view name, double default_val, double min_val, double max_val, std::string_view desc="")
Definition Metadata.h:439
static constexpr PropDef Boolean(std::string_view name, bool default_val, std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:331
int64_t int_default
Definition Metadata.h:262
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:346
static constexpr PropDef DirectoryPath(std::string_view name, PathRequirement requirement, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:631
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:403
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:508
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:563
size_t enum_value_count
Definition Metadata.h:276
PathRequirement path_requirement
Definition Metadata.h:284
int64_t int_max
Definition Metadata.h:264
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:583
constexpr bool isPath() const
Definition Metadata.h:731
Type type
Definition Metadata.h:255
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:383
double float_default
Definition Metadata.h:265
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:544
int64_t int_min
Definition Metadata.h:263
std::array< std::string_view, MAX_ENUM_VALUES > enum_values
Definition Metadata.h:275
static constexpr PropDef DynamicString(std::string_view name, std::string_view default_val, std::string_view desc="", std::string_view regex="")
Definition Metadata.h:457
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:489
Type
Definition Metadata.h:248
static constexpr PropDef RequiredString(std::string_view name, std::string_view desc="", std::string_view regex="", Mutability mut=Mutability::Static)
Definition Metadata.h:527
bool bool_default
Definition Metadata.h:268
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:293
double float_min
Definition Metadata.h:266
std::string_view unit
Definition Metadata.h:280
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:466
static constexpr PropDef GlobPattern(std::string_view name, PathRequirement requirement, std::string_view default_val="", std::string_view desc="", Mutability mut=Mutability::Static)
Definition Metadata.h:671
std::string_view description
Definition Metadata.h:279
std::string_view name
Definition Metadata.h:254
double float_max
Definition Metadata.h:267
bool required
Definition Metadata.h:259
std::string_view string_default
Definition Metadata.h:271