source: trunk/src/core/RpVariable.h @ 597

Last change on this file since 597 was 511, checked in by dkearney, 18 years ago

moving all .h files to their respective src directories, updating tools.py to include python's re module, updated setup.py.in to use .h files from the installed version of rappture and to adapt to the new location of .h files. .h files are now all stored in the lib directory under the rappture installation folder. this should simplify people's code, so they dont have to include wierd search paths for header files. adjusted the paths in rappture.in, allowing people to use their own version of python and perl. octave on the other hand is still broken for people downloading our binary and not using libhdf5-1.6.2. src's makefile.in was modified to copy the .h files from the core and cee directories over to the rappture installation directory. the top level makefile.in has all kinds of changes mainly you can now type in ./configure --prefix=... --with-matlab=... and then make install. this will build and install the gui, language bindings, and examples. these changes will probably break the automatic builds but the necessary changes to the rappture-runtime package should be committed in good time.

File size: 3.4 KB
Line 
1/*
2 * ======================================================================
3 *  Copyright (c) 2004-2005  Purdue Research Foundation
4 *
5 *  See the file "license.terms" for information on usage and
6 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 * ======================================================================
8 */
9#include <iostream>
10#include <string>
11#include <sstream>
12#include <stdlib.h>
13#include <errno.h>
14
15
16// #include "RpLibrary.h"
17
18#ifndef _RpABOUT_H
19    #include "RpAbout.h"
20#endif
21
22#ifndef _RpVARIABLE_H
23#define _RpVARIABLE_H
24
25class RpVariable
26{
27    public:
28       
29        // users member fxns
30
31        virtual RpVariable& setPath         (std::string newPath);
32        virtual RpVariable& setDefaultValue (void* newDefaultVal);
33        virtual RpVariable& setCurrentValue (void* newCurrentVal);
34        virtual RpVariable& setLabel        (std::string newLabel);
35        virtual RpVariable& setDesc         (std::string newDesc);
36        virtual RpVariable& setHints        (std::string newHints);
37        virtual RpVariable& setColor        (std::string newColor);
38        virtual RpVariable& setIcon         (std::string newIcon);
39
40        virtual std::string getPath         () const;
41        /* maybe we dont need 2 get functions? */
42        virtual void* getDefaultValue       () const;
43        virtual void* getCurrentValue       () const;
44        virtual std::string getLabel        () const;
45        virtual std::string getDesc         () const;
46        virtual std::string getHints        () const;
47        virtual std::string getColor        () const;
48        virtual std::string getIcon         () const;
49
50        // place the information from this object into the xml library 'lib'
51        // virtual RpNumber& put(RpLibrary lib);
52        // virtual RpVariable& put() const;
53
54        // we need a copy of defaultVal in currentVal, not the same pointer.
55        // need to fix this.
56       
57        RpVariable (
58                    std::string path,
59                    void* defaultVal
60                )
61            :   about       (RpAbout()),
62                path        (path),
63                defaultVal  (defaultVal),
64                currentVal  (defaultVal)
65        {
66            // about's default no-arg const is called
67        };
68
69        RpVariable (
70                    std::string path,
71                    void* defaultVal,
72                    std::string label,
73                    std::string desc
74                )
75            :   about       (RpAbout(label,desc)),
76                path        (path),
77                defaultVal  (defaultVal),
78                currentVal  (defaultVal)
79        {}
80       
81        // copy constructor
82        RpVariable ( const RpVariable& myRpVariable )
83                // will the RpAbout copy constructor be called here?
84            :   about       (RpAbout(myRpVariable.about)),
85                path        (myRpVariable.path),
86                defaultVal  (myRpVariable.defaultVal),
87                currentVal  (myRpVariable.currentVal)
88        {}
89
90        // default destructor
91        virtual ~RpVariable ()
92        {
93            // clean up dynamic memory
94        }
95
96    private:
97
98        RpAbout about;
99        std::string path;
100        void* defaultVal;
101        void* currentVal;
102
103
104};
105
106/*--------------------------------------------------------------------------*/
107/*--------------------------------------------------------------------------*/
108
109#endif
Note: See TracBrowser for help on using the repository browser.