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

Async wrapper for value_container operations. More...

#include "task.h"
#include "generator.h"
#include "core/container.h"
#include "core/container/error_codes.h"
#include <algorithm>
#include <atomic>
#include <fstream>
#include <functional>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <thread>
#include <vector>
Include dependency graph for async_container.h:

Go to the source code of this file.

Classes

struct  kcenon::container::async::detail::async_state< T >
 Shared state for async operations. More...
 
struct  kcenon::container::async::detail::async_awaitable< T >
 Awaitable that runs work in a separate thread. More...
 
class  kcenon::container::async::async_container
 Async wrapper for value_container operations. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::container
 
namespace  kcenon::container::async
 
namespace  kcenon::container::async::detail
 

Typedefs

using kcenon::container::async::progress_callback = std::function<void(size_t bytes_processed, size_t total_bytes)>
 Progress callback type for async file operations.
 

Functions

template<typename F >
auto kcenon::container::async::detail::make_async_awaitable (F &&func) -> async_awaitable< std::invoke_result_t< F > >
 
task< std::vector< uint8_t > > kcenon::container::async::read_file_async (std::string_view path, progress_callback callback=nullptr)
 Read file contents asynchronously.
 
task< bool > kcenon::container::async::write_file_async (std::string_view path, std::span< const uint8_t > data, progress_callback callback=nullptr)
 Write data to file asynchronously.
 

Detailed Description

Async wrapper for value_container operations.

Provides coroutine-based async API for container serialization and deserialization operations.

// Example usage:
task<void> process() {
auto container = std::make_shared<value_container>();
container->set("key", "value");
async_container async_cont(container);
auto data = co_await async_cont.serialize_async();
if (data.is_ok()) {
// Use serialized data
}
}
See also
kcenon::container::async::async_container

Definition in file async_container.h.