I have a map which stores attacks for different ports. Now I am confused as for how to store attack details as the value. Also, there can be multiple attacks for one port.
AttackDetails is a structure containing various details of each attack.
Now I have two approaches for the map:
std::map <int, std::list<AttackDetails>>
std::map <int, std::list<<std::shared_ptr<AttackDetails>>>
There won't be much insertion or deletion but there will be a lot of searchings for ports in the map. Kindly tell me if there is any major performance issue in either of these or any better solution to it?
I need to access the list while deleting the attack details where I will need to traverse through the list and find similar attack id and stop that particular attack.