Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Report serialization
Report serialization [message #18987] Mon, 03 November 2008 09:46 Go to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi all of you,

I tried to save report on disque via serialization and I face an issue with reading the file from the disk. I succeeded to write via fileout but when my application tries to read it using FileIn I get an Assertion failure in Core.h.

I join the code used in my application

I would be grateful if somebody could advice me on what is wrong.

Thanking in advance for your help

Kind regards

Biobytes
Re: Report serialization [message #18990 is a reply to message #18987] Mon, 03 November 2008 10:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BioBytes wrote on Mon, 03 November 2008 03:46

Hi all of you,

I tried to save report on disque via serialization and I face an issue with reading the file from the disk. I succeeded to write via fileout but when my application tries to read it using FileIn I get an Assertion failure in Core.h.

I join the code used in my application

I would be grateful if somebody could advice me on what is wrong.

Thanking in advance for your help

Kind regards

Biobytes


Well, for starters, const Array<Drawing>& is returned. You should not be writing to it.

There is unfortnunately on "impedance mismatch" with C++ standard which in this case bites you - that const Array gets destroyed by "pick".

http://www.ultimatepp.org/srcdoc$Core$PickTypes$en-us.html
http://www.ultimatepp.org/srcdoc$Core$pick_$en-us.html

Second problem is that there is more state info involved than mere page Drawings.

What should work is to cycle through Array<Drawing>, read individual Drawing into separate variable and store one by one.

Then on loading, load Drawing and draw it to pages.

That is completely trasparent. And no need to derive from Report.

Mirek
Re: Report serialization [message #18997 is a reply to message #18990] Mon, 03 November 2008 16:45 Go to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hello Mirek,

Thank you very much for your advice and now all is working perfectly well in my application. I can now save and read my reports. UPP is really a great development tool.

I am a newer to C++ as I come from Delphi and Eclipse worlds.

Kind regards
Biobytes
Previous Topic: Format Issues - Dynamic width and alignment
Next Topic: Core/Ol_Set.cpp should to change!
Goto Forum:
  


Current Time: Mon Apr 29 12:50:15 CEST 2024

Total time taken to generate the page: 0.01850 seconds