NAME

src/pmc/packfileannotations.pmc - PackfileAnnotations PMC

DESCRIPTION

This class implements a PackfileAnnotations object, a segment of the .pbc data file used for listing annotations. It is a container for PackfileAnnotation objects.

See packfile.pmc for the toplevel Packfile interface, see packfilesegment.pmc for the list of common methods every packfile segment pmc must implement; see PDD13 for the design spec.

To works properly PackfileAnnotations has to be added to PackfileDirectory with PackfileConstantTable. Otherwise PackfileAnnotationKey can't be created.

Methods

void init()
Initialize PackfileAnnotations.
void mark()
Marks the object as live.
void destroy()
Destroys the PMC and frees all allocated memory.
PMC *get_key_list()
Get the PackfileAnnotationKeys PMC, listing the keys and types of annotations contained within this object.
INTVAL elements()
Get the number of elements in the array.
PMC *get_pmc_keyed_int(INTVAL index)
Fetch an annotation PMC from the array.
void set_pmc_keyed_int(INTVAL index, PMC *annotation)
Add an annotation to the array at the given offset. An exception will be thrown unless all of the following criteria are met:
- The type of the PMC passed is PackfileAnnotation
- The entry at the previous index is defined
- The offset of the previous entry is less than this entry
- The offset of the next entry, if it exists, is greater than this entry
- The key ID references a valid annotation key
void set_directory()
Handle setting of ownership.Find PackfileConstantTable in PackfileDirectory and pass it to PackfileAnnotationKeys.
void set_pointer(void *ptr)
Initialize PackfileAnnotations from PackFile_Annotations*.
void *get_pointer()
Create PackFile_Annotations* from self.