source: XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.hpp @ 1762

Last change on this file since 1762 was 1681, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Bug fixed

File size: 1.3 KB
Line 
1#ifndef __XIOS_CUnaryArithmeticFilter__
2#define __XIOS_CUnaryArithmeticFilter__
3
4#include "filter.hpp"
5#include <string>
6#include "operator_expr.hpp"
7
8namespace xios
9{
10  /*!
11   * A generic unary arithmetic filter wrapping any type of unary operator
12   * which can be applied on fields.
13   */
14  class CUnaryArithmeticFilter : public CFilter, public IFilterEngine
15  {
16    public:
17      /*!
18       * Constructs an unary arithmetic filter wrapping the specified operator.
19       *
20       * \param gc the associated garbage collector
21       * \param op the string identifing the unary operator
22       */
23      CUnaryArithmeticFilter(CGarbageCollector& gc, const std::string& op);
24
25    protected:
26      COperatorExpr::functionField op; //!< The unary operator attached to the unary arithmeric filter
27
28
29      /*!
30       * Applies the unary operator to the input data and returns the result.
31       *
32       * \param data a vector of packets corresponding to each slot (one in this case)
33       * \return the result of the unary operation
34       */
35      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data);
36      std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data);
37  }; // class CUnaryArithmeticFilter
38} // namespace xios
39
40#endif //__XIOS_CUnaryArithmeticFilter__
Note: See TracBrowser for help on using the repository browser.