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 » Serialize a VectorMap
Serialize a VectorMap [message #33945] Thu, 29 September 2011 10:04 Go to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Hello everybody,

I have a little problem maybe i m not very well in u++ Very Happy
I want to serialize a VectorMap like :

VectorMap<Date, Person> vSubscription;

Where Person is a class where serialization is well implemented.

Thank you for your response,

Ratah
Re: Serialize a VectorMap [message #33946 is a reply to message #33945] Thu, 29 September 2011 15:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ratah wrote on Thu, 29 September 2011 04:04

Hello everybody,

I have a little problem maybe i m not very well in u++ Very Happy
I want to serialize a VectorMap like :

VectorMap<Date, Person> vSubscription;

Where Person is a class where serialization is well implemented.

Thank you for your response,

Ratah




Stream& s;
....
s % vSubscription;
Re: Serialize a VectorMap [message #33949 is a reply to message #33946] Fri, 30 September 2011 10:33 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Thank you Mirek,

I give you my project with a little testcase.
I use finally a vectormap like this:

Vectormap<Date, *pObject> (instead of Vectormap<Date, Object>)

and I do not manage to unsezialize.
Do you have an idea to transform this?

Thank you
Re: Serialize a VectorMap [message #33951 is a reply to message #33949] Fri, 30 September 2011 12:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Obviously:

		VectorMap<Date, CCharge *> 	vPaiementComptant;	


it does not work with pointers...

What makes you use pointer?

You know, "new" is rare in good practice U++ and "delete" is almost prohibited.

Mirek
Re: Serialize a VectorMap [message #33954 is a reply to message #33951] Fri, 30 September 2011 14:33 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
I agree, but i have this bug when i compile mycode.
Visibly, i need to add an operator * to my class CCharge.


----- Core ( SSE2 GCC FORCE_SIZE BLITZ WIN32 ) (1 / 3)
----- plugin/z ( SSE2 GCC FORCE_SIZE BLITZ WIN32 ) (2 / 3)
----- TESTs\Serialize ( SSE2 MAIN GCC FORCE_SIZE BLITZ WIN32 ) (3 / 3)
Serialize.cpp
In file included from C:\upp\uppsrc/Core/Core.h:222,
from D:\DEV UPP\TESTs\Serialize\Serialize.cpp:1:
C:\upp\uppsrc/Core/Topt.h: In function 'void Upp::AssertMoveable0(T*) [with T = CCharge]':
C:\upp\uppsrc/Core/Topt.h:200: instantiated from 'void Upp::AssertMoveable(T*) [with T = CCharge]'
C:\upp\uppsrc/Core/Vcont.h:109: instantiated from 'Upp::Vector<T>::~Vector() [with T = CCharge]'
C:\upp\uppsrc/Core/Map.h:2: instantiated from here
C:\upp\uppsrc/Core/Topt.h:191: error: no match for 'operator*' in '** t'
C:\upp\uppsrc/Core/Color.h:73: note: candidates are: Upp::RGBA Upp::operator*(int, Upp::Color)
C:\upp\uppsrc/Core/Gtypes.h:657: note: Upp::Sizef Upp::operator*(Upp::Sizef, Upp::Size16)
C:\upp\uppsrc/Core/Gtypes.h:656: note: Upp::Sizef Upp::operator*(Upp::Size16, Upp::Sizef)
C:\upp\uppsrc/Core/Gtypes.h:654: note: Upp::Sizef Upp::operator*(double, Upp::Size16)
C:\upp\uppsrc/Core/Gtypes.h:653: note: Upp::Sizef Upp::operator*(Upp::Size16, double)
C:\upp\uppsrc/Core/Gtypes.h:622: note: Upp::Sizef Upp::operator*(Upp::Sizef, Upp::Size)
C:\upp\uppsrc/Core/Gtypes.h:621: note: Upp::Sizef Upp::operator*(Upp::Size, Upp::Sizef)
C:\upp\uppsrc/Core/Gtypes.h:619: note: Upp::Sizef Upp::operator*(double, Upp::Size)
C:\upp\uppsrc/Core/Gtypes.h:618: note: Upp::Sizef Upp::operator*(Upp::Size, double)
TESTs\Serialize: 1 file(s) built in (0:00.74), 749 msecs / file, duration = 749 msecs, parallelization 0%

There were errors. (0:00.76)
Re: Serialize a VectorMap [message #33955 is a reply to message #33954] Fri, 30 September 2011 14:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Is CCharge moveable and marked as such?

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

Note that you can also use ArrayMap if you do not want to be bothered with Moveable...

Mirek

[Updated on: Fri, 30 September 2011 19:21]

Report message to a moderator

Re: Serialize a VectorMap [message #33958 is a reply to message #33955] Fri, 30 September 2011 16:56 Go to previous message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Great!It's a big time for me.
Thank you Mirek

here is correction
Previous Topic: Linux and GetCurrentDirectory
Next Topic: [BUG] ArrayMap::Create<TT>: implicit downcast
Goto Forum:
  


Current Time: Thu Mar 28 09:59:11 CET 2024

Total time taken to generate the page: 0.01776 seconds