glibmm: Glib::ArrayHandler< T, Tr > Class Template Reference
A utility for converting between std::vector and plain C arrays. More...
#include <glibmm/vectorutils.h>
Public Types |
|
using | CType = typename Tr::CType |
using | CppType = T |
using | VectorType = std::vector < CppType > |
using | ArrayKeeperType = typename Glib::Container_Helpers::ArrayKeeper < Tr > |
using | ArrayIteratorType = typename Glib::Container_Helpers::ArrayIterator < Tr > |
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) |
Detailed Description
template<typename T, typename Tr = Glib::Container_Helpers::TypeTraits<T>>
class Glib::ArrayHandler< T, Tr >
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.
Member Typedef Documentation
using Glib::ArrayHandler < T, Tr >:: ArrayIteratorType = typename Glib::Container_Helpers::ArrayIterator <Tr> |
using Glib::ArrayHandler < T, Tr >:: ArrayKeeperType = typename Glib::Container_Helpers::ArrayKeeper <Tr> |
using Glib::ArrayHandler < T, Tr >:: CppType = T |
using Glib::ArrayHandler < T, Tr >:: CType = typename Tr::CType |
using Glib::ArrayHandler < T, Tr >:: VectorType = std::vector < CppType > |
Member Function Documentation
|
static |
|
static |
|
static |