-
Notifications
You must be signed in to change notification settings - Fork 919
Rethinking the Values interface #1389
Description
The current GTSAM Values Value and GenericValue is largely a cascade of workarounds when we migrated from GTSAM 3 to 4. In light of moving in the direction of retiring Boost and having a generic Values container that is (most likely) just a STL container, we need to figure out a way of cleaning up these classes.
The Values object uses boost::ptr_map and clone_-deallocate pairs for memory pool/arena support, which is totally unused by the GenericValue mechanism. Thus the "fast allocators" are kinda nonsense-they never allocate real objects from the custom allocator, only the pair<Key, Value*> since 2014...
The interface of Values, i.e. the iterators (boost::transform_iterator) has few users and in my opinion can be replaced by just returning the interior iterators of the map.
For custom allocation, a great reference is https://www.youtube.com/watch?v=kSWfushlvB8, which covered all the details of making a container allocator-aware, and how to brew your own arena/pools.