1.1.1. 4.2.1 Changes
CHEAT SHEET | |
ITM | IMAS |
---|---|
#include "UALClasses.h" | #include "UALClasses.h" |
ItmNs::Itm::<cpo> cpo; | IdsNs::IDS::<ids> ids; |
ItmNs::Itm::<cpo>Array cpoArray; <= Array! | IdsNs::IDS::<ids> ids; <= Single obj ! |
ItmNs::codeparam_t & codeparam | IdsNs::codeparam_t & codeparam |
eval-pkg-config | pkg-config |
eval-pkg-config --cflags --libs ual-cpp-gnu | pkg-config --cflags --libs imas-cpp |
1.1.2. 4.2.2 Examples
Examples of interface between wrapper and user code | |
---|---|
ITM /**** Simple types ***/ void simple(double &x, double &y) /**** Single slice ***/ void slice( ItmNs::Itm::equilibrium &eq) /**** Array of slices ***/ void slice_array( ItmNs::Itm::equilibriumArray &eq) /**** Code XML parameters ***/ void code_params(...., ItmNs::codeparam_t& param) /**** Arbitrary diagnostic info ***/ void diag_info(...., int* outFlag, char** diagInfo) | IMAS /**** Simple types ***/ void simple(double &x, double &y) /**** Single slice ***/ void slice(IdsNs::IDS::equilibrium &eq) /**** Array of slices ***/ void slice_array( IdsNs::IDS:equilibrium &eq) /**** Code XML parameters ***/ void code_params(...., IdsNs::codeparam_t& param) /**** Arbitrary diagnostic info ***/ void diag_info(...., int* outFlag, char** diagInfo) |
1.1.3. 4.2.3 Delivery of the user code
The user code should be delivered as a static library.
Please find examples of the simple "Makefile" below:
Example 7. Building of C++ code
CXX=g++ CXXFLAGS= -g -fPIC CXXINCLUDES= ${shell pkg-config --cflags imas-cpp} all: libsimplecppactor.a libsimplecppactor.a: simplecppactor.o ar -rvs $@ $^ simplecppactor.o: simplecppactor.cpp $(CXX) $(CXXFLAGS) $(CXXINCLUDES) -c -o $@ $^ clean: rm *.a *.o