I have an unordered map that is supposed to check if a pen exists given the color, and the width of the pen. I'm currently trying to do a lookup by string. If it’s already in the map, that means I already created a Pen of that type. If it isn’t already in the map, I want to create a new Pen and set the color and weight, and add that to the unordered_map.
std::unordered_map<std::string, std::shared_ptr<Gdiplus::Pen>> mymap;
The properties of the pen that i want are the color and the width... as you can see the color comes in the format(0,0,0) and the width is just a float number. I was thinking about doing a string as such: "(R,G,B);W" where R, G, B correspond to the colors and W corresponds to the width of the Pen, but that seems too complex.
Gdiplus::Pen pen(Color(0, 0, 0));
pen.getWidth();
I was wondering if there is a simple way to pass those properties as a single string or if there is a better way to go around my problem.
My string is supposed to see if the pen exists. it checks the pen color and the width.