summaryrefslogtreecommitdiff
path: root/Skin++/src/Cle2000.hxx
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Skin++/src/Cle2000.hxx
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Skin++/src/Cle2000.hxx')
-rwxr-xr-xSkin++/src/Cle2000.hxx96
1 files changed, 96 insertions, 0 deletions
diff --git a/Skin++/src/Cle2000.hxx b/Skin++/src/Cle2000.hxx
new file mode 100755
index 0000000..af869dd
--- /dev/null
+++ b/Skin++/src/Cle2000.hxx
@@ -0,0 +1,96 @@
+/**
+ * Call a parametrized Cle2000 procedure. A Lifo object is used to manage
+ * input/output parameters for this CLE-2000 procedure.
+ * <P>
+ *
+ * @author Alain Hebert, Ecole Polytechnique de Montreal (2012)
+ */
+#ifndef Cle2000_HXX
+#define Cle2000_HXX
+
+#include <cstddef> // for __GLIBCXX__
+
+#ifdef __GLIBCXX__ // for memory management with shared_ptr
+# include <tr1/memory>
+#else
+# ifdef __IBMCPP__
+# define __IBMCPP_TR1__
+# endif
+# include <memory>
+#endif
+
+#include "Cle2000Exception.hxx"
+#include "Lifo.hxx"
+extern "C" {
+#include <dirent.h>
+int_32 donmod(char *cmodul, int_32 nentry, char (*hentry)[13], int_32 *ientry,
+ int_32 *jentry, lcm **kentry, char (*hparam)[73]);
+}
+#define Cle2000Ptr std::shared_ptr<Cle2000>
+
+namespace ganlib {
+
+/**
+ * Call a parametrized CLE-2000 procedure. A CLE-2000 procedure is implemented
+ * as a 80-column ascii file. The name of that file must have a <tt>".c2m"</tt>
+ * suffix. A Lifo object is used to manage input/output parameters for this
+ * CLE-2000 procedure.
+ * <P>
+ *
+ * @author Alain Hebert, Ecole Polytechnique de Montreal (2012)
+ */
+class Cle2000 {
+public:
+ /** use this constructor to create a new CLE-2000 object
+ * @param sname string containing the name of the ascii file containing the CLE-2000
+ * procedure (without the <tt>".c2m"</tt> suffix)
+ */
+ Cle2000(std::string sname);
+
+ /** use this constructor to create a new Cle2000 object
+ * @param sname string containing the name of the ascii file containing the CLE-2000
+ * procedure (without the <tt>".c2m"</tt> suffix)
+ * @param edit user-defined edition index. Increasing value of <tt>edit</tt> will
+ * cause increasing amount of listing information. Set <tt>edit</tt> to zero to avoid
+ * listing information.
+ */
+ Cle2000(std::string sname, int_32 edit);
+
+ /** use this constructor to create a new Cle2000 object with an embedded Lifo stack
+ * @param sname string containing the name of the ascii file containing the CLE-2000
+ * procedure (without the <tt>".c2m"</tt> suffix)
+ * @param jstack Lifo stack to include in Cle2000 object
+ */
+ Cle2000(std::string sname, LifoPtr jstack);
+
+ /** use this constructor to create a new Cle2000 object with an embedded Lifo stack
+ * @param sname string containing the name of the ascii file containing the CLE-2000
+ * procedure (without the <tt>".c2m"</tt> suffix)
+ * @param edit user-defined edition index. Increasing value of <tt>edit</tt> will
+ * cause increasing amount of listing information. Set <tt>edit</tt> to zero to avoid
+ * listing information.
+ * @param jstack Lifo stack to include in Cle2000 object
+ */
+ Cle2000(std::string sname, int_32 edit, LifoPtr jstack);
+
+ /** Close and destroy a Cle2000 object.
+ */
+ ~Cle2000();
+
+ /** attach a lifo stack to the Cle2000 object
+ * @param myLifo Lifo stack containing input/output parameters
+ */
+ void setLifo(LifoPtr myLifo);
+
+ /** call the native CLE-2000 procedure
+ */
+ void exec();
+
+private:
+ std::string procName;
+ int_32 edit;
+ LifoPtr stack;
+}; // class Cle2000
+
+} // namespace ganlib
+#endif