* These map more naturally to python tuples and are easier to wrap in and out.
* We also tidy up the FloatVecVal etc and standardise the members of
ShaderValue.
* This is to support python bindings - the pyside implementation of
QVector, QString, etc is not available to SWIG, so SWIG treates these
all as opaque types.
* Rather than trying to set up bindings that work for rdcarray and
QList/QVector, or implementing separate bindings, we instead just say
that the public interface must use the rdc types. In most cases they
seamlessly convert to/from Qt types anyway.
* In a couple of places we use an array of pairs instead of a map. In
future we probably want an rdcdict or rdcmap with proper dict bindings
in python.
* Note that while this is public and uses std::string, because it's a
template with specialisations in a .inl the string never crosses a
module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
yet switched over the serialisation system to expect all structs to
have serialise functions.
* We have some special handling to allow SWIG wrapping of these types:
SDFile owns the chunks and buffers within, and each object owns its
children. Copying is disallowed except from SWIG where we assume the
wrapper is handling lifetime management for its objects externally.
* Previously we would convert from python to C++ arrays immediately by
copying, and vice-versa convert TO python immediately by creating a
new python list by copying.
* This however behaves rather poorly in common situations, e.g.:
> foo.bar.append(5)
Would not append 5 to foo.bar, but copy foo.bar to a temporary, append
5 to it, then destroy it leaving foo.bar untouched.
* Instead we leave the C++ array type as a pointer for as long as we can
and instead implement the python sequence API as extensions/slots that
work in-place on the original array.
* Since these types are more prevalent than originally designed, it
makes more sense to remove the namespace for ease of typing/naming.
* Also add a specialised type 'bytebuf' for an array of bytes.
* This makes mapping easier to SWIG since there's no special casing for
namespaced arrays. Especially so for nested cases like
rdctype::array<rdctype::str> -> rdcarray<rdcstr>
* The former is only needed inside tp_init of a new object. Instead when
we want to pass in and own a pointer, we use SWIG_POINTER_OWN.
* This also removes the need to pass 'self' all the way down in
ConvertToPy which tidies up a lot of code.