diff options
| author | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
|---|---|---|
| committer | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
| commit | 7dfcc480ba1e19bd3232349fc733caef94034292 (patch) | |
| tree | 03ee104eb8846d5cc1a981d267687a729185d3f3 /Yacs++/src/FACT.cxx | |
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Yacs++/src/FACT.cxx')
| -rwxr-xr-x | Yacs++/src/FACT.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Yacs++/src/FACT.cxx b/Yacs++/src/FACT.cxx new file mode 100755 index 0000000..1b25937 --- /dev/null +++ b/Yacs++/src/FACT.cxx @@ -0,0 +1,28 @@ +#include "FACT.hxx" +#include "Cle2000.hxx" +using namespace boost; using namespace std; using namespace ganlib; + +FACT::FACT() { + cout << "New FACT object constructed.'" << endl; +} + +void FACT::run(long a, long& b) { + // construct the lifo stack + LifoPtr ipLifo = LifoPtr(new Lifo()); + ipLifo->push("input_val",int_32(a)); + ipLifo->pushEmpty("output_val","I"); + + // call the procedure with in-out CLE-2000 variables + Cle2000Ptr ipCle2000 = Cle2000Ptr(new Cle2000("fact", 0, ipLifo)); + ipCle2000->exec(); + + // recover and erase the lifo stack + int_32 output_val; ipLifo->pop(output_val); + b = (long)output_val; + + // empty the lifo stack + while (ipLifo->getMax() > 0) ipLifo->pop(); + + // end of case ----------------------------------------------------------- + cout << "FACT::run: successful end of execution" << endl; +} |
