PnaclApp

class PnaclApp

 Class that provides the tools to interact with PNaCl.

Inheritance

dep_class_pnacl-__PnaclAppObjectObjectPnaclAppPnaclAppPnaclApp->ObjectConverterConverterConverter->PnaclApp

Parents

  • Object: The root of the class hierarchy.

Constructors

Concerns

  • pnacl: Provides PNaCl support for Nit.
    • pnacl: Provides PNaCl support for Nit.

in pnacl::pnacl

redef type SELF

Type of this instance, automatically specialized in every class

A common use case of the virtual type SELF is to type an attribute and store another instance of the same type as self. It can also be used as as return type to a method producing a copy of self or returning an instance expected to be the exact same type as self.

This virtual type must be used with caution as it can hinder specialization. In fact, it imposes strict restrictions on all sub-classes and their usage. For example, using SELF as a return type of a method foo forces all subclasses to ensure that foo returns the correct and updated type. A dangerous usage take the form of a method typed by SELF which creates and returns a new instance. If not correctly specialized, this method would break when invoked on a sub-class.

A general rule for safe usage of SELF is to ensure that inputs typed SELF are stored in attributes typed SELF and returned by methods typed SELF, pretty much the same things as you would do with parameter types.