SDKs

C++ SDK

Header-only. C++20. No dependencies beyond the standard library.

Install

bash
500"># vcpkg
vcpkg install attos

500"># or drop attos.hpp into your include path

Lookup

main.cpp
class="text-zinc-class="text-amber-300">500">#include <attos/attos.hpp>
class="text-zinc-class="text-amber-300">500">#include <iostream>

class="text-primary">int main() {
    class="text-primary">auto db = attos::open("routes.nh");
    class="text-primary">if (class="text-primary">auto idx = db.lookup("api.example.com")) {
        std::cout << "backend " << *idx << "\n";
    }
    class="text-primary">return class="text-amber-300">0;
}

Zero-copy access

The artifact is mmap'd. Lookups touch at most 2 cache lines.

cpp
class="text-primary">auto view = db.value_view(idx);
process(view.data(), view.size());