KiCad PCB EDA Suite
Loading...
Searching...
No Matches
std_optional_variants.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21
22
24 wxVariantData()
25{}
26
27
29 wxVariantData(),
30 m_value( aValue )
31{}
32
33
34bool STD_OPTIONAL_INT_VARIANT_DATA::Eq( wxVariantData& aOther ) const
35{
36 try
37 {
38 return dynamic_cast<STD_OPTIONAL_INT_VARIANT_DATA&>( aOther ).m_value == m_value;
39 }
40 catch( std::bad_cast& )
41 {
42 return false;
43 }
44}
45
46
48 wxVariantData()
49{}
50
51
53 wxVariantData(),
54 m_value( aValue )
55{}
56
57
58bool STD_OPTIONAL_DOUBLE_VARIANT_DATA::Eq( wxVariantData& aOther ) const
59{
60 try
61 {
62 return dynamic_cast<STD_OPTIONAL_DOUBLE_VARIANT_DATA&>( aOther ).m_value == m_value;
63 }
64 catch( std::bad_cast& )
65 {
66 return false;
67 }
68}
bool Eq(wxVariantData &aOther) const override
bool Eq(wxVariantData &aOther) const override