lmoffatt / macror

Automatically exported from code.google.com/p/macror
0 stars 0 forks source link

Policy regarding Insert and Extract operators in standard containers that are members of Descriptible classes #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ClassDescription object solves the problem of having to memorize the exact 
order of the elements of a class. 

The problem with classDescription is that it does not know at the time of
the  extraction the type of each field, this problem is deferred to the 
conversion to the proper class. 

This strategy works wells as long as the boundaries of each object are clearly 
defined. 

On the other hand, simple types like strings, numbers and matrices are properly 
handed by the Insert and Extract operators. 

The problem arises on what to do with the standard containers of classes.
Insert, extract on standard containers of numbers is trivial. 

Extract on standard containers of strings works as long as there is a delimiter 
between strings. 

The problem is for ClassDescription extracter when it deals with containers of 
complex classes. 

I propose the following convention:
when describing a vector of a class

trace 1/3
Pulses_trace Begin
time_of_each_pulse
0  0.02 0.03 0.06 0.1

concentration_at_each_time
0 10 0 20 60 0 

trace_duration
0.15

frequency_of_sampling
10e3

time_to_exchange
1e-4

sub_step_time
1e-5

time_to_next_trace
1

Pulses_trace End

trace 2/3
Pulses_trace Begin

time_of_each_pulse
0  0.04 0.1 

concentration_at_each_time
0 10 0 

trace_duration
0.15

frequency_of_sampling
10e3

time_to_exchange
1e-4

sub_step_time
1e-5

time_to_next_trace
1

Pulses_trace End

trace 3/3...

so, there is no a global inserter or extractor, but we iterates on each vector 
in the getClassDescription and LoadFromDescription members of the class.  

Original issue reported on code.google.com by lmoff...@gmail.com on 9 Mar 2011 at 6:15

GoogleCodeExporter commented 9 years ago
I think a little bit, and I change my mind regarding the format
it should be like

number_of_traces
3

trace_1
Pulses_trace Begin
time_of_each_pulse
0  0.02 0.03 0.06 0.1

concentration_at_each_time
0 10 0 20 60 0 

trace_duration
0.15

frequency_of_sampling
10e3

time_to_exchange
1e-4

sub_step_time
1e-5

time_to_next_trace
1

Pulses_trace End

trace_2
Pulses_trace Begin

time_of_each_pulse
0  0.04 0.1 

concentration_at_each_time
0 10 0 

trace_duration
0.15

frequency_of_sampling
10e3

time_to_exchange
1e-4

sub_step_time
1e-5

time_to_next_trace
1

Pulses_trace End

trace_3 ...

Original comment by lmoff...@gmail.com on 9 Mar 2011 at 7:12