insert data to map?

30 views
Skip to first unread message

Mohammad Roshan

unread,
May 17, 2013, 8:49:04 AM5/17/13
to omn...@googlegroups.com
Dear all,
I want to insert my following data in a map but I get syntax error  

struct BCinfo{
    Coord position;
    double speed;
    float direction;
    double timestamp;
};
typedef std::map<int, BCinfo> trafficDB;

even this one has problem;
dataT.insert(std::pair(hostId,newEntry));

have someone any idea about this problem?
thanks.

Ivo Calado

unread,
May 17, 2013, 8:52:26 AM5/17/13
to omn...@googlegroups.com
Mohammad,
   what is the specific compiler output?

[]'s



--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
---
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Ivo Calado

Quidquid latine dictum sit, altum viditur

Putt's Law:
       Technology is dominated by two types of people:
               Those who understand what they do not manage.
               Those who manage what they do not understand.

Mohammad Roshan

unread,
May 19, 2013, 7:21:31 AM5/19/13
to omn...@googlegroups.com, ivo.c...@ee.ufcg.edu.br
Hi Ivo,I want to store CAM message info,speed,direction and location of a vehicle in a map and use the map for the next transmission.
I need to implement multihup transmission,but it seems that the way I use the map is not correct I have checked C++ and omnet++ sources as well,there I found the same format as well.
If you have any experience about this please give some hints.
Thanks

Ivo Calado

unread,
May 19, 2013, 11:41:26 AM5/19/13
to Mohammad Roshan, omn...@googlegroups.com
Morammad,
   try on of the following options:

  • dataT.insert(pair<int, BCinfo>(hostId,newEntry));
  • dataT.insert(make_pair(hostId,newEntry));


Reply all
Reply to author
Forward
0 new messages