J
Jayden Shui
Hi All,
I have a number of named objects of type B whose name can be accessed
by B::Name(). B is polymorphic. D1, D2 and so on are derived from B. I
want to put them in a set or map-like container ordered by their
names. They can be used by other objects, such as of type C. If the
objects in the container are changed by its type (from type D1 to D2)
or value, their users can know it automatically, i.e. those
information is shared among owners and users. To erase an object in
the container, first we need to ensure it is not used by other
objects.
Please give me your idea on it by choosing a proper container with
smart pointers. I am struggling with it and cannot find a good way.
Thanks a lot ! !
Best regards,
Jayden
I have a number of named objects of type B whose name can be accessed
by B::Name(). B is polymorphic. D1, D2 and so on are derived from B. I
want to put them in a set or map-like container ordered by their
names. They can be used by other objects, such as of type C. If the
objects in the container are changed by its type (from type D1 to D2)
or value, their users can know it automatically, i.e. those
information is shared among owners and users. To erase an object in
the container, first we need to ensure it is not used by other
objects.
Please give me your idea on it by choosing a proper container with
smart pointers. I am struggling with it and cannot find a good way.
Thanks a lot ! !
Best regards,
Jayden