Native Data Type for array of 8/16/32 for compound Type datasets


#1

Hi ,

I am not able to get type of array of 8 bit integers ,can any one help me on this.


#2

Can you please upload a short self contained compileable example, specify the environment: os, configuration, compiler etc…

Generally it should work for all recent editions on Posix compliant OS.

If this is not a technical problem, but understanding how compound datatypes work and c++ is an option for you: check out H5CPP a seamless persistence for modern c++ with compiler assisted reflection. The compiler will generate the correct compound datatype descriptors for arbitrary deep POD types. Here is my presentation on it

Best wishes: steven


#3

Hi Steven ,
Thanks for reply, Actually I am trying to read the data member names and types of compound data type.
However I am able to get all the names and types using API’s provided ,while if I want to get datatype of member having its types as below Datatypes

I am able to get all the data types by using following code as below
hid_t memb_id = H5Tget_member_type(native_type1, signalmembertype);
if (H5Tequal(memb_id, H5T_NATIVE_INT))
{
datatype = “int”;
//columnsize = sizeof(int);
}

else if (H5Tequal(memb_id, H5T_NATIVE_SHORT)) {
	datatype = "short";
	//columnsize = columnsize + sizeof(short);
}

else if (H5Tequal(memb_id, H5T_NATIVE_LONG)) {
	datatype = "long";
	//columnsize = columnsize + sizeof(long);
}

else if (H5Tequal(memb_id, H5T_NATIVE_LLONG)) {
	datatype = "long long";
	//columnsize = columnsize + sizeof(long long);
}
// unsigned 
else if (H5Tequal(memb_id, H5T_NATIVE_UINT)) {
	datatype = "unsigned int";
	//columnsize = columnsize + sizeof(unsigned int);
}
else if (H5Tequal(memb_id, H5T_NATIVE_USHORT)) {
	datatype = "unsigned short";
	//columnsize = columnsize + sizeof(unsigned short);
}
else if (H5Tequal(memb_id, H5T_NATIVE_ULONG)) {
	datatype = "unsigned long";
	//columnsize = columnsize + sizeof(H5T_NATIVE_ULONG);
}
else if (H5Tequal(memb_id, H5T_NATIVE_ULLONG)) {
	datatype = "unsigned long long";
	//columnsize = columnsize + sizeof(unsigned long long);
}
// for 8 bit
else if (H5Tequal(memb_id, H5T_NATIVE_CHAR)) {
	datatype = "char";
	//columnsize = columnsize + sizeof(char);
}
else if (H5Tequal(memb_id, H5T_NATIVE_UCHAR)) {
	datatype = "unsigned char";
	//columnsize = columnsize + sizeof(unsigned char);
	
}
else if (H5Tequal(memb_id, H5T_NATIVE_FLOAT)) { // float
	datatype = "float";
	//columnsize = columnsize + sizeof(float);
}
else if (H5Tequal(memb_id, H5T_NATIVE_DOUBLE)) {
	datatype = "double";
	columnsize = columnsize + sizeof(double);
}

I able to compare and get datatypes for u32 frame counter and u64Timestamp members and corresponding types for their. But I am not able to found ENum to compare using H5Tequal for Array of 8-bit unsigned integers.could please help me on this

Thanks & Regards,
chandrasekjhar.


#4

Hi,

I see a screen shot and a code snippet. Is this what you planned to send or did you forget to attach a minimum program that demonstrates your problem?

best: steve


#5

Hi Steven,

I attached piece of function in order to get the type of each signal name. As per my example I am trying to get type of each signal by H5Tequal and enums like H5T_UINT/INT/LONG/… for unsigned integer ,integer types,i am unable to get Enum Type for comparing with H5Tequal for member name au8DataArray ,so I need Enum to compare for Array of 8-bit unsigned integer.


#6

I don’t see any attachment.
Here are some guidlenes on minimal compilable example. Here is an uploaded file example to demonstrate upload functionality works: collective.cpp (2.4 KB)
If you’re having trouble with uploading the minimal program that demonstrates the problem please contact Lori, the moderator of this forum.

steve