|
glibmm
2.45.50
|
A utility for converting between std::vector and plain C arrays. More...
#include <glibmm/vectorutils.h>
Public Types | |
| typedef Tr::CType | CType |
| typedef T | CppType |
| typedef std::vector< CppType > | VectorType |
| typedef Glib::Container_Helpers::ArrayKeeper< Tr > | ArrayKeeperType |
| typedef Glib::Container_Helpers::ArrayIterator< Tr > | ArrayIteratorType |
Static Public Member Functions | |
| static VectorType | array_to_vector (const CType* array, std::size_t array_size, Glib::OwnershipType ownership) |
| static VectorType | array_to_vector (const CType* array, Glib::OwnershipType ownership) |
| static ArrayKeeperType | vector_to_array (const VectorType& vector) |
A utility for converting between std::vector and plain C arrays.
This would normally only be used by glibmm or gtkmm itself, or similar libraries that wrap C APIs.
For instance:
or
Note that usage below is wrong - data() returns a pointer to data owned by a temporary ArrayKeeper returned by vector_to_array(), which is destroyed at the end of this instruction. For details, see Glib::ArrayKeeper.
| typedef Glib::Container_Helpers::ArrayIterator<Tr> Glib::ArrayHandler< T, Tr >::ArrayIteratorType |
| typedef Glib::Container_Helpers::ArrayKeeper<Tr> Glib::ArrayHandler< T, Tr >::ArrayKeeperType |
| typedef T Glib::ArrayHandler< T, Tr >::CppType |
| typedef Tr::CType Glib::ArrayHandler< T, Tr >::CType |
| typedef std::vector<CppType> Glib::ArrayHandler< T, Tr >::VectorType |
|
static |
|
static |
|
static |
1.8.9.1