source: trunk/src/objects/RpLibObj.h @ 1568

Last change on this file since 1568 was 1566, checked in by dkearney, 15 years ago

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 size: 1.7 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  Rappture Library Header
4 *
5 * ======================================================================
6 *  AUTHOR:  Derrick S. Kearney, Purdue University
7 *  Copyright (c) 2005-2009  Purdue Research Foundation
8 *
9 *  See the file "license.terms" for information on usage and
10 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 * ======================================================================
12 */
13
14#ifndef _RP_LIBRARY_H
15#define _RP_LIBRARY_H
16
17enum RP_LIBRARY_CONSTS {
18    RPLIB_OVERWRITE     = 0,
19    RPLIB_APPEND        = 1,
20    RPLIB_NO_TRANSLATE  = 0,
21    RPLIB_TRANSLATE     = 1,
22    RPLIB_NO_COMPRESS   = 0,
23    RPLIB_COMPRESS      = 1,
24};
25
26
27#ifdef __cplusplus
28
29#include "RpBuffer.h"
30#include "RpOutcome.h"
31#include "RpInt.h"
32#include "RpChain.h"
33#include "RpParserXML.h"
34
35namespace Rappture {
36
37class Library
38{
39    public:
40        Library();
41        // Library(const Library& o);
42        virtual ~Library();
43
44        Outcome &loadXml(const char *xmltext);
45        Outcome &loadFile(const char *filename);
46
47
48        // Library *value(const char *key, void *storage);
49
50        // Rp_Chain *diff(Library *lib);
51
52        // Library *remove (const char *key);
53
54        const char *xml() const;
55
56        Outcome &outcome() const;
57
58        // Library *result(int status);
59
60        const Rp_Chain *contains() const;
61    private:
62        Rp_Chain *_objList;
63        // Rp_HashTable _objHash;
64        mutable Rappture::Outcome _status;
65
66        void __libInit();
67        void __libFree();
68        void __parseTree2ObjectList(Rp_ParserXml *p, Rp_Chain *retObjList);
69
70}; // end class Library
71
72} // end namespace Rappture
73
74
75#endif // ifdef __cplusplus
76
77#endif // ifndef _RP_LIBRARY_H
Note: See TracBrowser for help on using the repository browser.