Re: C++ templates equivalent in GObject



On Sun, 15 Mar 2003, Jerry Kakol wrote:

> Is there a generic, prescription like method to implement equivalency of
> C++ templates using GObject? Let's say a template of an dynamicaly sized
> array parameterized by the type of elements to be stored.
> Some kind of solution are GArray and GByteArray, but they are not
> GObjects. And far from being generic.

There is GValueArray which is dynamically resizable and can hold
values of any types registered with the type system.
it doesn't however enforce "parameterization" through an element
type, as each array member may have a different type. using
g_param_spec_value_array() you get a pspec though that can be
used to prescribe an element type for a value array (e.g. as object
property) and can also be used to validate and enforce a specific
element type in an existing value array (g_param_value_validate).

> Thanks.
>
> --
> Jerry Kakol <jkakol cox net>
>

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]