File: mpOprtPostfixCommon.h

package info (click to toggle)
muparserx 4.0.7%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,152 kB
  • ctags: 1,591
  • sloc: cpp: 10,587; makefile: 64; ansic: 14
file content (51 lines) | stat: -rwxr-xr-x 1,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef MP_OPRT_POSTFIX_COMMON_H
#define MP_OPRT_POSTFIX_COMMON_H

/** \file
    \brief Definitions of classes used as callbacks for standard postfix operators.
*/

/** \defgroup postop Postfix operator callbacks

  This group lists the objects representing the postfix operators of muParserX.
*/

#include "mpIOprt.h"
#include "mpValue.h"
#include "mpError.h"


MUP_NAMESPACE_START

  //------------------------------------------------------------------------------
  /** \brief Calculate factorial of a non-negative integer.
      \ingroup postop
  */
  class OprtFact : public IOprtPostfix
  {
  public:

    OprtFact();

    virtual void Eval(ptr_val_type& ret, const ptr_val_type *arg, int);
    virtual const char_type* GetDesc() const override;
    virtual IToken* Clone() const override;
  };

  //------------------------------------------------------------------------------
  /** \brief Returns percentage of given number.
      \ingroup postop
  */
  class OprtPercentage : public IOprtPostfix
  {
    public:

      OprtPercentage();

      virtual void Eval(ptr_val_type& ret, const ptr_val_type *arg, int) override;
      virtual const char_type* GetDesc() const override;
      virtual IToken* Clone() const override;
  };
}  // namespace mu

#endif