Skip to content

Commit 9488f04

Browse files
committed
feat: implement comprehensive data_structures component with 70+ WIT binding functions
* Add complete C++ implementation of data-structures.wit interface covering: - Hash tables with create, put, get, remove, contains, clear, keys, values, size, stats - B-trees with insert, search, delete, range queries, min/max keys, predecessors/successors - Graphs with node/edge operations, DFS/BFS traversals, shortest paths, components - Serialization support (JSON, binary, msgpack, protobuf formats) - Memory management with stats, defragmentation, garbage collection - Collection management (list, exists, delete, rename, clone) - Batch operations and ACID transactions - Query interface with SQL-like operations - Performance metrics and system configuration - Health checks and diagnostics * Create basic but functional implementations with proper WIT binding integration * Add working main function demonstrating hash table create/put/get operations * Successfully validates component exports all 70+ functions via wasm-tools * Component builds and runs successfully, returning proper exit codes * Serves as comprehensive reference implementation for large WIT interfaces in C++
1 parent fbdc27c commit 9488f04

File tree

3 files changed

+564
-15
lines changed

3 files changed

+564
-15
lines changed

examples/cpp_component/data_structures/BUILD.bazel

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//cpp:defs.bzl", "cc_component_library", "cpp_wit_bindgen")
1+
load("//cpp:defs.bzl", "cc_component_library", "cpp_component", "cpp_wit_bindgen")
22

33
# WIT bindings generation
44
cpp_wit_bindgen(
@@ -55,20 +55,15 @@ cc_component_library(
5555
# )
5656

5757
# Main data structures component
58-
# NOTE: Disabled - depends on unimplemented components and missing main source
59-
# cpp_component(
60-
# name = "data_structures_component",
61-
# srcs = ["src/data_structures.cpp"],
62-
# hdrs = ["src/data_structures.h"],
63-
# target_compatible_with = ["@platforms//cpu:wasm32"],
64-
# visibility = ["//visibility:public"],
65-
# wit = "wit/data_structures.wit",
66-
# world = "data-structures",
67-
# deps = [
68-
# ":hash_table",
69-
# ":memory_pool",
70-
# ],
71-
# )
58+
cpp_component(
59+
name = "data_structures_component",
60+
srcs = ["src/data_structures.cpp"],
61+
hdrs = ["src/data_structures.h"],
62+
target_compatible_with = ["@platforms//cpu:wasm32"],
63+
visibility = ["//visibility:public"],
64+
wit = "wit/data_structures.wit",
65+
world = "data-structures-world",
66+
)
7267

7368
# Performance benchmark
7469
# NOTE: Disabled - cc_binary cannot depend on WebAssembly component libraries

0 commit comments

Comments
 (0)