Closed gravitystorm closed 9 years ago
Perhaps the "context_holder" approach in _mapnik_feature.rb.cpp
could be a useful approach?
This is still something I'd like to see, but having this PR open isn't likely to make it happen any sooner it seems.
I've started implementing AttributeCollector, which is required for a project that I'm working on (see https://github.com/gravitystorm/mapnik-legendary/issues/1 if you're interested)
Unfortunately my monkey-see-monkey-do style of C++ programming has run out of juice, and so any help here would be appreciated.
The C++ mapnik::attribute_collector would be distinctly un-ruby-ish, so I've written some tests to flesh out how I think it should behave:
Now I'm stumped on how to write the
define_constructor
anddefine_method
sections, since they are mostly unrelated to the C++ constructor and methods. For example, the C++ constructor takes a std::set of strings by reference in its signature, and I don't want to do that in ruby.Any suggestions of approaches would be appreciated, or if someone can point my to something similar that already exists in Ruby-Mapnik then I'll go back to my monkey-see approach :-).