data
Data management.
A data is a piece of information that isn't code.
Data
Base class for data.
All data have at least a type and a value. They are referenced inside the program by and to other data and code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proto_index
|
Index
|
Index in the protobuf |
required |
data
|
'Pb.Data'
|
Protobuf value of the data. |
required |
program
|
Program
|
Program backref |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
proto_index |
Index in the protobuf |
|
address |
AddressT
|
Data address |
type |
TypeT
|
Data type |
program |
Program
|
Reference to the Program |
is_initialized |
bool
|
Is the data initialized? |
size |
int
|
Data size (depends on the type usually) |
name |
str
|
Data name (if any) |
Source code in bindings/python/quokka/data.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
code_refs_to
property
Returns all code reference to this data
comments
property
Return the data comments
data_read_refs_from
property
Returns all data read reference from this data
data_read_refs_to
property
Returns all data read reference to this data
data_refs_from
property
Returns all data reference from this data
data_refs_to
property
Returns all data reference to this data
data_write_refs_from
property
Returns all data write reference from this data
data_write_refs_to
property
Returns all data write reference to this data
name
property
writable
Data name
type
property
writable
Data type. Assume one exists for each data
type_refs_from
property
Returns all type reference from this data
value
property
Data value.
The value is read in the program binary file.
__eq__(other)
Check equality between two Data instances
Source code in bindings/python/quokka/data.py
98 99 100 | |
__init__(proto_index, data, program)
Constructor
Source code in bindings/python/quokka/data.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
__str__()
Data representation
Source code in bindings/python/quokka/data.py
94 95 96 | |
is_variable_size()
Is the data of variable size?
Source code in bindings/python/quokka/data.py
135 136 137 | |
DataHolder
Bases: Mapping
Data bucket
All the data of the program are referenced in this bucket and allow to store them only once.
Attributes:
| Name | Type | Description |
|---|---|---|
proto |
The protobuf data themselves |
|
program |
Program
|
A reference to the Program |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proto
|
The protobuf data |
required | |
program
|
Program
|
The program |
required |
Source code in bindings/python/quokka/data.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
__delitem__(value)
Remove a data from the bucket
Source code in bindings/python/quokka/data.py
240 241 242 | |
__getitem__(address)
Get a data from the bucket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
AddressT
|
Data address |
required |
Returns: A Data
Source code in bindings/python/quokka/data.py
244 245 246 247 248 249 250 251 252 253 254 255 256 | |
__init__(proto, program)
Init method
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proto
|
List of data in the protobuf |
required | |
program
|
Program
|
Backref to the program |
required |
Source code in bindings/python/quokka/data.py
222 223 224 225 226 227 228 229 230 231 232 233 234 | |
__iter__()
Do not allow the iteration over the data
Source code in bindings/python/quokka/data.py
262 263 264 265 | |
__len__()
Number of data in the program
Source code in bindings/python/quokka/data.py
258 259 260 | |
__setitem__(key, value)
Set a data
Source code in bindings/python/quokka/data.py
236 237 238 | |