It seems one can store one integer and one real in a label. But what if one wants to have two integers stored in one label ? does it make sense to store two values of the same type in one label ?
TDataStd_Integer::Set(child1, 200);
TDataStd_Integer::Set(child1, 300);
TDataStd_Real::Set(child1, 23.5);
std::cout <<" added childes " << std::endl;
Handle(TDataStd_Integer) i;
if( child1.FindAttribute(TDataStd_Integer::GetID(), i))
{
std::cout << i->Get() << std::endl;
}
// prints 300 as expected.
Handle(TDataStd_Real) r;
if( child1.FindAttribute(TDataStd_Real::GetID(), r))
{
std::cout << r->Get() << std::endl;
} //prints 23.5 as expected.
else {
std::cout << "could not find real " << std::endl;
}
How TDataStd_Real::GetID() knows about the ID of the real stored in the child ?
TDataStd_Integer::Set(child1, 200);
TDataStd_Integer::Set(child1, 300);
TDataStd_Real::Set(child1, 23.5);
std::cout <<" added childes " << std::endl;
Handle(TDataStd_Integer) i;
if( child1.FindAttribute(TDataStd_Integer::GetID(), i))
{
std::cout << i->Get() << std::endl;
}
// prints 300 as expected.
Handle(TDataStd_Real) r;
if( child1.FindAttribute(TDataStd_Real::GetID(), r))
{
std::cout << r->Get() << std::endl;
} //prints 23.5 as expected.
else {
std::cout << "could not find real " << std::endl;
}
How TDataStd_Real::GetID() knows about the ID of the real stored in the child ?