Zserio C++17 runtime library 1.3.0
Built for Zserio 2.20.0
Loading...
Searching...
No Matches
Walker.h
Go to the documentation of this file.
1#ifndef ZSERIO_WALKER_H_INC
2#define ZSERIO_WALKER_H_INC
3
4#include <algorithm>
5#include <functional>
6#include <regex>
7
9#include "zserio/ITypeInfo.h"
10#include "zserio/IWalkFilter.h"
12#include "zserio/String.h"
14#include "zserio/TypeInfoUtil.h"
15#include "zserio/Vector.h"
16#include "zserio/WalkerConst.h"
17
18namespace zserio
19{
20
21template <typename ALLOC>
22class BasicDefaultWalkFilter;
23
28template <typename ALLOC = std::allocator<uint8_t>>
84
88template <typename ALLOC = std::allocator<uint8_t>>
134
138template <typename ALLOC = std::allocator<uint8_t>>
140{
141public:
147 ~BasicDefaultWalkFilter() override = default;
158
166 {
167 return true;
168 }
169
171 {
172 return true;
173 }
174
176 const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>&, size_t) override
177 {
178 return true;
179 }
180
182 const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>&, size_t) override
183 {
184 return true;
185 }
186
188 {
189 return true;
190 }
191
193 {
194 return true;
195 }
196};
197
201template <typename ALLOC = std::allocator<uint8_t>>
203{
204public:
210 explicit BasicDepthWalkFilter(size_t maxDepth);
211
215 ~BasicDepthWalkFilter() override = default;
216
223
230 bool beforeArray(
232 bool afterArray(
234
236 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
238 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
239
241 size_t elementIndex) override;
243 size_t elementIndex) override;
244
245private:
246 bool enterDepthLevel();
247 bool leaveDepthLevel();
248
249 size_t m_maxDepth;
250 size_t m_depth;
251};
252
262template <typename ALLOC = std::allocator<uint8_t>>
264{
265public:
271 explicit BasicRegexWalkFilter(const char* pathRegex, const ALLOC& allocator = ALLOC());
272
276 ~BasicRegexWalkFilter() override = default;
277
284
291 bool beforeArray(
293 bool afterArray(
295
297 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
299 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
300
302 size_t elementIndex) override;
304 size_t elementIndex) override;
305
306private:
308
309 void appendPath(const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex);
310 void popPath(const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex);
311 StringType getCurrentPath() const;
312 bool matchSubtree(
314
315 typename IBasicWalkFilter<ALLOC>::Path m_currentPath;
316 std::regex m_pathRegex;
317 ALLOC m_allocator; // TODO[Mi-L@]: Check how std::regex_match allocates when results are omitted!
318};
319
323template <typename ALLOC = std::allocator<uint8_t>>
325{
326public:
333
337 ~BasicArrayLengthWalkFilter() override = default;
338
345
352 bool beforeArray(
354 bool afterArray(
356
358 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
360 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
361
363 size_t elementIndex) override;
365 size_t elementIndex) override;
366
367private:
368 bool filterArrayElement(size_t elementIndex);
369
370 size_t m_maxArrayLength;
371};
372
379template <typename ALLOC = std::allocator<uint8_t>>
381{
382public:
383 using WalkFilterRef = std::reference_wrapper<IBasicWalkFilter<ALLOC>>;
385
392
396 ~BasicAndWalkFilter() override = default;
397
404
411 bool beforeArray(
413 bool afterArray(
415
417 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
419 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex) override;
420
422 size_t elementIndex) override;
424 size_t elementIndex) override;
425
426private:
427 template <typename FILTER_FUNC, typename... ARGS>
428 bool applyFilters(FILTER_FUNC filterFunc, ARGS... args)
429 {
430 bool result = true;
431 for (IBasicWalkFilter<ALLOC>& walkFilter : m_walkFilters)
432 {
434 }
435 return result;
436 }
437
438 WalkFilters m_walkFilters;
439};
440
452template <typename ALLOC>
454 m_walkObserver(walkObserver),
455 m_walkFilter(m_defaultWalkFilter)
456{}
457
458template <typename ALLOC>
463
464template <typename ALLOC>
466{
467 if (!compound)
468 {
469 throw CppRuntimeException("Walker: Root object cannot be NULL!");
470 }
471
472 const IBasicTypeInfo<ALLOC>& typeInfo = compound->getTypeInfo();
473 if (!TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
474 {
475 throw CppRuntimeException("Walker: Root object '")
476 << typeInfo.getSchemaName() << "' is not a compound type!";
477 }
478
479 m_walkObserver.beginRoot(compound);
480 walkFields(compound, typeInfo);
481 m_walkObserver.endRoot(compound);
482}
483
484template <typename ALLOC>
487{
488 if (TypeInfoUtil::hasChoice(typeInfo.getSchemaType()))
489 {
490 std::string_view compoundChoice = compound->getChoice();
491 if (!compoundChoice.empty())
492 {
494 auto fieldsIt = std::find_if(
496 return fieldInfo.schemaName == compoundChoice;
497 });
498 if (fieldsIt != fields.end())
499 {
500 walkField(compound->getField(compoundChoice), *fieldsIt);
501 }
502 }
503 // else uninitialized or empty branch
504 }
505 else
506 {
507 for (const BasicFieldInfo<ALLOC>& fieldInfo : typeInfo.getFields())
508 {
509 if (!walkField(compound->getField(fieldInfo.schemaName), fieldInfo))
510 {
511 break;
512 }
513 }
514 }
515}
516
517template <typename ALLOC>
518bool BasicWalker<ALLOC>::walkField(
519 const IBasicReflectableDataConstPtr<ALLOC>& reflectable, const BasicFieldInfo<ALLOC>& fieldInfo)
520{
521 if (reflectable && fieldInfo.isArray)
522 {
523 if (m_walkFilter.beforeArray(reflectable, fieldInfo))
524 {
525 m_walkObserver.beginArray(reflectable, fieldInfo);
526 for (size_t i = 0; i < reflectable->size(); ++i)
527 {
528 if (!walkFieldValue(reflectable->at(i), fieldInfo, i))
529 {
530 break;
531 }
532 }
533 m_walkObserver.endArray(reflectable, fieldInfo);
534 }
535 return m_walkFilter.afterArray(reflectable, fieldInfo);
536 }
537 else
538 {
539 return walkFieldValue(reflectable, fieldInfo);
540 }
541}
542
543template <typename ALLOC>
544bool BasicWalker<ALLOC>::walkFieldValue(const IBasicReflectableDataConstPtr<ALLOC>& reflectable,
545 const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex)
546{
547 const IBasicTypeInfo<ALLOC>& typeInfo = fieldInfo.typeInfo;
548 if (reflectable && TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
549 {
550 if (m_walkFilter.beforeCompound(reflectable, fieldInfo, elementIndex))
551 {
552 m_walkObserver.beginCompound(reflectable, fieldInfo, elementIndex);
553 walkFields(reflectable, typeInfo);
554 m_walkObserver.endCompound(reflectable, fieldInfo, elementIndex);
555 }
556 return m_walkFilter.afterCompound(reflectable, fieldInfo, elementIndex);
557 }
558 else
559 {
560 if (m_walkFilter.beforeValue(reflectable, fieldInfo, elementIndex))
561 {
562 m_walkObserver.visitValue(reflectable, fieldInfo, elementIndex);
563 }
564 return m_walkFilter.afterValue(reflectable, fieldInfo, elementIndex);
565 }
566}
567
568template <typename ALLOC>
570 m_maxDepth(maxDepth),
571 m_depth(1)
572{}
573
574template <typename ALLOC>
577{
578 return enterDepthLevel();
579}
580
581template <typename ALLOC>
584{
585 return leaveDepthLevel();
586}
587
588template <typename ALLOC>
591{
592 return enterDepthLevel();
593}
594
595template <typename ALLOC>
598{
599 return leaveDepthLevel();
600}
601
602template <typename ALLOC>
605{
606 return m_depth <= m_maxDepth;
607}
608
609template <typename ALLOC>
615
616template <typename ALLOC>
618{
619 const bool enter = (m_depth <= m_maxDepth);
620 m_depth += 1;
621 return enter;
622}
623
624template <typename ALLOC>
625bool BasicDepthWalkFilter<ALLOC>::leaveDepthLevel()
626{
627 m_depth -= 1;
628 return true;
629}
630
631namespace detail
632{
633
634template <typename PATH, typename ALLOC>
635BasicString<RebindAlloc<ALLOC, char>> getCurrentPathImpl(const PATH& currentPath, const ALLOC& allocator)
636{
637 BasicString<RebindAlloc<ALLOC, char>> currentPathStr(allocator);
638 for (auto it = currentPath.begin(); it != currentPath.end(); ++it)
639 {
640 if (!currentPathStr.empty())
641 {
642 currentPathStr += ".";
643 }
644 currentPathStr += *it;
645 }
646 return currentPathStr;
647}
648
649template <typename PATH, typename ALLOC>
650void appendPathImpl(
651 PATH& currentPath, const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex, const ALLOC& allocator)
652{
653 if (elementIndex == WALKER_NOT_ELEMENT)
654 {
655 currentPath.emplace_back(fieldInfo.schemaName.data(), fieldInfo.schemaName.size());
656 }
657 else
658 {
659 currentPath.back() =
660 toString(fieldInfo.schemaName, allocator) + "[" + toString(elementIndex, allocator) + "]";
661 }
662}
663
664template <typename PATH, typename ALLOC>
665void popPathImpl(
666 PATH& currentPath, const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex, const ALLOC& allocator)
667{
668 if (elementIndex == WALKER_NOT_ELEMENT)
669 {
670 currentPath.pop_back();
671 }
672 else
673 {
674 currentPath.back() = toString(fieldInfo.schemaName, allocator);
675 }
676}
677
678template <typename ALLOC>
679class SubtreeRegexWalkFilter : public IBasicWalkFilter<ALLOC>
680{
681public:
682 SubtreeRegexWalkFilter(const typename IBasicWalkFilter<ALLOC>::Path& currentPath,
683 const std::regex& pathRegex, const ALLOC& allocator) :
684 m_currentPath(currentPath),
685 m_pathRegex(pathRegex),
686 m_allocator(allocator)
687 {}
688
689 bool matches()
690 {
691 return m_matches;
692 }
693
694 bool beforeArray(
695 const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>& fieldInfo) override
696 {
697 m_currentPath.emplace_back(fieldInfo.schemaName.data(), fieldInfo.schemaName.size());
698 m_matches = std::regex_match(getCurrentPath(), m_pathRegex);
699
700 // terminate when the match is already found (note that array is never null here)
701 return !m_matches;
702 }
703
704 bool afterArray(const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>&) override
705 {
706 m_currentPath.pop_back();
707 return !m_matches; // terminate when the match is already found
708 }
709
710 bool beforeCompound(const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>& fieldInfo,
711 size_t elementIndex) override
712 {
713 appendPath(fieldInfo, elementIndex);
714 m_matches = std::regex_match(getCurrentPath(), m_pathRegex);
715
716 // terminate when the match is already found (note that compound is never null here)
717 return !m_matches;
718 }
719
720 bool afterCompound(const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>& fieldInfo,
721 size_t elementIndex) override
722 {
723 popPath(fieldInfo, elementIndex);
724 return !m_matches; // terminate when the match is already found
725 }
726
727 bool beforeValue(const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>& fieldInfo,
728 size_t elementIndex) override
729 {
730 appendPath(fieldInfo, elementIndex);
731 m_matches = std::regex_match(getCurrentPath(), m_pathRegex);
732
733 return !m_matches; // terminate when the match is already found
734 }
735
736 bool afterValue(const IBasicReflectableDataConstPtr<ALLOC>&, const BasicFieldInfo<ALLOC>& fieldInfo,
737 size_t elementIndex) override
738 {
739 popPath(fieldInfo, elementIndex);
740 return !m_matches; // terminate when the match is already found
741 }
742
743private:
744 BasicString<RebindAlloc<ALLOC, char>> getCurrentPath() const
745 {
746 return detail::getCurrentPathImpl(m_currentPath, m_allocator);
747 }
748
749 void appendPath(const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex)
750 {
751 detail::appendPathImpl(m_currentPath, fieldInfo, elementIndex, m_allocator);
752 }
753
754 void popPath(const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex)
755 {
756 detail::popPathImpl(m_currentPath, fieldInfo, elementIndex, m_allocator);
757 }
758
759 typename IBasicWalkFilter<ALLOC>::Path m_currentPath;
760 std::regex m_pathRegex;
761 ALLOC m_allocator;
762 bool m_matches = false;
763};
764
765} // namespace detail
766
767template <typename ALLOC>
769 m_pathRegex(pathRegex),
770 m_allocator(allocator)
771{}
772
773template <typename ALLOC>
776{
777 m_currentPath.emplace_back(fieldInfo.schemaName.data(), fieldInfo.schemaName.size());
778
779 if (std::regex_match(getCurrentPath(), m_pathRegex))
780 {
781 return true; // the array itself matches
782 }
783
784 for (size_t i = 0; i < array->size(); ++i)
785 {
786 m_currentPath.back() =
787 toString(fieldInfo.schemaName, m_allocator) + "[" + toString(i, m_allocator) + "]";
788
789 if (matchSubtree(array->at(i), fieldInfo))
790 {
791 return true;
792 }
793 }
794
795 m_currentPath.back() = toString(fieldInfo.schemaName, m_allocator);
796
797 return false;
798}
799
800template <typename ALLOC>
803{
804 m_currentPath.pop_back();
805 return true;
806}
807
808template <typename ALLOC>
811{
812 appendPath(fieldInfo, elementIndex);
813 if (std::regex_match(getCurrentPath(), m_pathRegex))
814 {
815 return true; // the compound itself matches
816 }
817
818 return matchSubtree(compound, fieldInfo);
819}
820
821template <typename ALLOC>
828
829template <typename ALLOC>
832{
833 appendPath(fieldInfo, elementIndex);
834 return matchSubtree(value, fieldInfo);
835}
836
837template <typename ALLOC>
844
845template <typename ALLOC>
847{
848 detail::appendPathImpl(m_currentPath, fieldInfo, elementIndex, m_allocator);
849}
850
851template <typename ALLOC>
852void BasicRegexWalkFilter<ALLOC>::popPath(const BasicFieldInfo<ALLOC>& fieldInfo, size_t elementIndex)
853{
854 detail::popPathImpl(m_currentPath, fieldInfo, elementIndex, m_allocator);
855}
856
857template <typename ALLOC>
858BasicString<RebindAlloc<ALLOC, char>> BasicRegexWalkFilter<ALLOC>::getCurrentPath() const
859{
860 return detail::getCurrentPathImpl(m_currentPath, m_allocator);
861}
862
863template <typename ALLOC>
864bool BasicRegexWalkFilter<ALLOC>::matchSubtree(
865 const IBasicReflectableDataConstPtr<ALLOC>& value, const BasicFieldInfo<ALLOC>& fieldInfo) const
866{
867 if (value != nullptr && TypeInfoUtil::isCompound(fieldInfo.typeInfo.getSchemaType()))
868 {
869 // is a not null compound, try to find match within its subtree
870 BasicDefaultWalkObserver<ALLOC> defaultObserver;
871 detail::SubtreeRegexWalkFilter<ALLOC> subtreeFilter(m_currentPath, m_pathRegex, m_allocator);
872 BasicWalker<ALLOC> walker(defaultObserver, subtreeFilter);
873 walker.walk(value);
874 return subtreeFilter.matches();
875 }
876 else
877 {
878 // try to match a simple value or null compound
879 return std::regex_match(getCurrentPath(), m_pathRegex);
880 }
881}
882
883template <typename ALLOC>
887
888template <typename ALLOC>
894
895template <typename ALLOC>
901
902template <typename ALLOC>
908
909template <typename ALLOC>
915
916template <typename ALLOC>
922
923template <typename ALLOC>
929
930template <typename ALLOC>
932{
933 return elementIndex == WALKER_NOT_ELEMENT ? true : elementIndex < m_maxArrayLength;
934}
935
936template <typename ALLOC>
940
941template <typename ALLOC>
947
948template <typename ALLOC>
954
955template <typename ALLOC>
961
962template <typename ALLOC>
968
969template <typename ALLOC>
975
976template <typename ALLOC>
982
983} // namespace zserio
984
985#endif // ZSERIO_WALKER_H_INC
BasicAndWalkFilter(const WalkFilters &walkFilters)
Definition Walker.h:937
std::reference_wrapper< IBasicWalkFilter< ALLOC > > WalkFilterRef
Definition Walker.h:383
bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:942
BasicAndWalkFilter & operator=(BasicAndWalkFilter &&other)=delete
Vector< WalkFilterRef, RebindAlloc< ALLOC, WalkFilterRef > > WalkFilters
Definition Walker.h:384
bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:963
bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:977
BasicAndWalkFilter(const BasicAndWalkFilter &other)=delete
~BasicAndWalkFilter() override=default
bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:970
bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:956
BasicAndWalkFilter(BasicAndWalkFilter &&other)=delete
bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:949
BasicAndWalkFilter & operator=(const BasicAndWalkFilter &other)=delete
BasicArrayLengthWalkFilter & operator=(const BasicArrayLengthWalkFilter &other)=delete
BasicArrayLengthWalkFilter(BasicArrayLengthWalkFilter &&other)=delete
bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:903
bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:917
bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:896
BasicArrayLengthWalkFilter(const BasicArrayLengthWalkFilter &other)=delete
~BasicArrayLengthWalkFilter() override=default
BasicArrayLengthWalkFilter & operator=(BasicArrayLengthWalkFilter &&other)=delete
bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:924
bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:910
BasicArrayLengthWalkFilter(size_t maxArrayLength)
Definition Walker.h:884
bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:889
BasicDefaultWalkFilter(BasicDefaultWalkFilter &&other)=delete
bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:187
BasicDefaultWalkFilter & operator=(BasicDefaultWalkFilter &&other)=delete
BasicDefaultWalkFilter & operator=(const BasicDefaultWalkFilter &other)=delete
bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &) override
Definition Walker.h:170
bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:175
BasicDefaultWalkFilter(const BasicDefaultWalkFilter &other)=delete
~BasicDefaultWalkFilter() override=default
bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:192
bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &) override
Definition Walker.h:165
bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:181
~BasicDefaultWalkObserver() override=default
BasicDefaultWalkObserver(BasicDefaultWalkObserver &&other)=delete
void endCompound(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:128
void endRoot(const IBasicReflectableDataConstPtr< ALLOC > &) override
Definition Walker.h:117
void beginRoot(const IBasicReflectableDataConstPtr< ALLOC > &) override
Definition Walker.h:115
void beginCompound(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:125
BasicDefaultWalkObserver & operator=(const BasicDefaultWalkObserver &other)=delete
void endArray(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &) override
Definition Walker.h:122
BasicDefaultWalkObserver(const BasicDefaultWalkObserver &other)=delete
void beginArray(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &) override
Definition Walker.h:120
void visitValue(const IBasicReflectableDataConstPtr< ALLOC > &, const BasicFieldInfo< ALLOC > &, size_t) override
Definition Walker.h:131
BasicDefaultWalkObserver & operator=(BasicDefaultWalkObserver &&other)=delete
bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:589
BasicDepthWalkFilter(size_t maxDepth)
Definition Walker.h:569
BasicDepthWalkFilter & operator=(const BasicDepthWalkFilter &other)=delete
~BasicDepthWalkFilter() override=default
bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:575
BasicDepthWalkFilter & operator=(BasicDepthWalkFilter &&other)=delete
bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:596
bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:610
bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:582
bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:603
BasicDepthWalkFilter(BasicDepthWalkFilter &&other)=delete
BasicDepthWalkFilter(const BasicDepthWalkFilter &other)=delete
BasicRegexWalkFilter & operator=(const BasicRegexWalkFilter &other)=delete
~BasicRegexWalkFilter() override=default
BasicRegexWalkFilter(const char *pathRegex, const ALLOC &allocator=ALLOC())
Definition Walker.h:768
bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:801
BasicRegexWalkFilter(const BasicRegexWalkFilter &other)=delete
bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:809
BasicRegexWalkFilter(BasicRegexWalkFilter &&other)=delete
bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:838
BasicRegexWalkFilter & operator=(BasicRegexWalkFilter &&other)=delete
bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo) override
Definition Walker.h:774
bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:830
bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex) override
Definition Walker.h:822
BasicWalker & operator=(const BasicWalker &other)=delete
BasicWalker(IBasicWalkObserver< ALLOC > &walkObserver)
Definition Walker.h:453
~BasicWalker()=default
BasicWalker(const BasicWalker &other)=delete
BasicWalker(BasicWalker &&other)=delete
void walk(const IBasicReflectableDataConstPtr< ALLOC > &compound)
Definition Walker.h:465
BasicWalker & operator=(BasicWalker &&other)=delete
virtual bool beforeArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo)=0
virtual bool beforeValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex)=0
virtual bool afterValue(const IBasicReflectableDataConstPtr< ALLOC > &value, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex)=0
virtual bool afterArray(const IBasicReflectableDataConstPtr< ALLOC > &array, const BasicFieldInfo< ALLOC > &fieldInfo)=0
virtual bool afterCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex)=0
virtual bool beforeCompound(const IBasicReflectableDataConstPtr< ALLOC > &compound, const BasicFieldInfo< ALLOC > &fieldInfo, size_t elementIndex)=0
const IBasicTypeInfo< ALLOC > & typeInfo()
Definition ITypeInfo.h:668
BasicString< RebindAlloc< ALLOC, char > > toString(T value, const ALLOC &allocator=ALLOC())
IBasicReflectableDataConstPtr< ALLOC > reflectable(const T &value, const ALLOC &allocator=ALLOC())
static bool hasChoice(SchemaType schemaType)
static bool isCompound(SchemaType schemaType)