Container System 0.1.0
High-performance C++20 type-safe container framework with SIMD-accelerated serialization
Loading...
Searching...
No Matches
value_view.h File Reference

Zero-copy value view for efficient data access. More...

#include "core/value_types.h"
#include <string>
#include <string_view>
#include <cstdlib>
#include <optional>
#include <type_traits>
Include dependency graph for value_view.h:

Go to the source code of this file.

Classes

class  kcenon::container::value_view
 Zero-copy value view for efficient read access. More...
 
struct  kcenon::container::value_index_entry
 Value index entry for lazy parsing. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::container
 

Detailed Description

Zero-copy value view for efficient data access.

This header provides value_view class for zero-copy access to serialized data. Instead of copying values during deserialization, value_view points directly into the original buffer, providing significant performance improvements for large messages.

Usage:

auto container = std::make_shared<value_container>(large_data, true);
// Zero-copy access (no allocation)
if (auto view = container->get("large_text", as_view)) {
std::string_view text = view->as_string_view();
// Use text without copying...
// Copy only when needed
std::string owned = view->as_string();
}

Definition in file value_view.h.