neufeldm / akamai-radix-tree

A generic C++ radix tree library, built by the Mapper team at Akamai Technologies.
https://akamai.com
MIT License
33 stars 5 forks source link

Address Rigid Binary WORM Tree Typing #6

Open neufeldm opened 5 years ago

neufeldm commented 5 years ago

Currently the types for the binary WORM nodes are heavily templated based on offset integer size/endian and the exact type of value stored (for integers this is also based on size/endian). This rigidity is good for keeping the exact type of the byte buffer organized, but is also very inflexible. For example, it could be very convenient to dynamically create a WORM tree handler for a buffer based on metadata stored alongside that buffer. My initial inclination is to fix this by adding a virtual dynamically typed class hierarchy that hides the underlying rigid types. One alternative to this would be to restructure the WORM tree code to use a dynamically typed class hierarchy from the ground up.

neufeldm commented 5 years ago

work for this on feature/abstract-worm-builder

neufeldm commented 5 years ago

Added abstract WORM tree/cursor classes, utilities for creating UINT-based WORM trees which I expect will be the most common time. Have to watch build time - the generic routines appear to cause some compile-time bloat. I tried both templated and macro versions with similar performance results.