Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read Attributes of Point only reads Int #290

Open
Mark-Niemeyer opened this issue May 24, 2023 · 1 comment
Open

Read Attributes of Point only reads Int #290

Mark-Niemeyer opened this issue May 24, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers hdf5 Something related to the hdf5 files

Comments

@Mark-Niemeyer
Copy link
Member

flatbuffers::Offset<AttributeMapsFb> Hdf5FbGeneral::readAttributeMap(HighFive::AnnotateTraits<T>& object,
flatbuffers::grpc::MessageBuilder& builder)
{
std::vector<std::string> attributeList = object.listAttributeNames();
std::vector<flatbuffers::Offset<seerep::fb::UnionMapEntry>> mapEntryVector;
for (std::string attributeName : attributeList)
{
auto attribute = object.getAttribute(attributeName);
if (attribute.getDataType().getClass() == HighFive::DataTypeClass::Integer)
{
int attributeValue;
attribute.read(attributeValue);
auto keyOffset = builder.CreateString(attributeName);
seerep::fb::IntegerBuilder integerBuilder(builder);
integerBuilder.add_data(attributeValue);
auto integerOffset = integerBuilder.Finish();
seerep::fb::UnionMapEntryBuilder unionMapEntryBuilder(builder);
unionMapEntryBuilder.add_key(keyOffset);
unionMapEntryBuilder.add_value_type(seerep::fb::Datatypes_Integer);
unionMapEntryBuilder.add_value(integerOffset.Union());
mapEntryVector.push_back(unionMapEntryBuilder.Finish());
}
}
return builder.CreateVector(mapEntryVector);
}

Only reads Integer. Other datatypes must be implemented and everything should be moved to core.

@Mark-Niemeyer Mark-Niemeyer added good first issue Good for newcomers hdf5 Something related to the hdf5 files labels May 24, 2023
@Mark-Niemeyer Mark-Niemeyer self-assigned this Jul 3, 2023
@Mark-Niemeyer
Copy link
Member Author

Partially solved by #316.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hdf5 Something related to the hdf5 files
Projects
None yet
Development

No branches or pull requests

1 participant