Repository for ResQ C++ libraries distributed via vcpkg.
A zero-dependency, header-only C++17 utility library providing data structures and algorithms (DSA), error handling, file/string/array utilities, and geospatial primitives. Uses only the C++ standard library -- no external dependencies required.
include(FetchContent)
FetchContent_Declare(resq-common
GIT_REPOSITORY https://github.com/resq-software/vcpkg.git
GIT_TAG resq-common@v0.1.0
SOURCE_SUBDIR packages/resq-common)
FetchContent_MakeAvailable(resq-common)
target_link_libraries(myapp PRIVATE resq::common)vcpkg install resq-commontarget_include_directories(myapp PRIVATE path/to/packages/resq-common/include)Probabilistic and graph data structures optimized for drone swarm coordination.
BloomFilter -- Probabilistic set membership with configurable false-positive rate.
#include <resq/dsa/bloom.hpp>
resq::BloomFilter filter(10000, 0.01); // 10k elements, 1% FP rate
filter.add("drone_001");
assert(filter.possibly_contains("drone_001")); // trueCountMinSketch -- Frequency estimation for streaming data.
#include <resq/dsa/count_min.hpp>Graph -- Adjacency-list graph with Dijkstra and A* pathfinding.
#include <resq/dsa/graph.hpp>
resq::Graph<std::string> g;
g.add_edge("A", "B", 1.0);
g.add_edge("B", "C", 2.0);
auto result = g.dijkstra("A", "C");BoundedHeap -- Fixed-capacity min/max heap for top-K selection.
#include <resq/dsa/heap.hpp>Trie -- Prefix tree for string-based lookups.
#include <resq/dsa/trie.hpp>Rust-inspired Result<T> type for explicit error handling without exceptions.
#include <resq/result.hpp>
resq::Result<int> parse_port(const std::string& s) {
if (s.empty()) return resq::Result<int>::Err(400, "Port cannot be empty");
int port = std::stoi(s);
return resq::Result<int>::Ok(port);
}
auto result = parse_port("8080");
if (result.is_ok()) {
int port = result.unwrap();
}Safe filesystem operations with Result-based error handling.
#include <resq/file_utils.hpp>Text processing helpers (trim, split, join, case conversion).
#include <resq/string_utils.hpp>SIMD-optimized operations on sorted uint32_t arrays (intersection, union, difference).
#include <resq/array_utils.hpp>Geographic primitives for drone navigation using the WGS84 coordinate system. Includes distance calculations and coordinate validation.
#include <resq/common/geo.hpp>resq/env_utils.hpp-- Environment variable accessresq/common/time.hpp-- Time utilitiesresq/common/nfz.hpp-- No-fly zone domain helpersresq/resq_common.hpp-- Convenience header (includes everything)
cmake -B build -DRESQ_COMMON_BUILD_TESTS=ON packages/resq-common
cmake --build build --config Debugctest --test-dir build -C Debug --output-on-failure