You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/properties.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The following are key attributes of properties within the framework
15
15
* Property objects can act like a variable
16
16
* Property objects allow introspection - they can be discovered and manipulated at runtime via software
17
17
18
-
###Property Types
18
+
## Property Types
19
19
20
20
The following types are available for properties
21
21
@@ -30,7 +30,7 @@ The following types are available for properties
30
30
* double
31
31
* string
32
32
33
-
####Property Use
33
+
### Property Use
34
34
35
35
Setting an value:
36
36
@@ -48,26 +48,26 @@ Getting a value:
48
48
value = anObject.property.get();
49
49
```
50
50
51
-
###Defining a Property
51
+
## Defining a Property
52
52
53
53
For the framework, two types of property classes exist.
54
54
55
55
* Standard Property - Defines a property that acts like a variable
56
56
* Read/Write Property - Defines a property that calls a ```get()``` method on a value request and calls a ```set()``` method when it's value is set.
57
57
58
-
####Different Property "Kinds"
58
+
### Different Property "Kinds"
59
59
60
60
For each of the above types, besides _normal_ property types that are visible and stored as is, there are three different attributes available:
61
61
62
62
* Hidden - ```flxPropertyHidden<type>```, ```flxPropertyRWHidden<type>``` - The property isn't presented in menu systems, but can be used by an object to store/persist it's value.
63
63
* Secure - ```flxPropertySecure<type>```, ```flxPropertyRWSecure<type>``` -The value of the property is encrypted before saving the value. This value is only written internally (not to a public JSON file)
64
64
* Secret - ```flxPropertySecret<type>```, ```flxPropertyRWSecret<type>``` - The value is _hidden_ and _secure_.
65
65
66
-
###Standard Property Objects
66
+
## Standard Property Objects
67
67
68
68
These property objects define a typed property and provided storage for this property. As such, they act like a instance variable for their containment class.
69
69
70
-
####Declaring the Property
70
+
### Declaring the Property
71
71
72
72
Within the definition of the class the property is for, the property is defined using the following pattern:
73
73
@@ -93,7 +93,7 @@ Available Property Types:
93
93
* flxPropertyDouble
94
94
* flxPropertyString
95
95
96
-
##### Example
96
+
#### Example
97
97
98
98
```C++
99
99
class MyClass : public flxObject
@@ -105,7 +105,7 @@ public:
105
105
}
106
106
```
107
107
108
-
####Setting an Initial Value
108
+
### Setting an Initial Value
109
109
110
110
The initial value for a property can be set in it's declaration statement by assigning the desired value to the declared variable. The value is set using a standard C++ initialization list syntax - aka `{}` braces.
111
111
@@ -121,7 +121,7 @@ public:
121
121
}
122
122
```
123
123
124
-
#### Runtime Registration
124
+
### Runtime Registration
125
125
126
126
When an instance of the object that contains the property is created, the property is registered with that object using the ```flxRegister()``` function. This step connects the object instance with the property.
127
127
@@ -150,13 +150,13 @@ MyClass()
150
150
151
151
> Internally, the flxRegister() call makes the containing object aware of the property object - adding it to an internal _property list_. This allows the system to enumerate properties at runtime as part of an introspection process.
152
152
153
-
### Read/Write (RW) Property Objects
153
+
## Read/Write (RW) Property Objects
154
154
155
155
These property objects define a typed property and required a get and set method be provided to enable reading/writing of the property value.
156
156
157
157
By calling methods on read and write of the property, the Read/Write property objects allow for the immediate, dynamic response to a property operation.
158
158
159
-
#### Declaring Read/Write the Property
159
+
### Declaring Read/Write the Property
160
160
161
161
Within the definition of a classthe property is for, the property is defined using the following pattern:
162
162
@@ -171,7 +171,7 @@ Where:
171
171
* Getter - the name of the _get_ method the property should call when it's value is requested. **NOTE**: A reference, `& operator`, to the getter is provided
172
172
* Setter - the name of the _set_ method the property should call when it's value is set. **NOTE**: A reference, `& operator`, to the getter is provided
173
173
174
-
#####Available Property Types
174
+
#### Available Property Types
175
175
176
176
* flxPropertyRWBool - bool property
177
177
* flxPropertyRWInt8 - integer 8 property
@@ -184,7 +184,7 @@ Where:
184
184
* flxPropertyRWDouble - double
185
185
* flxPropertyRWString - string -> std::string
186
186
187
-
#####Getter Methods
187
+
#### Getter Methods
188
188
189
189
These methods are implemented on the containing class and are called when the value of a property is requested. These methods have the following signature:
190
190
@@ -200,7 +200,7 @@ Where
200
200
Note
201
201
>By convention, getters method names are prefixed by ```get_```
202
202
203
-
##### Setter Methods
203
+
#### Setter Methods
204
204
205
205
These methods are implemented on the containing class and are called when the value of a property is set. These methods have the following signature:
206
206
@@ -216,7 +216,7 @@ Where
216
216
Note
217
217
> By convention, getters method names are prefixed by ```set_```
218
218
219
-
#####Example
219
+
#### Example {#rw-props-example}
220
220
221
221
```C++
222
222
classMyClass2 : publicflxObject
@@ -239,7 +239,7 @@ Note
239
239
> * The use of `set_` and `get_` prefixes on the setter and getter methods help identify the methods as supporting a property.
240
240
> * If an initial value is set for a RW property it it's declaration statement, the _setter_ method called with the initial value when the property is registered via _flxRegister()_.
241
241
242
-
#### RW Property Runtime Registration
242
+
### RW Property Runtime Registration
243
243
244
244
When an instance of the object that contains the property is created, the property is registered with that object using the ```flxRegister()``` function. This step connects the object instance with the property.
245
245
@@ -268,9 +268,9 @@ MyClass2()
268
268
269
269
Note: If an initial value was set for the property, the value is passed to the _setter_ method as part of the registration process.
270
270
271
-
###Property Data Limits
271
+
## Property Data Limits
272
272
273
-
####Data Limit Values
273
+
### Data Limit Values
274
274
275
275
Data limits define restrictions on the values the input parameter accepts. There are two types of data limits: range and valid value sets.
0 commit comments