COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
comms::option::app::OrigDataView Struct Reference

#include "comms/options.h"

Detailed Description

Use "view" on original raw data instead of copying it.

Can be used with comms::field::String and raw data comms::field::ArrayList.
For comms::field::String it will force usage of std::string_view (if available) as inner storage type (instead of std::string). In case std::string_view is unavalable (C++17 support is disabled or standard library of insufficient version) comms::util::StringView will be used instead.
For raw data comms::field::ArrayList it will force usage of std::span<std::uint8_t>(if available) as inner storage type (instead of std::vector<std::uint8_t>). In case std::span is unavalable (C++20 support is disabled or standard library of insufficient version) comms::util::ArrayView will be used instead.

Note
The original data must be preserved until destruction of the field that uses the "view".
Incompatible with other options that contol data storage type, such as comms::option::app::CustomStorageType or comms::option::app::FixedSizeStorage
To force usage of provided comms::util::StringView or comms::util::ArrayView instead of standard std::string_view or std::span, use comms::option::app::CustomStorageType option.

The documentation for this struct was generated from the following file: