Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
operator.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#ifndef __ANTARES_TOOLBOX_FILTER_OPERATION_H__
22#define __ANTARES_TOOLBOX_FILTER_OPERATION_H__
23
24#include <wx/sizer.h>
25#include "filter.h"
26#include "parameter/parameter.h"
27
28namespace Antares
29{
30namespace Toolbox
31{
32namespace Filter
33{
34// Forward declaration
35class AFilterBase;
36
37namespace Operator
38{
40{
41public:
43
44
45 AOperator(AFilterBase* parent, const wxChar* name, const wxChar* caption);
47 virtual ~AOperator();
49
51
52
53 const wxString& name() const
54 {
55 return pName;
56 }
58
60
61
62 const wxString& caption() const
63 {
64 return pCaption;
65 }
67 void caption(const wxString& v);
69
70 virtual bool compute(const int a) const = 0;
71 virtual bool compute(const double a) const = 0;
72 virtual bool compute(const wxString& a) const = 0;
73
75 template<typename U>
76 bool operator()(const U& a, const U& b) const
77 {
78 return compute(a, b);
79 }
80
84 wxSizer* sizer(wxWindow* parent);
85
86 void refreshAttachedGrid();
87
88public:
90 Parameter::List parameters;
91
92private:
93 AFilterBase* pParentFilter;
95 const wxString pName;
97 wxString pCaption;
99 wxSizer* pSizer;
100
101}; // class AOperator
102
103} // namespace Operator
104} // namespace Filter
105} // namespace Toolbox
106} // namespace Antares
107
108#endif // __ANTARES_TOOLBOX_FILTER_OPERATION_H__
Abstract Filter.
Definition filter.h:52
const wxString & caption() const
Get the caption of the filter.
Definition operator.h:62
bool operator()(const U &a, const U &b) const
Operator ()
Definition operator.h:76
const wxString & name() const
Get the name of the operator.
Definition operator.h:53
virtual ~AOperator()
Destructor.
Definition operator.cpp:38
wxSizer * sizer(wxWindow *parent)
Get the sizer with all controls to interact with parameters.
Definition operator.cpp:42
Parameter::List parameters
Additional parameters.
Definition operator.h:90
void caption(const wxString &v)
Set the caption of the filter.
AOperator(AFilterBase *parent, const wxChar *name, const wxChar *caption)
namespace Constructor & Destructor
Definition operator.cpp:32