source: trunk/src/objects/RpArray1D.h @ 1615

Last change on this file since 1615 was 1560, checked in by dkearney, 15 years ago

updates to the object system, fixed up tree and xml parser objects, added some basic tests for them and adopted number object to accept xml text and configure itself from the parsed xml. added fermi3.cc example program which contains suggested interface from apps meeting.

File size: 1.3 KB
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Derrick S. Kearney, Purdue University
4 *  Copyright (c) 2005-2009  Purdue Research Foundation
5 *
6 *  See the file "license.terms" for information on usage and
7 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 * ======================================================================
9 */
10
11#ifndef RAPPTURE_ARRAY1D_H
12#define RAPPTURE_ARRAY1D_H
13
14#include "RpAccessor.h"
15#include "RpSimpleBuffer.h"
16#include "RpObject.h"
17
18namespace Rappture {
19
20class Array1D : public Object
21{
22public:
23
24    Array1D();
25    Array1D (const double *val, size_t size);
26    Array1D (const Array1D &o);
27    virtual ~Array1D();
28
29    Accessor<const char *> name;
30    Accessor<const char *> units;
31    Accessor<const char *> scale;
32
33    virtual Array1D& append(const double *val, size_t nmemb);
34    virtual Array1D& clear();
35    virtual size_t read(double *val, size_t nmemb);
36    virtual size_t nmemb() const;
37    virtual double min() const;
38    virtual double max() const;
39    virtual const double *data() const;
40
41    static const char type[];
42
43    const char *xml(size_t indent, size_t tabstop);
44    const int is(void) const;
45
46protected:
47
48    SimpleDoubleBuffer _val;
49    double _min;
50    double _max;
51};
52
53} // namespace Rappture
54
55#endif // RAPPTURE_ARRAY1D_H
Note: See TracBrowser for help on using the repository browser.