source: trunk/examples/objects/api/cpp/boolean @ 1581

Last change on this file since 1581 was 1581, checked in by dkearney, 11 years ago

updates for the rappture objects, object examples, and object apis. small fix for rpunits c interface to check string length. there should probably be more of these checks in the c interface, but units should also be rewritten. added folders to separate out octave2 and octave3 app-fermi examples

File size: 10.1 KB
Line 
1Boolean
2
3constructors/destructors
4    Boolean()
5    Boolean(const char *name, bool val);
6    Boolean(const char *name, bool val, const char *label,
7                const char *desc);
8    Boolean(const Boolean& o);
9    ~Boolean ();
10
11methods
12    const char *name() const;
13    void name(const char *val);
14
15    const char *path() const;
16    void path(const char *val);
17
18    const char *label() const;
19    void label(const char *val);
20
21    const char *desc() const;
22    void desc(const char *val);
23
24    const char *hints() const;
25    void hints(const char *val);
26
27    const char *color() const;
28    void color(const char *val);
29
30    bool def() const;
31    void def(bool val);
32
33    bool cur() const;
34    void cur(bool val);
35
36    int defset() const;
37    int curset() const;
38
39    const void *property (const char *key) const;
40    void property (const char *key, const void *val, size_t nbytes);
41
42    const char *propstr (const char *key) const;
43    void propstr (const char *key, const char *val);
44
45    void propremove (const char *key);
46
47    void vvalue(void *storage, size_t numHints, va_list arg) const;
48
49    void configure(size_t as, ClientData c);
50    void dump(size_t as, ClientData c);
51
52    Outcome &outcome() const;
53
54    const int is() const;
55
56    void defFromStr(const char *val);
57    void curFromStr(const char *val);
58
59---------------------------------------
60
61const char *name()
62    Purpose: get the id name of the object
63    Input Arguments: None
64    Return Value: the id name stored in the object.
65    Notes: if no name is set, NULL will be returned
66            the id name is used to identify this object from
67            all other objects and should be unique
68    Code Example:
69
70void name(const char *val)
71    Purpose: set the id name of the object
72    Input Arguments: 1
73        1. const char *val - new id name
74    Return Value: None
75    Notes: a copy of the memory location val will be stored
76    Code Example:
77
78const char *path()
79    Purpose: get the path of the object
80    Input Arguments: None
81    Return Value: the path stored in the object.
82    Notes: if no path is set, NULL will be returned
83            the path tells where this object sits in the
84            hierarchy of objects.
85    Code Example:
86
87void path(const char *val)
88    Purpose: set the path of the object
89    Input Arguments: 1
90        1. const char *val - new path
91    Return Value: None
92    Notes: a copy of the memory location val will be stored
93    Code Example:
94
95const char *label()
96    Purpose: get the label of the object
97    Input Arguments: None
98    Return Value: the label stored in the object.
99    Notes: if no label is set, NULL will be returned
100            the label is used by the graphical user interface.
101    Code Example:
102
103void label(const char *val)
104    Purpose: set the label of the object
105    Input Arguments: 1
106        1. const char *val - new label
107    Return Value: None
108    Notes: a copy of the memory location val will be stored
109    Code Example:
110
111const char *desc()
112    Purpose: get the description of the object
113    Input Arguments: None
114    Return Value: the description stored in the object.
115    Notes: if no description is set, NULL will be returned
116            the description is used by the graphical user
117            interface to describe what type of data is being
118            requested and how the input is used.
119    Code Example:
120
121void desc(const char *val)
122    Purpose: set the description of the object
123    Input Arguments: 1
124        1. const char *val - new description
125    Return Value: None
126    Notes: a copy of the memory location val will be stored
127    Code Example:
128
129const char *hints()
130    Purpose: get the hints of the object
131    Input Arguments: None
132    Return Value: the hints stored in the object.
133    Notes: if no hints are set, NULL will be returned
134            the hints are used by the graphical user interface
135    Code Example:
136
137void hints(const char *val)
138    Purpose: set the hints of the object
139    Input Arguments: 1
140        1. const char *val - new hints
141    Return Value: None
142    Notes: a copy of the memory location val will be stored
143    Code Example:
144
145bool def()
146    Purpose: get the default value
147    Input Arguments: None
148    Return Value: the default value stored in the object.
149    Notes: None
150    Code Example:
151
152void def(bool val)
153    Purpose: set the default value
154    Input Arguments: 1
155        1. bool val - new default value
156    Return Value: None
157    Notes: None
158    Code Example:
159
160bool cur()
161    Purpose: get the current value
162    Input Arguments: None
163    Return Value: the current value stored in the object.
164    Notes: None
165    Code Example:
166
167void cur(bool val)
168    Purpose: set the current value
169    Input Arguments: 1
170        1. bool val - new current value
171    Return Value: None
172    Notes: None
173    Code Example:
174
175int defset() const
176    Purpose: return whether the default value was set by the user
177    Input Arguments: None
178    Return Value: 1 if default was set by user, otherwise 0
179    Notes: None
180    Code Example:
181
182int curset() const
183    Purpose: return whether the current value was set by the user
184    Input Arguments: None
185    Return Value: 1 if current was set by user, otherwise 0
186    Notes: None
187    Code Example:
188
189const void *property (const char *key) const;
190    Purpose: get a generic property from the property database
191    Input Arguments: 1
192        1. const char *key - property name
193    Return Value: value of the property
194    Notes: None
195    Code Example:
196
197void property (const char *key, const void *val, size_t nbytes);
198    Purpose: set a generic property in the property database
199    Input Arguments: 3
200        1. const char *key - property name
201        2. const void *val - property value
202        3. size_t nbytes - size (in bytes) of the value
203    Return Value: None
204    Notes: A copy of the memory pointed to by val is stored
205            in the property database
206    Code Example:
207
208const char *propstr (const char *key) const;
209    Purpose: get a string property from the property database
210    Input Arguments: 1
211        1. const char *key - property name
212    Return Value: value of the property
213    Notes: None
214    Code Example:
215
216void propstr (const char *key, const char *val);
217    Purpose: set a string property in the property database
218    Input Arguments: 2
219        1. const char *key - property name
220        2. const char *val - property value
221    Return Value: None
222    Notes: A copy of the memory pointed to by val is stored
223            in the property database
224    Code Example:
225
226void propremove (const char *key);
227    Purpose: remove a property from the property database
228    Input Arguments: 1
229        1. const char *key - property name
230    Return Value: value of the property
231    Notes: None
232    Code Example:
233
234void vvalue(void *storage, size_t numHints, va_list arg) const;
235    Purpose: return the value of the object after applying a
236                varying number of hints about how the value
237                should be configured
238    Input Arguments: 3
239        1. void *storage - the return value
240        2. size_t numHints - number of hints provided
241        3. va_list arg - list of hints specified as a va_list
242    Return Value: None
243    Notes: vvalue will parse out the recognisable hints from
244                va_list arg. Values stored in the object are
245                not changed.
246    Code Example:
247
248void configure(size_t as, ClientData c);
249    Purpose: configure the object based on the data in "c".
250                use "as" to determine the type of data in "c".
251    Input Arguments: 2
252        1. size_t as - type of data stored in "c".
253                        valid values include:
254                            RPCONFIG_XML
255                            RPCONFIG_TREE
256        2. ClientData c - data to configure the object from.
257                            if as is...     then c should be...
258                            RPCONFIG_XML    const char *xmltext
259                            RPCONFIG_TREE   RP_ParserXML *object
260    Return Value: None
261    Notes: object is configured based on values in "c"
262    Code Example:
263
264void dump(size_t as, ClientData c);
265    Purpose: dump the object values based to the object "c".
266                use "as" to determine how to dump the data.
267    Input Arguments: 2
268        1. size_t as - type of data stored in "c".
269                        valid values include:
270                            RPCONFIG_XML
271                            RPCONFIG_TREE
272        2. ClientData c - data to configure the object from.
273                            if as is...     then c should be...
274                            RPCONFIG_XML    ClientDataXml *object
275                            RPCONFIG_TREE   RP_ParserXML *object
276    Return Value: None
277    Notes: None
278    Code Example:
279
280Outcome &outcome() const;
281    Purpose: return the status of this object as an Outcome.
282    Input Arguments: 0
283    Return Value: status of the object as an Outcome
284    Notes: None
285    Code Example:
286
287const int is() const;
288    Purpose: return an integer tag describing the object.
289    Input Arguments: 0
290    Return Value: integer tag unique to all number objects
291    Notes: None
292    Code Example:
293
294void defFromStr(const char *val);
295    Purpose: populate the def() value from a string.
296    Input Arguments: 1
297        1. const char *val - the new default value
298    Return Value: None
299    Notes: This function tries to parse the string for a value
300            that can be evaluated as a boolean. It evaluates
301            case insensitive versions of the strings "true", "1"
302            "yes", and "on" as positives boolean expressions.
303            Case insensitive version of the strings "false",
304            "0", "no", and "off" are evaluated as negative
305            boolean expressions.
306    Code Example:
307
308void curFromStr(const char *val);
309    Purpose: populate the cur() value from a string.
310    Input Arguments: 1
311        1. const char *val - the new current value
312    Return Value: None
313    Notes: This function tries to parse the string for a value
314            that can be evaluated as a boolean. It evaluates
315            case insensitive versions of the strings "true", "1"
316            "yes", and "on" as positives boolean expressions.
317            Case insensitive version of the strings "false",
318            "0", "no", and "off" are evaluated as negative
319            boolean expressions.
320    Code Example:
Note: See TracBrowser for help on using the repository browser.