April 16, 2024, 23:49
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Proper Serialization Code  (Read 2942 times)
warrantyvoider
Full Member
***
Posts: 109


View Profile
« on: June 08, 2013, 17:32 »

Hi,
im not so good in C++ so maybe the someone here can help me on this Cheesy
I want to recreate Unreals serialization behavior, and my code so far looks like this I just simply want to write/read a complex object to file. it consists of an int, a byte array (char), and a float. 1st problem: when I do f.e. float f; out << f; it will serialize it as string, but I want the 4 bytes, so I had to write my own classes for each... that feels wrong.
2nd problem: I also have to override the >> operator, but in unreal code I only see << functions, why is that and how could I simplify my code? it feels unneeded complicated that way... has it to do wth the Ar.IsLoading() / Ar.IsSaving() property?

greetz WV
« Last Edit: June 08, 2013, 18:04 by warrantyvoider » Logged
warrantyvoider
Full Member
***
Posts: 109


View Profile
« Reply #1 on: June 09, 2013, 00:40 »

ok I found a solution myself, this works fine^^

http://me3explorer.freeforums.org/post3452.html#p3452

greetz
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
« Reply #2 on: June 10, 2013, 13:24 »

Nice to see that you're switching to C++ and you found solutions to your questions Wink
Logged
warrantyvoider
Full Member
***
Posts: 109


View Profile
« Reply #3 on: June 10, 2013, 18:51 »

Thanks^^ sometimes it helps just to know that there are ppl, that you can ask if you are stuck, so you dont give up that easily Cheesy
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS