I have a big piece code that is analyzing some things related to network.
I need to learn some parts of that code. but I couldn’t understand the following part. I don’t know such a usage.
unordered_map < string, DomainInfo *>::iterator hostTrafficItr;
As far as I know unordered_map gets a key, map pair and contains it (a container).
This is declaration of (probably standard) unorderd_map (see here http://www.cplusplus.com/reference/unordered_map/unordered_map/) iterator.
unordered_map is key->value structure allowing to access DomainInfo* element using string to identify them.
The iterator is a class allowing you to (as the name says) iterate through collection elements providing you access to collections keys and values.
You can access key connected with current iterator value using:
and value using
dereference operator returns pair<string, DomainInfo>.
Iterators are most common initialized by .begin() or .end() of the collection.
HTH