ascent icon indicating copy to clipboard operation
ascent copied to clipboard

Idea for expression language objects

Open mclarsen opened this issue 4 years ago • 0 comments

Currently, objects like histogram are stored in a node and that is fine. What becomes problematic is when that object is used in many different places and a change to that object is time intensive to test and implement. Additionally, any validation code must be duplicated.

We still want to use conduit nodes to pass them between filters and even use them to store the underlying data, so I propose that we make wrapper objects that are responsible to constructing and outputting conduit nodes that encapsulate objects.

Histogram hist(n_hist); // validation code inside the constructor (even potentially only called in debug mode)
// methods like
int bins = hist.num_bins();
// and 
hist.num_bins(128)
set_output(hist.to_node);

Any api changes would then be compile time failures instead of runtime.

@cyrush

mclarsen avatar Jul 23 '21 20:07 mclarsen