[openamq-dev] Help on sending vector on OpenAMQ

Martin Sustrik sustrik at imatix.com
Fri Aug 17 12:51:45 CEST 2007


What OpenAMQ (and any AMQP implementation) transports is a bytestream. 
Therefore you have transform any data you want to send to a sequence of 
bytes. On the receiver side you have to parse the sequence and build the 
data anew.

I would suggest you browse the web a bit and find a library that does 
the encoding/decoding for you. I haven't checked but I am quite sure 
there is one out there.

Martin

Malinga wrote:
> Hi /Martin Sustrik,
> 
> Thats means i cant use simple sender and receiver like below, like you 
> sent the integer vector right ? :(/
> 
> void *save (const std::vector<MontageDataStructure> &vec)    {
>     MontageDataStructure *buffer = (MontageDataStructure*) malloc 
> (sizeof (MontageDataStructure) * vec.size ());
>     for (int i = 0; i != vec.size (); i++)
>         buffer [i] = vec [i];
>     return (void*) buffer;
> }
> 
> std::vector<MontageDataStructure> load (void *buffer, size_t size){   
>     MontageDataStructure *buf = (MontageDataStructure*) buffer;
>     std::vector<MontageDataStructure> vec;
>     for (int i = 0; i != size; i++)
>         vec.push_back (buf [i]);   
>     return vec;
> }
> 
> 
> I tried this it didnt work, but i did work for you int vector. Im 
> totally stuck. :(
> 
> -Malinga
> 
> ------------------------------------------------------------------------
> Boardwalk for $500? In 2007? Ha!
> Play Monopoly Here and Now 
> <http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow> 
> (it's updated for today's economy) at Yahoo! Games.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev



More information about the openamq-dev mailing list