23 std::cout <<
"=== Value Store Example ===" << std::endl;
28 std::cout <<
"\n1. Adding values:" << std::endl;
29 store.add(
"host",
value(
"host", std::string(
"localhost")));
30 store.add(
"port",
value(
"port",
static_cast<int32_t
>(8080)));
31 store.add(
"debug",
value(
"debug",
true));
32 std::cout <<
" Size: " << store.size() << std::endl;
35 std::cout <<
"\n2. Reading values:" << std::endl;
36 auto host = store.get(
"host");
39 std::cout <<
" host found: yes" << std::endl;
43 std::cout <<
"\n3. Contains check:" << std::endl;
44 std::cout <<
" 'host': " << (store.contains(
"host") ?
"yes" :
"no") << std::endl;
45 std::cout <<
" 'missing': " << (store.contains(
"missing") ?
"yes" :
"no") << std::endl;
48 std::cout <<
"\n4. Remove 'debug':" << std::endl;
49 store.remove(
"debug");
50 std::cout <<
" Size after remove: " << store.size() << std::endl;
53 std::cout <<
"\n5. Access statistics:" << std::endl;
54 std::cout <<
" Read count: " << store.get_read_count() << std::endl;
55 std::cout <<
" Write count: " << store.get_write_count() << std::endl;
57 store.reset_statistics();
58 std::cout <<
" After reset - reads: " << store.get_read_count()
59 <<
", writes: " << store.get_write_count() << std::endl;
63 std::cout <<
"\n6. After clear: empty=" << (store.empty() ?
"yes" :
"no") << std::endl;
65 std::cout <<
"\nDone." << std::endl;