Version 4.6
#285
Replies: 2 comments 1 reply
-
Awesome, yeah this all looks good. Is there anything you need from me? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ok this is complete. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@jasonroelofs I'm planning on creating a new Rice release, 4.6, in the next few weeks. It has a bunch more changes that I needed to successfully wrap OpenCV. Once again, it is not fully backwards compatible with the previous version (define_methods changed for stl classes, see below):
Introduce new Buffer class to handle C style array arguments of fundamental types or C++ classes - both reading and writing. This change also enables support of C style output parameters (references or pointers). It did require introducing an optional rice_init function.
Rewrite keyword arguments and default value handling. Previously if a keyword argument was skipped, even if it had a default value, Rice would crash. As part of this handling of default values moved to NativeFunction from FromRuby. This centralizes the code and removes a lot of boilerplate.
Make Rice somewhat const aware. Rice now stores whether a wrapped C++ object is constant or not. Second, when calling a C++ method the method overloading code will not send a const value to a non-const parameter. It will send a non-const value to a const parameter, but prefers non-const to non-const or const to const. Note const checking is only applied for method overloads.
Improve error messages when Rice cannot determine what overloaded method to call.
Track unbound Data_Type instance with a std::vector instead of sett::set because the static member set causes crashes on clang and g++ compiled binaries at startup (msvc is fine).
Make Enums more useful by adding coerce method to enable stringing together bitwise operators - for example Season::Winter | Season::Spring | Season::Summer.
Add Return#setArray and #isArray to allow users to specify that a returned pointer is actually a C array.
Add Rice version macros
Include
Rice::VERSION
in published gemSTL updates:
Update std::vector to expose more constructors and support cloning via the copy constructor
Update STL define methods (define_vector, define_set, etc) to align with STL. The STL has methods like make_shared while Rice was doing define_shared<std::shared_ptr>. Rice has now switched to define_shared. Note this is not a backwards compatible change, but easy to adopt.
Add compile time checks to see if wrapper code is using STL classes (vectors, sets) but has not included rice/stl.hpp. Not including rice/stl.hpp results in strange, hard to track down bugs.
Add multimap support
Add support for std::set
Update shared_ptr implementation to work better with fundamental types.
Fix double free error caused by releasing unique_ptr's too late. Also check for Qnil values and returning null pointers.
Revamp Wrapper class, split smart_ptr into unique_ptr and shared_ptr.
Move autogenerated Stl classes from Rice::Std module to just Std:: which more naturally maps to C++ and is more consistent with wrapping other C++ libraries. For example, OpenCv classes are under the Cv namespace to match the C++ library.
Add support for std::complex passed by reference.
Beta Was this translation helpful? Give feedback.
All reactions