I have a piece of code saying
clock.start();
for (unordered_map <uint32_t,HostTraffic>::iterator internalIPItr = hostTraffic.begin();
internalIPItr != hostTraffic.end();
++internalIPItr)
{
if (!pgBulkInserter.insert(NULL, internalIPItr -> first,
internalIPItr -> second.inboundFlows,
(void*)&(internalIPItr -> second.outboundPortIPs),
internalIPItr -> second.roles)) {
return -1;
}
clock.incrementOperations();
}
My problem is I don’t understand the meaning of
(void*)&(internalIPItr -> second.outboundPortIPs).
You can consider for(....) as
for (int internalItr = beginning -> end)
where the type of internalItr is unordered_map and internalItr->second gives an instance of HostTraffic.
The pointer to the address of
internalIPItr->second.outboundPortIPs, given by&, is converted tovoid*.