source: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/unary_arithmetic_filter.hpp @ 2230

Last change on this file since 2230 was 2193, checked in by yushan, 3 years ago

workflow graph : enable unary and binary arithmetic filters

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::pair<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.