| 433 | |
| 434 | |
| 435 | class Annotation(object): |
| 436 | def __init__(self, stream, string_table): |
| 437 | self.name = string_table.get_string(stream.read_uint32()) |
| 438 | self.type = stream.read_uint8() |
| 439 | if self.type == AnnotationType.BOOL: |
| 440 | self.value = stream.read_uint32() != 0 |
| 441 | elif self.type == AnnotationType.INT: |
| 442 | self.value = stream.read_int32() |
| 443 | elif self.type == AnnotationType.FLOAT: |
| 444 | self.value = stream.read_float() |
| 445 | elif self.type == AnnotationType.STRING: |
| 446 | self.value = string_table.get_string(stream.read_uint32()) |
| 447 | else: |
| 448 | raise RuntimeError('invalid annotation type') |
| 449 | |
| 450 | |
| 451 | class ParameterAnnotation(object): |