c++ - Alternative to map<someKey , map<anotherKey,Identifier > > -
i assign data for each pair of (pointer object, name of method in object), later efficiently retrieve data knowing pointer object , name of method.
class object; class data;
which container work better:
std::map<object*,std::map<std::string, data> > container;
or
std::map<std::pair<object*,std::string>,data > container;
or, should use else? please note of objects have 1 method, few objects having more 1 method.
p.s. "work better" mean optimizing speed of access.
you mentioned using qt , object
qobject
. qt has dynamic properties can used attach data specific instance of qobject setproperty member function.
Comments
Post a Comment