[NeXus-code-tickets] [NeXusCode] #127: Add C++ Stream-like interface

NeXus Data Format Library and Applications noreply at nexusformat.org
Tue Jul 29 16:17:19 BST 2008


#127: Add C++ Stream-like interface
------------------------------+---------------------------------------------
  Reporter:  Freddie Akeroyd  |       Owner:  Freddie Akeroyd
      Type:  enhancement      |      Status:  assigned       
  Priority:  major            |   Milestone:  NeXus 4.2 Ready
 Component:  napi             |     Version:  trunk          
Resolution:                   |    Keywords:                 
------------------------------+---------------------------------------------
Changes (by Freddie Akeroyd):

  * status:  new => assigned

Old description:

> The idea is to allow syntax like:
>
>     // create an entry and a data item
>     File nf(fname, NXACC_CREATE);
>     nf << Group("entry1", "NXentry") << Data("dat1", w, "int_attr", 3);
>     nf.close();
>
>     File nf1(fname, NXACC_RDWR);
>     // add a double_attr to an existing setup
>     nf1 >> Group("entry1", "NXentry") >> Data("dat1") <<
> Attr("double_attr", 6.0);
>     nf1.close();
>
>     // read back data items
>     File nf2(fname, NXACC_READ);
>     nf2 >> Group("entry1", "NXentry") >> Data("dat1", w1, "int_attr", i,
> "double_attr", d);
>     // alternative way to read d1
>     nf2 >> Data("dat1") >> Attr("double_attr", d1);

New description:

 The idea is to allow syntax like:
 {{{
     // create an entry and a data item
     File nf(fname, NXACC_CREATE);
     nf << Group("entry1", "NXentry") << Data("dat1", w, "int_attr", 3);
     nf.close();

     File nf1(fname, NXACC_RDWR);
     // add a double_attr to an existing setup
     nf1 >> Group("entry1", "NXentry") >> Data("dat1") <<
 Attr("double_attr", 6.0);
     nf1.close();

     // read back data items
     File nf2(fname, NXACC_READ);
     nf2 >> Group("entry1", "NXentry") >> Data("dat1", w1, "int_attr", i,
 "double_attr", d);
     // alternative way to read d1
     nf2 >> Data("dat1") >> Attr("double_attr", d1);
 }}}

-- 
Ticket URL: <http://trac.nexusformat.org/code/ticket/127#comment:1>
NeXus Data Format Library and Applications <http://www.nexusformat.org/>
NeXus Data Format Library and Applications



More information about the NeXus-code-tickets mailing list