Swati Setty wrote:
> Actually i have void * data which i want to copy it into the vector.One
> additional information about the data is data type.
> Acoording the data type i have to use vector of that type.Suppose i have
> int data type of the data then i have to create the vector of type int like
> that...........for that i required the data type in VXL.
I'm sorry, but I don't understand your question.
1. What vector --- a vcl_vector<T>, vnl_vector<T> or something else.
2. I really don't know what you mean by "the data type in VXL". VXL is
written in C++. It uses the standard C++ data types, e.g. int, float,
bool, etc. The length of these types depends on your particular platform
(processor, and compiler,) as described by the C++ standard.
Additionally VXL provides some macros for explicit length (generally
assumed to be two's complement) types in vxl_config.h.
3.This is my best guess at what you are trying to ask for:
Given a void * pointer (p), a number of elements (n), and a enum (t)
describing the type; Assuming that the binary encoding and endianess of
the data match the default expectations of your platform; And you want
to wrap that data in a numeric vector, then your code might look like
process_data(void *p, unsigned n, my_type_description t)
vnl_vector_ref<vxl_ieee_32> data(n, p);
vnl_vector_ref<vxl_int_32> data(n, p);