.ModelicaReference.Classes.'class'

Information

Define class

Examples

class MyTable
  extends ExternalObject;
  function constructor
     ...
  end constructor;

  function destructor
     ...
  end destructor;
end MyTable;

Syntax

   [ encapsulated ][ partial] class
   IDENT class_specifier

class_specifier :
   string_comment composition end IDENT
   | "=" base_prefix name [ array_subscripts ] [ class_modification ] comment
   | "=" enumeration "(" ( [enum_list] | ":" ) ")" comment

See Modelica Grammar for further details.

Description

The keyword class is used to define general classes (without any restrictions). It is identical to the keyword model. In most cases, it is recommended to use specialized classes as connector, model, block, package, record, function, type. "class" should be used to define ExternalObjects, and can be used for classes merely containing documentation and/or graphics.


Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f