mitiru::observe

Namespace catalog extracted from docs/API_CATALOG.md (13 types, 82 items).

Namespace catalog extracted from docs/API_CATALOG.md (13 types, 82 items).

NameKindItems
CausalEventstruct7
CausalChainclass11
DiffEntrystruct5
DiffTrackerclass6
Inspectorclass16
ObserveRouterclass6
SemanticLabelstruct7
EntitySchemastruct1
UISchemastruct1
SnapshotSchemastruct1
StructuredChangeTypeenum6
StructuredChangestruct8
StructuredDiffclass5

Free functions and typedefs

using CausalEventId = std::uint32_t;
inline constexpr CausalEventId INVALID_CAUSAL_EVENT = 0
struct CausalEvent 7
CausalEventId id = INVALID_CAUSAL_EVENT
std::string type
std::string description
std::uint64_t frame = 0
CausalEventId causeId = INVALID_CAUSAL_EVENT
std::map<std::string, std::string> data
[[nodiscard]] std::string toJson() const
class CausalChain 11
void setMaxEvents(std::size_t max) noexcept
CausalEventId record(const std::string& type, const std::string& description, std::uint64_t frame, CausalEventId causeId = INVALID_CAUSAL_EVENT, const std::map<std::string, std::string>& data = {})
[[nodiscard]] std::vector<CausalEvent> getChain(CausalEventId eventId) const
[[nodiscard]] std::vector<CausalEvent> getEffects(CausalEventId eventId) const
[[nodiscard]] std::vector<CausalEvent> getByType(std::string_view type) const
[[nodiscard]] std::vector<CausalEvent> getInRange( std::uint64_t fromFrame, std::uint64_t toFrame) const
[[nodiscard]] const CausalEvent* getEvent(CausalEventId id) const
void clear()
[[nodiscard]] std::size_t eventCount() const
[[nodiscard]] std::string toJson() const
[[nodiscard]] static std::string toJson(const std::vector<CausalEvent>& events)
struct DiffEntry 5
std::string key
std::string oldValue
std::string newValue
std::uint64_t frame = 0
[[nodiscard]] std::string toJson() const
class DiffTracker 6
void beginFrame(std::uint64_t frame) noexcept
void recordState(const std::string& key, const std::string& value)
[[nodiscard]] std::vector<DiffEntry> endFrame()
[[nodiscard]] static std::string toJson(const std::vector<DiffEntry>& diffs)
void reset()
#pragma once #include <atomic> #include <cstdint> #include <functional> #include <map> #include <mutex> #include <string> #include <string_view> #include <thread> #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef NOMINMAX #define NOMINMAX #endif #include <winsock2.h> #include <ws2tcpip.h> #pragma comment(lib, "ws2_32.lib") #else #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include <unistd.h> #endif namespace mitiru::observe
class Inspector 16
Inspector() = default
explicit Inspector(std::size_t historyCapacity)
void registerState(const std::string& key, const std::string& value)
[[nodiscard]] std::optional<std::string> queryState(const std::string& key) const
[[nodiscard]] std::string queryAll() const
[[nodiscard]] std::string queryByPrefix(std::string_view prefix) const
bool removeState(const std::string& key)
void clear() noexcept
[[nodiscard]] std::size_t stateCount() const noexcept
bool commitSnapshot()
[[nodiscard]] std::optional<std::string> queryAt( std::size_t framesBack, const std::string& key) const
[[nodiscard]] std::string queryAllAt(std::size_t framesBack) const
[[nodiscard]] std::size_t historyDepth() const noexcept
[[nodiscard]] std::size_t historyCapacity() const noexcept
void clearHistory() noexcept
[[nodiscard]] inline std::string jsonEscape(std::string_view input)
class ObserveRouter 6
ObserveRouter(Engine& engine, Inspector& inspector, InputInjector& inputInjector)
void setupRoutes(HttpServer& server)
using QueryParams = std::map<std::string, std::string>;
[[nodiscard]] inline std::string extractPath(std::string_view url)
[[nodiscard]] inline QueryParams parseQuery(std::string_view url)
[[nodiscard]] inline std::optional<std::string> getParam( const QueryParams& params, const std::string& key)
struct SemanticLabel 7
std::vector<std::string> labels
void addLabel(const std::string& label)
[[nodiscard]] bool hasLabel(const std::string& label) const
void removeLabel(const std::string& label)
[[nodiscard]] std::size_t size() const noexcept
[[nodiscard]] bool empty() const noexcept
[[nodiscard]] std::string toJson() const
struct EntitySchema 1
[[nodiscard]] static std::string schemaJson()
struct UISchema 1
[[nodiscard]] static std::string schemaJson()
struct SnapshotSchema 1
[[nodiscard]] static std::string schemaJson()
enum StructuredChangeType : std::uint8_t 6
EntityCreated
EntityDestroyed
ComponentAdded
ComponentRemoved
ComponentChanged
ParentChanged
struct StructuredChange 8
StructuredChangeType type
scene::EntityId entityId = 0
std::string entityName
std::string componentType
std::string oldValue
std::string newValue
std::uint64_t frame = 0
[[nodiscard]] std::string toJson() const
class StructuredDiff 5
[[nodiscard]] std::vector<StructuredChange> diff(scene::GameWorld& world, std::uint64_t frame)
template <typename T> void registerSerializer(const std::string& typeName, std::function<std::string(const T&)> serializer)
void reset()
[[nodiscard]] std::size_t trackedEntityCount() const noexcept
[[nodiscard]] static std::string toJson(const std::vector<StructuredChange>& changes)

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.