[eq-dev] Data types in FrameData.h

Stefan Eilemann eilemann at gmail.com
Fri Apr 29 10:35:28 CEST 2011


On 28. Apr 2011, at 23:29, Sythel[via Software] wrote:

> I am trying to send std::vector of an osg object. However system hangs up when i do that. Is there a spesific method to serialize and/or deserialize vector type ? I have examined the examples but all i saw was data structures and arrays not vectors. 

The co::DataOStream/IStream has a serializer for std::vectors which serializes each element of the vector. You will however have to write serializers for the objects contained in the vector if they are not PODs or if they contain pointers, i.e.:

    co::DataOStream& operator << ( co::DataOStream& os, OSG::Node* node ) { ...; return os; }

> Another question is that if we can commit or sync framedata in a different osg thread? For example in particleupdater, can we call framedata.sync or commit? I tried to do such a thing but system hang up again.

You can commit()/sync() objects from any thread. sync is not threadsafe and needs an external lock (see API doc). sync does block if the version has not been commited yet.


HTH,

Stefan.

--
View this message in context: http://software.1713.n2.nabble.com/Data-types-in-FrameData-h-tp6314925p6316128.html
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.equalizergraphics.com/pipermail/eq-dev/attachments/20110429/63e9dd46/attachment.htm>


More information about the eq-dev mailing list