Ignore:
Timestamp:
Sep 14, 2009 3:18:36 PM (11 years ago)
Author:
dkearney
Message:

updates to Rappture::Library and Rappture::Number objects to demo how the library should store objects and generate the xml for those objects upon request. opting for configure() and dump() functions for objects. the object should know how to configure it self from a string of xml, tree object or (in the future) blob of hdf5. added some rudimentary examples of using the library object.

Location:
trunk/examples/objects
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/objects/Makefile.in

    r1561 r1566  
    1515RM              = rm -f
    1616
     17#               dxReader \
     18#               dxWriter \
     19
    1720examples = \
    1821                axis \
     
    2023                floatBuffer \
    2124                histogram \
     25                library \
    2226                number \
    2327                path \
  • trunk/examples/objects/number/number.cc

    r1560 r1566  
    2020    std::cout << "max: " << n->max() << std::endl;
    2121    std::cout << "units: " << n->units() << std::endl;
    22     std::cout << "xml:\n" << n->xml(indent,tabstop) << std::endl;
     22    // std::cout << "xml:\n" << n->xml(indent,tabstop) << std::endl;
    2323    return 0;
    2424}
     
    8585    if (memblock == NULL) {
    8686        fprintf(stderr,"can't allocate %zu bytes for file \"%s\": %s",
    87             size, filePath, strerror(errno));
     87            (size_t)size, filePath, strerror(errno));
    8888        fclose(f);
    8989        return 0;
     
    9595
    9696    if (nRead != (size_t)size) {
    97         fprintf(stderr,"can't read %zu bytes from \"%s\": %s", size, filePath,
    98             strerror(errno));
     97        fprintf(stderr,"can't read %zu bytes from \"%s\": %s",
     98            (size_t) size, filePath, strerror(errno));
    9999        return 0;
    100100    }
     
    197197    Rappture::Number n;
    198198
    199     n.xml(buf);
     199    n.configure(Rappture::RPCONFIG_XML,(void*)buf);
    200200
    201201    retVal |= testStringVal(testname,testdesc,name,n.name());
  • trunk/examples/objects/tree/tree.c

    r1560 r1566  
    170170    const char *childNodeName = "mychildnode";
    171171    const char *childNodeValue = "quick brown fox";
    172     const char *expected = "quick brown fox1";
     172    const char *expected = "quick brown fox";
    173173    const char *received = NULL;
    174174
  • trunk/examples/objects/xmlparser/Makefile.in

    r1560 r1566  
    3737                $(srcdir)/xmlparser_1_0_out.xml \
    3838                $(srcdir)/xmlparser_2_0_in.xml \
     39                $(srcdir)/xmlparser_5_0_in.xml \
    3940                $(srcdir)/tool.xml \
    4041                Makefile
  • trunk/examples/objects/xmlparser/xmlparser.cc

    r1560 r1566  
    267267run.input.number(Ef).max 10eV\n\
    268268run.input.number(Ef).default 0eV\n\
    269 run.input.number(Ef).current 0eV\n";
     269run.input.number(Ef).current 0eV\n\
     270run.input.number(Ef).preset.value 300K\n\
     271run.input.number(Ef).preset.label 300K (room temperature)\n\
     272run.input.number(Ef).preset.value 77K\n\
     273run.input.number(Ef).preset.label 77K (liquid nitrogen)\n\
     274run.input.number(Ef).preset.value 4.2K\n\
     275run.input.number(Ef).preset.label 4.2K (liquid helium)\n\
     276";
    270277
    271278    const char *received = NULL;
     
    298305// FIXME: test get function
    299306// FIXME: test put function
     307// FIXME: test putf function
     308// FIXME: test appendf function
    300309// FIXME: look into why Rp_ParserXmlPathVal hits some nodes twice in gdb
    301310
Note: See TracChangeset for help on using the changeset viewer.