Skip to content

Commit ba20316

Browse files
Release/1.5.0 (#44)
* Add library location to search path (windows) (#18) * Add const and noexcept specifiers (#19) * Add const and noexcept specifiers - The function to query the error code from an exception should be const noexcept. * Add "const noexcept" in declaration of E%sException * Remove uninitialized variable (#25) * Fixed release call in Pascal Bindings. (#21) * Issue22 (#23) * Fixed release call in Pascal Bindings. * fixed init call of out bools and enums * Out parameter was a mismatch for pascal struct out definition * Fis issue in python binder for struct-in parameter * Added Error Propagation to ACT * Added Binding support for error messages * Fixed Error Propagation * Fixed Error Propagation * Autogenerate error handling in implementation * Use actual base-class throughout generation * Replace WIN32 with _WIN32 * Avoid recursive calls to the ErrorMessageFunction * Back to global error method * Make CPPDynamic work again * Make Pascal bindings work again * Error propgation in Pascal-implementation * Add missing include (pascal) * Add Pascal Implementation of Primes * Add CppDynamic-Example * Add updated xml for Primes * Add missing lpr * Make Pascal Example work * Add functionality to Primes Example * Add Python example again * Make pascal use 2spaces instead of 4 * Fix CPP bindings * Make python use correct base class * Update XSD and Documentation * Add void pointer * Fix typo in README * Check component definition for required errors * Bugfixes to error propagation * Add rudimentary support for pointers in NodeJs and Go * Fix base-class in cpp-dynamic-bindings * Do not prefix binary-names with 'lib' on Unix systems * Restrict values for class-parent * ACT components now have prerelease- and build-info (#28) * ACT components now have prerelease and build-info * Update documentation * Update documentation and XSD * Fix circular dependency in pascal implmenetation (#30) lib*_exception.pas and lib*_interfaces.pas had dependencies to each other. The interface-block of both of the unis don't need the other one. Therefore putting the 'uses' into the implementation-block fixes the issue. * Enforce CT_Member->Name to be a ST_Name * Prepare Python bindings for PIP * Issue 31: Array handling in NodeJS bindings (#32) * Issue 31: Array handling in NodeJS bindings * fixed linux node compile problems * Added Node Input Structs * Fixed Node Generation Bugs * Change loading of DLL in C++-dynamic - Make C++-dynamic load via WChar-name - require user to setup DLL-search-dir correctly * Update Readme for NodeJS * Update version * Fix python-bindings * Use type="class" instead of type="handle" (#33) * Fix type="class" in global section * Issue31_Second_Pass (#35) * Added multiple return and out values, struct outs, bugfixes * Make use of namespaces and scopes of definitions in C++ and Python (#36) * Simplify class, enum, and struct names for Python * Simplify naming in C++-implementation * Describe the thin layer of the hourglass with CPP-types instead of C-types (WIP) * Use CPP-types in CPP-Dynamic (WIP) * Make C++-bindings use C++ ABI-description * Update Primes-Example * Fix dynamic Cpp-binding * Fix CDynamic * Added Node Error Propagation (#41) * Added Node Error Propagation * Added Node Error Propagation * Updated Readme with capabilities * Update development version * Header only generation mode for C++ (#43) * Updated Readme with capabilities * Added HeaderOnly C++ Mode * Fixed code generation issues * Limit to 2 C++ bindings: CppDynamic and Cpp (h-only) * Remove unused code * Add binding files for example * Do not auto--create JournalMethod * Update Tutorial.md for 1.5.0 * Update Primes Example Code * Add Cpp-example again * Update Interface version in examples * Remove last path * Update IDL version, fix link in tutorial * Fix Tutorial for Linux * Declare RC1 * Fix C-dynamic and NodeJS-binding * Fix tutorial XMLs (#46) * Update Tutorial- and Readme * Make separate functions for additional versioninfo * Support classidentifier in C++-based bindings * Update example, declare RC2 * Remove unused dllsuffix-attribute (#45) * C sharp bindings (#47) * Initial C# bindings * First working version * Added String Handling to CSharp Bindings * Added Error Propagation to CSharp Bindings * Reformat Code, update readme.md * Added experimental array support to CSharp bindings * Add generation of CSharp-Examples * Update CSharp LibPrimes Example * Fix structs + remove external dependency * Fix formatting * CSharp fix * Update Documentation, ake csharp use byte for bool * Fix bool parameters in CSharp * Fix CSharp bool-in-parameter * Update Documentation * Update version + readme * Fix Pascal-binding boolean return/out values * Fix typo * Add verpatch
1 parent 82b03e1 commit ba20316

File tree

89 files changed

+8511
-5492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8511
-5492
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.exe
88
*.c
99
*.go
10+
*.orig
1011

1112
# Visual Studio Code
1213
debug

Build/Readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
verpatch.exe is an amazing tool to change resource information in EXEs and DLLs
2+
3+
https://github.com/pavel-a/ddverpatch/releases
4+
5+
Call like this
6+
```
7+
verpatch.exe ..\act.exe /high /va 1.5.0 /pv "1.5.0-RC1+buildnumber-5" /s copyright "(c) 2018-2019 ACT Developers" /s desc "ACT is a code generator for software components" /s productName "Automatic Component Toolkit"
8+
```

Build/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set startingDir="%CD%"
33
set basepath="%~dp0"
44

55
cd %basepath%\..\Source
6-
set Sources=actutils.go automaticcomponenttoolkit.go buildbindingcdynamic.go buildbindingcpp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagepascal.go
6+
set Sources=actutils.go automaticcomponenttoolkit.go buildbindingccpp.go buildbindingcsharp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagecpp.go languagepascal.go
77
set GOARCH=amd64
88

99
set GOOS=windows

Build/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ startingpath="$(pwd)"
44
basepath="$(cd "$(dirname "$0")" && pwd)"
55
cd "$basepath/../Source"
66

7-
Sources="actutils.go automaticcomponenttoolkit.go buildbindingcdynamic.go buildbindingcpp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagepascal.go"
7+
Sources="actutils.go automaticcomponenttoolkit.go buildbindingccpp.go buildbindingcsharp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagecpp.go languagepascal.go"
88
GOARCH="amd64"
99

1010
echo "Build act.exe"

Build/verpatch.exe

115 KB
Binary file not shown.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Contributions are welcome and we are looking for people that can improve existin
66
You can also contribute by reporting bugs in the [Issue tracker](../../issues), helping review pull requests, participate in discussions about issues and more.
77

88
## Filing issues
9-
1. When filing an issue to report errors or problems, make sure to answer these five questions:
9+
1. When filing an [issue](../../issues) to report errors or problems, make sure to answer these five questions:
1010
1. Which version of ACT are you using?
1111
Run <br/>`act.* -v`<br/> to print ACT's version.
1212
2. Which operating system, programming language(s) and development tools (compiler/interpreter) are you using?

Documentation/IDL.md

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66

7-
| **Version** | 1.3.2 |
7+
| **Version** | 1.5.0 |
88
| --- | --- |
99

1010
## Disclaimer
@@ -76,10 +76,13 @@ Element **\<component>** of type **CT\_Component**
7676
| namespace | **ST\_NameSpace** | required | | Specifies the namespace for the components's functionality. |
7777
| copyright | **xs:string** | required | | The legal copyright holder. |
7878
| basename | **ST\_BaseName** | required | | The basename will be used as prefix for generated filenames and all sorts of identifiers in the generated source code. |
79-
| version | **ST\_Version** | required | | The three digit vesion of this component. |
79+
| version | **ST\_Version** | required | | The semantic version of this component. |
8080
| year | **ST\_Year** | optional | the current year | The year associcated with the copyright. |
8181
| @anyAttribute | | | | |
8282

83+
It is RECOMMENDED that components generated with ACT follow the [semantic versioning scheme](https://semver.org/).
84+
The "version" attribute encodes the semantic version of this component. Major, Minor and Micro-version info MUST be included. Pre-release information and build information MAY be included.
85+
8386
The \<component> element is the root element of a ACT-IDL file.
8487
There MUST be exactly one \<component> element in a ACT-IDL file.
8588
A component MUST have exactly one child [license](#2-license) element,
@@ -147,7 +150,7 @@ of type **CT\_Export**
147150
| language | **ST\_Language** | required | | The programming langugage of this export. |
148151
| indentation | **ST\_Indentation** | optional | 4spaces | Which string should be used to denote a single level of indentation in the generated source code files. |
149152
| stubidentifier | **ST\_StubIdentifier** | optional | "" | Generated sources files of this export will follow the naming schme "...${BaseName}_${stubidentifier}...". Only used in \<implementation> right now. |
150-
| classidentifier | **ST\_ClassIdentifier** | optional | "" | Generated classes of this export will follow the naming schme "...${ClassIdentifier}${NameSpace}_${ClassName}...". Only used in \<implementation> right now. |
153+
| classidentifier | **ST\_ClassIdentifier** | optional | "" | Generated classes of this export will follow the naming schme "...${ClassIdentifier}_${ClassName}...". The only binding that supports this are the C++-bindings.|
151154

152155
## 7. Global
153156
Element **\<global>** of type **CT\_Global**
@@ -157,18 +160,38 @@ Element **\<global>** of type **CT\_Global**
157160
##### Attributes
158161
| Name | Type | Use | Default | Annotation |
159162
| --- | --- | --- | --- | --- |
163+
| baseclassname | **ST\_Name** | required | | Specifies the name of a class that is the base class for all classes of the generated component. |
160164
| releasemethod | **ST\_Name** | required | | Specifies the name of the method used to release a class instance owned by the generated component. |
161-
| versionmethod | **ST\_Name** | required | | Specifies the name of the method used to obtain the semantic version of the component. |
165+
| versionmethod | **ST\_Name** | required | | Specifies the name of the method used to obtain the major, minor and micro version of the component. |
166+
| prereleasemethod | **ST\_Name** | required | | Specifies the name of the method used to obtain the prerelease information of the component. |
167+
| buildinfomethod | **ST\_Name** | required | | Specifies the name of the method used to obtain the build information of the component. |
168+
| errormethod | **ST\_Name** | required | | Specifies the name of the method used to query the last error that occured during the call of class's method. |
162169
| journalmethod | **ST\_Name** | optional | | Specifies the name of the method used to set the journal file. If ommitted, journalling will not be built into the component. |
163170

164171
The \<global> element contains a list of [method](#9-function-type) elements that define the exported global functions of the component.
165172
The names of the \<method> elements MUST be unique within the \<global> element.
166173

167-
The `releasemethod`-attribute must be the name of a \<method> within the \<global> element of a method that has exactly one parameter with `type="handle"`, `class="BaseClass"` and `pass="in"`.
168-
The `versionmethod`-attribute must be the name of a \<method> within the \<global> element of a method that has exactly three parameters with `type="uint32"` and `pass="out"`.
174+
The `baseclassname`-attribute must be the name of a \<class> element within the components list of classes.
175+
This class will be the base class for all classes of the generated component.
176+
177+
The `releasemethod`-attribute must be the name of a \<method> within the \<global> element of a component that has exactly one parameter with `type="class"`, `class="BaseClass"` and `pass="in"`.
178+
The `versionmethod`-attribute must be the name of a \<method> within the \<global> element of a component that has exactly three parameters. The three parameters MUST be of type `type="uint32"` and `pass="out"`.
179+
The `prereleasemethod`-attribute is optional an can be the name of a \<method> within the \<global> element of a component that has two parameters.
180+
The first parameter MUST be of type `type="bool"` and `pass="return"`, the second parameter MUST be of type `type="string"` and `pass="out"`.
181+
The `buildinfomethod`-attribute is optional an can be the name of a \<method> within the \<global> element of a component that has two parameters.
182+
The first parameter MUST be of type `type="bool"` and `pass="return"`, the second parameter MUST be of type `type="string"` and `pass="out"`.
183+
184+
185+
The `errormethod`-attribute must be the name of a \<method> within the \<global> element of a method that has exactly three parameters:
186+
1. `type="class"`, `class="$BASECLASSNAME"` and `pass="in"`, where `"$BASECLASSNAME"` is the value of the `baseclassname` attribute of the \<global> element.
187+
2. `type="string"` and `pass="out"`: outputs the last error message
188+
3. `type="bool"` and `pass="return"`: returns the instance of the baseclass has an error.
169189

170190
If the `journalmethod` attribute is given, it must be the name of a \<method> within the \<global> element of a method that has exactly one parameter with `type="string"` and `pass="in"`.
171191

192+
**Note**
193+
`type="handle"` is equivalent to `type="class"` for backwards compatibility. It will be removed in a later version.
194+
172195
## 8. Class
173196
Element **\<class>** of type **CT\_Class**
174197

@@ -184,6 +207,10 @@ Element **\<class>** of type **CT\_Class**
184207
The \<class> element contains a list of [method](#9-function-type) elements that define the exported member functions of this class.
185208
The names of the \<method> elements MUST be unique in this list.
186209

210+
If the `parent`-attribute is empty, and the name of this class differs from the `baseclassname`-attribute of the \<global> element, `baseclassname` will be considered as the parent class of this class.
211+
212+
A class MUST be defined in the list of \<class> elements before it is used as parent-class of another class. This restiction rules out circular inheritance. Moreover, the default `baseclassname` MUST be defined as the first \<class> within the IDL-file.
213+
187214
## 9. Function Type
188215
Element **\<functiontype>**
189216
<br/>
@@ -293,6 +320,9 @@ Element **\<errors>** of type **CT\_ErrorList**
293320
The \<errors> element contains a list of [\<error>](#16-error) elements.
294321
The names and codes of the \<error> elements in this list MUST be unique within the \<errors> element.
295322

323+
Each ACT-component MUST contain at least the following 8 error codes:
324+
325+
`NOTIMPLEMENTED`, `INVALIDPARAM`, `INVALIDCAST`, `BUFFERTOOSMALL`, `GENERICEXCEPTION`, `COULDNOTLOADLIBRARY`, `COULDNOTFINDLIBRARYEXPORT`, `INCOMPATIBLEBINARYVERSION`
296326

297327
## 16. Error
298328
Element **\<error>** of type **CT\_Error**
@@ -312,18 +342,41 @@ The simple types of this specification encode features, concepts, data types,
312342
and naming rules used in or required by programming languages.
313343

314344
For now, please look the up in the [ACT.xsd](../Source/ACT.xsd).
315-
TODO: add all simple types here.
316345

317346
### 17.1 Type
318-
ST_Type `string` denotes a null-terminated string. If a component requires arbitrary strings that can contain null-characters, on should use the type `basicarray` of class `uint8`.
347+
Supported types are:
348+
- `bool`: denotes a boolean value (`true` or `false`).
349+
Although this can be encoded in a single bit, the thin C89-layer APIs generated by ACT will use an unsigned 8 bit value (a `uint8` in ACT terms) to encode a boolean value.
350+
A numerical value of `0` encodes `false`, all oher values encode `true`.
351+
Implementations and bindings should use the definition of a boolean value that is native to the respective language of the implementation or binding.
352+
- `uint8`, `uint16`, `uint32`, `uint64`:
353+
An _unsigned_ integer vaules ranging from 0 - 2<sup>8</sup>-1, 0 - 2<sup>16</sup>-1, 0 - 2<sup>32</sup>-1, 0 - 2<sup>64</sup>-1, respectively.
354+
- `int8`, `int16`, `int32`, `int64`:
355+
A _signed_ integer vaules ranging from -2<sup>7</sup> - 2<sup>7</sup>-1, -2<sup>15</sup> - 2<sup>15</sup>-1,
356+
-2<sup>31</sup> - 2<sup>31</sup>-1,
357+
-2<sup>63</sup> - 2<sup>63</sup>-1, respectively.
358+
- `pointer`: An address in memory without knowledge of the kind of data that resides there. In C++, this corresponds to a `void*`.
359+
- `string` denotes a null-terminated string. If a component requires arbitrary strings that can contain null-characters, one should use the type `basicarray` of class `uint8`.
360+
- `single`: Single precision floating point number.
361+
- `double`: Double precision floating point number.
362+
- `struct`: see [13. Struct](#13-struct)
363+
- `enum`: see [11. Enum](#11-enum)
364+
- `basicarray`: an array of [ST\_ScalarTypes](#17-2-scalartype)
365+
- `enumarray`: an array of [enums](#11-enum)
366+
- `structarray`: an array of [structs](#13-struct)
367+
- `handle`: the identifier (address, unique identifier, hash, ...) of a class instance [class instance](#8-class)
368+
- `functiontype`: see [9. Function Type](#9-function-type)
319369

320370
### 17.2 ScalarType
321-
ST_ScalarType `bool` denotes a boolean value (`true` or `false`).
322-
Although this can be encoded in a single bit, the thin C89-layer APIs generated by ACT will use a unsigned 8 bit value (a `uint8` in ACT terms) to encode a boolean value.
323-
A numerical value of `0` encodes `false`, all oher values encode `true`.
324-
Implementations and bindings should use the definition of a boolean value native to the respective language of the implementation or binding.
371+
A subset of scalar or integral of ST\_Type:
372+
373+
`bool`, `uint8`, `uint16`, `uint32`, `uint64`, `int8`, `int16`, `int32`, `int64`, `single`, `double`, `pointer`.
325374

326375
### 17.3 ComposedType
376+
A subset of more complex types, or types composed of other ST\_Types:
377+
378+
`string`, `enum`, `basicarray`, `enumarray`, `structarray`, `handle`, `functiontype`
379+
327380
### 17.4 Name
328381
### 17.5 Description
329382
### 17.6 ErrorName
6.53 KB
Loading

0 commit comments

Comments
 (0)