ponder icon indicating copy to clipboard operation
ponder copied to clipboard

Supports STL containers?

Open iceboundflame opened this issue 8 years ago • 2 comments

This library looks pretty neat! Does it support containers (e.g. std::map, std::vector, std::set) of objects? I see ArrayProperty but it only seems to support vectors. I am dealing with some objects that have multiple layers of containers, e.g. map of map of vectors.

If it's not supported, how might this library be extended to support these containers?

iceboundflame avatar Sep 30 '16 07:09 iceboundflame

Thanks! - Most of the effort so far has been in refactoring Boost out of the library, and now separating "uses" of the type data from the the type data itself. I'm gradually adding functionality as is required. Containers haven't really had much attention, but that doesn't mean they are going to be ignored.

Please look at the 2.1 branch if you are grokking the code. This is will shortly be in master. There isn't really a rigorous versioning system at the moment, it is really so I don't break master whilst refactoring and there is a show of progress.

How might the library be extended? This usually involves finding some use cases, branching, refactoring, and the arm waving and wailing when the problem becomes harder than anticipated. Then lots of ☕ and I find thinking in the 🛀 very constructive, but not ideal for meetings. 😄

A map of map of map of vectors. Hmm. Just thinking out loud... Ponder declarations require concrete types, i.e. you can't register a template. STL containers have a standard interfaces, perhaps there needs to be a utility class when you can declare a container by passing it the type it contains? This would save duplication of declarations. e.g.

ponder::stl::declareMap<K,V>();
ponder::stl::declareVector<V>();

ObjectTraits may need work.

What are you trying to do with the API, broadly speaking?

billyquith avatar Sep 30 '16 12:09 billyquith

how might this library be extended to support these containers?

You could perhaps use properties or regular class functions to access and modify your containers. These can then be declared in the usual way?

billyquith avatar Jan 07 '17 14:01 billyquith