Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal inconsistency for ExternalObject #1221

Closed
modelica-trac-importer opened this issue Nov 4, 2018 · 4 comments
Closed

Internal inconsistency for ExternalObject #1221

modelica-trac-importer opened this issue Nov 4, 2018 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@modelica-trac-importer
Copy link
Collaborator

Reported by hansolsson on 26 Jul 2013 07:57 UTC
The ExternalObject is using restricted class 'class' (and similarly external tables in MSL) and is designed to have code such as:

Section 12.9.7.

Contains:

class MyTable
 extends ExternalObject;
 function constructor
  input String fileName := ""; 
  input String tableName := "";
  output MyTable table;
  external "C" table = initMyTable(fileName, tableName);
 end constructor;
 function destructor "Release storage of table"
  input MyTable table;
  external "C" closeMyTable(table);
 end destructor;
end MyTable;

Note: "input/output MyTable table", but:

4.4.2.2 States:
Type prefixes (that is, flow, stream, discrete, parameter, constant, input, output) shall only be applied for type, record and connector components – see also record specialized class, Section 4.6.
--
Conclusion: it seems that input/output should be allowed for components of class as well.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1221

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 4 Sep 2013 11:21 UTC
There are also user-libraries that rely on parameter-ExternalObject; that also needs to be considered.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by jmattsson on 4 Sep 2013 11:25 UTC
Perhaps it should only be allowed in functions? And for that matter, not for all classes declared as class either.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 24 Sep 2013 07:44 UTC
Language group:
Var 1:
"Type prefixes (that is, flow, stream, discrete, parameter, constant, input, output) shall only be applied for type, record, and connector components, as well as components of classes extending from ExternalObject – see also record specialized class, Section 4.6; and ExternalObject Section ..."

Var 2:
"Type prefixes (that is, flow, stream, discrete, parameter, constant, input, output) shall only be applied for type, record, and connector components - see also record specialized class, Section 4.6. In addition components of classes extending from ExternalObject may in addition have type prefixes parameter and constant, and in functions also type prefixes input and output - see Section ..."
Decided on var 2.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 23 Oct 2013 11:09 UTC
Resolved in r7098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests