Salome HOME
Merge branch 'abn/fix_intersec' into V7_main
[tools/medcoupling.git] / src / INTERP_KERNEL / ExprEval / InterpKernelFunction.hxx
index cfd4bf692a1be1ccae5c98c82c3c776db84b2533..95ccbbd997f5e385d658becd242c6ebb9d5d2dc6 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
 
 #ifndef __INTERPKERNELFUNCTION_HXX__
 #define __INTERPKERNELFUNCTION_HXX__
@@ -33,12 +34,12 @@ namespace INTERP_KERNEL
   class INTERPKERNEL_EXPORT FunctionsFactory
   {
   public:
-    static Function *buildFuncFromString(const char *type, int nbOfParams) throw(INTERP_KERNEL::Exception);
-    static Function *buildUnaryFuncFromString(const char *type) throw(INTERP_KERNEL::Exception);
-    //static Function *buildUnaryFuncFromString(char type) throw(INTERP_KERNEL::Exception);
-    static Function *buildBinaryFuncFromString(const char *type) throw(INTERP_KERNEL::Exception);
-    static Function *buildBinaryFuncFromString(char type) throw(INTERP_KERNEL::Exception);
-    static Function *buildTernaryFuncFromString(const char *type) throw(INTERP_KERNEL::Exception);
+    static Function *buildFuncFromString(const char *type, int nbOfParams);
+    static Function *buildUnaryFuncFromString(const char *type);
+    //static Function *buildUnaryFuncFromString(char type);
+    static Function *buildBinaryFuncFromString(const char *type);
+    static Function *buildBinaryFuncFromString(char type);
+    static Function *buildTernaryFuncFromString(const char *type);
   };
 
   class INTERPKERNEL_EXPORT Function
@@ -46,8 +47,8 @@ namespace INTERP_KERNEL
   public:
     virtual ~Function();
     virtual int getNbInputParams() const = 0;
-    virtual void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception) = 0;
-    virtual void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception) = 0;
+    virtual void operate(std::vector<Value *>& stack) const = 0;
+    virtual void operateX86(std::vector<std::string>& asmb) const = 0;
     virtual const char *getRepr() const = 0;
     virtual bool isACall() const = 0;
   };
@@ -62,8 +63,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~IdentityFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -74,8 +75,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~PositiveFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -86,8 +87,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~NegateFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -98,8 +99,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~CosFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -110,8 +111,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~SinFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -122,8 +123,80 @@ namespace INTERP_KERNEL
   {
   public:
     ~TanFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT ACosFunction : public UnaryFunction
+  {
+  public:
+    ~ACosFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT ASinFunction : public UnaryFunction
+  {
+  public:
+    ~ASinFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT ATanFunction : public UnaryFunction
+  {
+  public:
+    ~ATanFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT CoshFunction : public UnaryFunction
+  {
+  public:
+    ~CoshFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT SinhFunction : public UnaryFunction
+  {
+  public:
+    ~SinhFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
+    const char *getRepr() const;
+    bool isACall() const;
+  public:
+    static const char REPR[];
+  };
+
+  class INTERPKERNEL_EXPORT TanhFunction : public UnaryFunction
+  {
+  public:
+    ~TanhFunction();
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -134,8 +207,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~SqrtFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -146,8 +219,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~AbsFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -158,8 +231,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~ExpFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -170,8 +243,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~LnFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -182,8 +255,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~LogFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -194,8 +267,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~Log10Function();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -212,8 +285,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~PlusFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -224,8 +297,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~MinusFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -236,8 +309,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~MultFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -248,8 +321,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~DivFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -260,8 +333,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~PowFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -272,8 +345,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~MaxFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -284,8 +357,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~MinFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -296,8 +369,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~GreaterThanFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -308,8 +381,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~LowerThanFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public:
@@ -326,8 +399,8 @@ namespace INTERP_KERNEL
   {
   public:
     ~IfFunction();
-    void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
-    void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+    void operate(std::vector<Value *>& stack) const;
+    void operateX86(std::vector<std::string>& asmb) const;
     const char *getRepr() const;
     bool isACall() const;
   public: