PapcoDoc/documents/PapcoObjectsOverview

From PapcoWiki

Jump to: navigation, search

Purpose. This is a list of the papco objects available, and what they do.

Overview of PaPCo objects

  • papco_object base class for all papco classes
  • papco_monitor a device for communicating the status of a long process to impatient humans
  • papco_logger receives and handles messages with verbosity levels
  • papco_timeDatum a UT time reference, stored to nanosecond accuracy.
  • papco_timeRange an interval in UT time "2004/1/3 4:00 - 4:35 UT"
  • papco_timeOffset a length in time, such as "2 hours, 14 minutes, and 34 nanoseconds"
  • papco_data_cache a resource that provides data sets by managing storage and transport. (not implemented presently as idl object)
  • papco_keychain manages credentials from the rest of the system
  • papco_panellist draws the list of panels on the page, handle mouse controls for layout
  • papco_filesystem filesystem abstraction allows web sites to be mounted and accessed just like local files.
  • papco_ds_cache object for managing RAM memory caches of datasets
  • papco_objectCache object for managing arbitrary caches of objects

Glossary

object. Data structure that contains both data and procedure references.

immutable. Once created, the object cannot be modified. For example, a papco_timeRange's value cannot be changed, whereas the mutable papco_keychain can have keys added to it.

garbage collection. IDL runs though memory, deleting objects (and data structures) that are no longer referenced, freeing up resources. An IDL garbage collection is triggered with the command "heap_gc"

Notes on IDL objects

Because IDL provides a means to destroy objects, and because garbage collection must be done manually, it's easy to introduce bugs if conventions are not followed. Immutable objects must not be explicitly destroyed. These are objects that cannot be modified after they are created, such as papco_timeRange and papco_timeDatum. A program can store any immutable object without having to worry about making a defensive copy. But if an immutable object is explicitly destroyed elsewhere then a dangling reference is left behind causing bugs. So use heap_gc to clean up after allocating lots of objects.