This is an example of how to access object attributes.
#include <iostream>
#include <string>
{
auto *obj =
manager.construct<
int>(
"obj")();
manager.get_instance_description(obj, &description);
std::cout <<
"Name: " <<
manager.get_instance_name(obj)
<<
", Length: " <<
manager.get_instance_length(obj)
<< ", Description: " << description << std::endl;
manager.set_instance_description(obj,
"description example 1");
}
{
for (const auto &object : accessor) {
std::cout << "Name: " << object.name() << ", Length: " << object.length()
<< ", Description: " << object.description() << std::endl;
}
auto itr = accessor.find("obj");
accessor.set_description(itr, "description example 2");
std::cout << "Name: " << itr->name() << ", Length: " << itr->length()
<< ", Description: " << itr->description() << std::endl;
}
return 0;
}
int main()
Definition: jgraph.cpp:24