MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Collector.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Request.hpp"
4
6
7/**
8 * @class RequestCollector
9 * @brief Turns each MF_DESCRIBE alias in the scanned translation unit into a RecordRequest.
10 *
11 * Attach it to a MatchFinder, run the finder, then read requests() and errors().
12 * Requests are grouped by the header holding the marker.
13 */
14class RequestCollector : public clang::ast_matchers::MatchFinder::MatchCallback {
15public:
16 /** @brief Registers the matcher for the marker aliases on @p finder. */
17 void attach(clang::ast_matchers::MatchFinder& finder);
18
19 void run(const clang::ast_matchers::MatchFinder::MatchResult& result) override;
20
21 [[nodiscard]] const RequestMap& requests() const noexcept { return m_requests; }
22 [[nodiscard]] const std::vector<std::string>& errors() const noexcept { return m_errors; }
23
24 /** @brief Marker aliases the matcher reached, before any filtering. */
25 [[nodiscard]] std::size_t matched() const noexcept { return m_matched; }
26
27 /** @brief Marker aliases ignored for sitting in a system header or an invalid location. */
28 [[nodiscard]] std::size_t skipped() const noexcept { return m_skipped; }
29
30private:
31 bool store(const std::filesystem::path& header, RecordRequest request, const std::string& where);
32
33 void describe_nested(const clang::CXXRecordDecl* record, const std::filesystem::path& header,
34 unsigned line, const clang::SourceManager& manager);
35
37 std::vector<std::string> m_errors;
38 std::size_t m_matched {};
39 std::size_t m_skipped {};
40};
41
42}
std::vector< std::string > m_errors
Definition Collector.hpp:37
bool store(const std::filesystem::path &header, RecordRequest request, const std::string &where)
void describe_nested(const clang::CXXRecordDecl *record, const std::filesystem::path &header, unsigned line, const clang::SourceManager &manager)
std::size_t matched() const noexcept
Marker aliases the matcher reached, before any filtering.
Definition Collector.hpp:25
std::size_t skipped() const noexcept
Marker aliases ignored for sitting in a system header or an invalid location.
Definition Collector.hpp:28
const std::vector< std::string > & errors() const noexcept
Definition Collector.hpp:22
void attach(clang::ast_matchers::MatchFinder &finder)
Registers the matcher for the marker aliases on finder.
const RequestMap & requests() const noexcept
Definition Collector.hpp:21
Turns each MF_DESCRIBE alias in the scanned translation unit into a RecordRequest.
Definition Collector.hpp:14
void run()
Definition main.cpp:21
std::map< std::filesystem::path, HeaderRequests > RequestMap
Definition Request.hpp:30
std::pair< std::shared_ptr< Kriya::BufferPipeline >, std::shared_ptr< Buffers::AudioBuffer > > record(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, uint32_t input_channel, double seconds, std::optional< uint32_t > monitor, uint32_t channel)
Record a live input channel into a stream for a number of seconds.
Definition Rigs.cpp:262
One described record: its qualified name and the names of its public data members.
Definition Request.hpp:15