Ignore:
Timestamp:
Sep 14, 2009 3:18:36 PM (15 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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());
Note: See TracChangeset for help on using the changeset viewer.