-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ExternFunction initialization from XML
The implementation follows the MEF proposal for "define-extern-function". This allows any extern C function to be declared in the MEF XML and used later in Expression. The downside is exponential explosion of possible function-interfaces with respect to allowed parameter types and numbers. In particular, the implementation relies on C++ template meta-programming, which heavily slows the build times and increases build memory consumption. The binary size does not increase much with the current implementation. Validation: - Duplicate declarations - Empty return type - Invalid number of parameters exceeding the maximum number - Undefined extern library to lookup the symbol - Undefined extern-function symbol in the reference library Issue #74
- Loading branch information
Showing
11 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-library name="dummy" path="../../../../lib/scram/test/scram_dummy_extern" decorate="true"/> | ||
<define-extern-function name="fun" symbol="foo" library="dummy"> | ||
<int/> | ||
</define-extern-function> | ||
<define-extern-function name="fun" symbol="bar" library="dummy"> | ||
<double/> | ||
</define-extern-function> | ||
</opsa-mef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-library name="dummy" path="../../../../lib/scram/test/scram_dummy_extern" decorate="true"/> | ||
<define-extern-function name="fun1" symbol="foo" library="dummy"/> | ||
</opsa-mef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-library name="dummy" path="../../../../lib/scram/test/scram_dummy_extern" decorate="true"/> | ||
<define-extern-function name="fun1" symbol="foo" library="dummy"> | ||
<int/> | ||
</define-extern-function> | ||
<define-extern-function name="fun2" symbol="bar" library="dummy"> | ||
<double/> | ||
</define-extern-function> | ||
<define-extern-function name="fun3" symbol="identity" library="dummy"> | ||
<double/> | ||
<double/> | ||
</define-extern-function> | ||
</opsa-mef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-library name="dummy" path="../../../../lib/scram/test/scram_dummy_extern" decorate="true"/> | ||
<define-extern-function name="fun1" symbol="foo" library="dummy"> | ||
<double/> | ||
<double/> | ||
<double/> | ||
<double/> | ||
<double/> | ||
<double/> | ||
<double/> | ||
</define-extern-function> | ||
</opsa-mef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-function name="fun1" symbol="foo" library="dummy"> | ||
<int/> | ||
</define-extern-function> | ||
</opsa-mef> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<opsa-mef> | ||
<define-extern-library name="dummy" path="../../../../lib/scram/test/scram_dummy_extern" decorate="true"/> | ||
<define-extern-function name="fun" symbol="fun" library="dummy"> | ||
<int/> | ||
</define-extern-function> | ||
</opsa-mef> |