Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Janek Kozicki
Vincent Richefeu said: (by the date of Fri, 3 Jul 2009 16:29:28 +0200)

 Janek,
 
 Could you please remind me where I could include the code to perform  
 special treatment for the serialization?
 I hope my question is claire enough.
 Practically, I would like to do something like this:
 
 if (the type of my object is 'GroupRelationData')
   {
 I write what I want in xml format
   }
 
 I think that a more elegant solution could be to create a template  
 class inherited from the template class DynLibDispatcher. Somethink  
 like the MetaEngine2D.
 What is your opinion about that?


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Janek Kozicki
Vincent Richefeu said: (by the date of Fri, 3 Jul 2009 16:29:28 +0200)

 Janek,
 
 Could you please remind me where I could include the code to perform  
 special treatment for the serialization?
 I hope my question is claire enough.
 Practically, I would like to do something like this:
 
 if (the type of my object is 'GroupRelationData')
   {
 I write what I want in xml format
   }
 
 I think that a more elegant solution could be to create a template  
 class inherited from the template class DynLibDispatcher. Somethink  
 like the MetaEngine2D.
 What is your opinion about that?


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array and pointer counting.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Vincent Richefeu


Le 6 juil. 09 à 12:11, Janek Kozicki a écrit :


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector and it will work straight away.


The class I want to serialize is GroupRelationData.
The problem come with a vectordouble **.


otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array.


I could 'register' a vectorvectovectordouble   but last time  
you said me that it didn't work...


At this moment, I'm testing an alternative solution (currently, yade  
is compiling):
I added the private string commands_ in the class GroupRelationData.  
Only this string is 'REGISTER_ATTRIBUTED' .
In fact, the string is a kind of 'command stream' that can be  
interpreted by the class to set the variables.


example of string:
ngrp 2 ;  parameter kn ; set all kn 1e6 ; parameter mu ; set mu 1 1  
0.5 ; set mu 0 1 0.0








___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Vincent Richefeu

When a string is serialized, all space characters become nbsp;
Is this normal?
How can I do to avoid this?

thanks,
VR

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp