Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
operator.list.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_OPERATOR_LIST_H__
22#define __ANTARES_TOOLBOX_FILTER_OPERATOR_LIST_H__
23
24#include <wx/string.h>
25#include <yuni/yuni.h>
26#include <vector>
27
28namespace Antares
29{
30namespace Toolbox
31{
32namespace Filter
33{
34// Forward declaration
35class AFilterBase;
36
37namespace Operator
38{
39// Forward declaration
40class AOperator;
41
45class List
46{
47public:
49
50
51 List(AFilterBase* parent);
53 ~List();
55
59 void clear();
60
67 bool add(const wxString& name);
68
69 void addStdArithmetic(bool withModulo = true);
70 void addStdWeekday(bool withModulo = false);
71 void addStdMonth(bool withModulo = false);
72
73 uint size() const
74 {
75 return (uint)pItems.size();
76 }
77 uint count() const
78 {
79 return (uint)pItems.size();
80 }
81
83 bool empty() const
84 {
85 return pItems.empty();
86 }
87
90 {
91 return pParentFilter;
92 }
93
97 AOperator* at(const int indx) const throw()
98 {
99 return pItems[indx];
100 }
101
103 AOperator* operator[](const int indx) const throw()
104 {
105 return pItems[indx];
106 }
107
108private:
109 bool internalAdd(const wxString& name);
110
111private:
113 AFilterBase* pParentFilter;
115 using OperatorList = std::vector<AOperator*>;
117 OperatorList pItems;
118
119}; // class List
120
121} // namespace Operator
122} // namespace Filter
123} // namespace Toolbox
124} // namespace Antares
125
126#include "operator.h"
127
128#endif // __ANTARES_TOOLBOX_FILTER_OPERATOR_LIST_H__
Abstract Filter.
Definition filter.h:52
Operator list.
Definition operator.list.h:46
bool add(const wxString &name)
Add an operator from its given name.
Definition operator.list.cpp:103
List(AFilterBase *parent)
Constructor.
Definition operator.list.cpp:36
~List()
Destructor.
Definition operator.list.cpp:40
AOperator * at(const int indx) const
Get the operator at a given index.
Definition operator.list.h:97
AFilterBase * parentFilter() const
Get the parent filter.
Definition operator.list.h:89
AOperator * operator[](const int indx) const
Operator [].
Definition operator.list.h:103
bool empty() const
Get if the list is empty.
Definition operator.list.h:83
void clear()
Clear the container.
Definition operator.list.cpp:156