| 98 | { |
| 99 | |
| 100 | bool valid(Graph *g, std::unique_ptr<ErrorListener> &&l) |
| 101 | { |
| 102 | class ErrorCounter final : public ErrorListener |
| 103 | { |
| 104 | public: |
| 105 | uint32_t count(void) const { return _count; } |
| 106 | |
| 107 | public: |
| 108 | void notify(const ErrorDetail<ErrorCategory::MissingArgument> &) { _count += 1; } |
| 109 | |
| 110 | private: |
| 111 | uint32_t _count = 0; |
| 112 | }; |
| 113 | |
| 114 | ErrorCounter counter; |
| 115 | graph_verifier(g).enroll(&counter).enroll(std::move(l)).run(); |
| 116 | return counter.count() == 0; |
| 117 | } |
| 118 | |
| 119 | } // namespace loco |