Hello Andreas,
Andreas Halm wrote:
>> Andreas Halm wrote:
>>> I have a problem using a field container derived class. For
>> simplicity
>>> let's just name my classes type1 and type2, both defined using fcd
>>> files. Now type2 needs to have a multifield of type1.
>> hm, FieldContainer do not support value semantics (there is too much
>> happening behind the scenes to allow copies to be created just because
>> (for example) an FC is put into a std::vector<>). Does type1 have to be
>> a FC (that also makes it quite a bit larger than the 5 floats you claim
>> below).
>
> Yes and no. I did use the fcd approach as someone told me about a month ago
> to always use it if I want synchronization, so I did that and the docs said
> the parent class must be derived from FieldContainer ....
I apologize if the information I provided was misleading. I was thinking
along the lines of the most common extension: a new NodeCore that
provides some new functionality.
> Ok now that I have the answers how I could get either approach to work,
> which one should I choose? Or should I use a simple struct instead and
> create the copyToBin etc. methods myself for synchronization?
well, before I burn myself again by providing misleading information ;),
perhaps you could tell us a little about what you are trying to do and
what role the type(s) you are adding have in that?
In general, for something that has value semantics putting it in a field
is probably the right approach (it preserves the value semantics and
these types are normally small enough to not be a problem when copied
around). When you need to store and synchronize pointers the pointed to
object should be FC so that OpenSG has a chance to transport the pointed
to object over the network.
Cheers,
Carsten
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users