Create collection type value objects without an open connection
You can create collection type value objects without an open connection by using a process similar to creating row types. As with row types, ITDatum::Data() and ITDatum::SetData() cannot be used to retrieve or modify values from a collection type created without an open connection.
The following example illustrates how to create a collection type
value object without an open connection:
#include <iostream.h>
#include <it.h>
int
main()
{
ITConnection conn;
ITMVDesc desc;
ITTypeInfo memberType(conn,"integer", 4,-1,-1,-1,1);
ITTypeInfo newti( conn, "set(integer not null)",
"set", memberType, NULL );
desc.vf_origtypeinfo = (ITTypeInfo *) &newti;
desc.vf_connection = &conn;
desc.vf_typedesc = NULL;
desc.vf_preservedata = NULL;
desc.vf_outerunknown = NULL;
desc.vf_datalength = newti.Size();
desc.vf_libmivaluetype = MI_NULL_VALUE;
desc.vf_data = NULL;
ITValue *val = ITFactoryList::DatumToValue (desc);
val->FromPrintable("set{1}");
cout << val->Printable() << endl;
val->Release();
}