Skip to content

SentenceRegistry

class nmeasim::core::nmea0183::SentenceRegistry · Library API

Immutable list of sentence descriptors; the only instance is standard.

#include <nmeasim/core/nmea0183/registry.hpp>

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp (line 91)

The constructor is private, so no catalogue other than standard can be built. standard is safe to call from any thread, and the registry is never modified after its initialisation.

Summary

Public member functions

Name Description
descriptors() Returns every descriptor in catalogue order.
find() Finds a descriptor by its registry id.

Public static member functions

Name Description
standard() Returns the built-in catalogue of all 29 sentences.

Private member functions

Name Description
SentenceRegistry() Creates a registry holding descriptors in the given order.

Private data members

Name Description
descriptors_ The descriptors in catalogue order.

Public member functions

descriptors()

std::span<const SentenceDescriptor> descriptors() const noexcept

Returns every descriptor in catalogue order.

Returns std::span<const SentenceDescriptor>: A view of the descriptors, valid as long as the registry.

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp:104 · defined in src/core/src/nmea0183/registry.cpp:110

find()

const SentenceDescriptor* find(std::string_view id) const noexcept

Finds a descriptor by its registry id.

Parameters

Name Type Description
id std::string_view The registry id, for example "MWV-T"; the comparison is case-sensitive.

Returns const SentenceDescriptor*: The descriptor, valid as long as the registry, or nullptr when no descriptor has that id.

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp:111 · defined in src/core/src/nmea0183/registry.cpp:114

Public static member functions

standard()

static const SentenceRegistry& standard()

Returns the built-in catalogue of all 29 sentences.

The catalogue is built on first use.

Returns const SentenceRegistry&: The registry, valid for the whole program. Its descriptors are in a stable order, grouped as in SentenceGroup, that the interface uses for display.

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp:99 · defined in src/core/src/nmea0183/registry.cpp:44

Private member functions

SentenceRegistry()

explicit SentenceRegistry(std::vector<SentenceDescriptor> descriptors)

Creates a registry holding descriptors in the given order.

Parameters

Name Type Description
descriptors std::vector<SentenceDescriptor> The catalogue; the ids are expected to be unique and are not checked.

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp:118 · defined in src/core/src/nmea0183/registry.cpp:107

Private data members

descriptors_

std::vector<SentenceDescriptor> descriptors_

The descriptors in catalogue order.

Declared in src/core/include/nmeasim/core/nmea0183/registry.hpp:121