summaryrefslogtreecommitdiff
path: root/Yacs++/src/FACT.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Yacs++/src/FACT.cxx')
-rwxr-xr-xYacs++/src/FACT.cxx28
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;
+}