Ardour
9.0-pre0-582-g084a23a80d
typed_value.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 Luciano Iam <oss@lucianoiam.com>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#ifndef _ardour_surface_websockets_typed_value_h_
20
#define _ardour_surface_websockets_typed_value_h_
21
22
#include <string>
23
24
namespace
ArdourSurface
{
25
26
class
TypedValue
27
{
28
public
:
29
enum
Type
{
30
Empty
,
31
Bool
,
32
Int
,
33
Double
,
34
String
35
};
36
37
TypedValue
();
38
TypedValue
(
bool
);
39
TypedValue
(
int
);
40
TypedValue
(
double
);
41
TypedValue
(std::string);
42
43
bool
empty
()
const
44
{
45
return
_type
==
Empty
;
46
};
47
Type
type
()
const
48
{
49
return
_type
;
50
};
51
52
operator
bool ()
const
;
53
operator
int ()
const
;
54
operator
double ()
const
;
55
operator
std::string ()
const
;
56
57
bool
operator==
(
const
TypedValue
& other)
const
;
58
bool
operator!=
(
const
TypedValue
& other)
const
;
59
60
std::string
debug_str
()
const
;
61
62
private
:
63
Type
_type
;
64
bool
_b
;
65
int
_i
;
66
double
_d
;
67
std::string
_s
;
68
};
69
70
}
// namespace ArdourSurface
71
72
#endif
// _ardour_surface_websockets_typed_value_h_
ArdourSurface::TypedValue
Definition:
typed_value.h:27
ArdourSurface::TypedValue::type
Type type() const
Definition:
typed_value.h:47
ArdourSurface::TypedValue::_b
bool _b
Definition:
typed_value.h:64
ArdourSurface::TypedValue::TypedValue
TypedValue(std::string)
ArdourSurface::TypedValue::_i
int _i
Definition:
typed_value.h:65
ArdourSurface::TypedValue::debug_str
std::string debug_str() const
ArdourSurface::TypedValue::TypedValue
TypedValue(int)
ArdourSurface::TypedValue::TypedValue
TypedValue(bool)
ArdourSurface::TypedValue::_d
double _d
Definition:
typed_value.h:66
ArdourSurface::TypedValue::_s
std::string _s
Definition:
typed_value.h:67
ArdourSurface::TypedValue::TypedValue
TypedValue(double)
ArdourSurface::TypedValue::operator==
bool operator==(const TypedValue &other) const
ArdourSurface::TypedValue::_type
Type _type
Definition:
typed_value.h:63
ArdourSurface::TypedValue::TypedValue
TypedValue()
ArdourSurface::TypedValue::operator!=
bool operator!=(const TypedValue &other) const
ArdourSurface::TypedValue::empty
bool empty() const
Definition:
typed_value.h:43
ArdourSurface::TypedValue::Type
Type
Definition:
typed_value.h:29
ArdourSurface::TypedValue::Int
@ Int
Definition:
typed_value.h:32
ArdourSurface::TypedValue::Empty
@ Empty
Definition:
typed_value.h:30
ArdourSurface::TypedValue::String
@ String
Definition:
typed_value.h:34
ArdourSurface::TypedValue::Double
@ Double
Definition:
typed_value.h:33
ArdourSurface::TypedValue::Bool
@ Bool
Definition:
typed_value.h:31
ArdourSurface
Definition:
cc121.h:71
libs
surfaces
websockets
typed_value.h
Generated on Wed Dec 25 2024 05:44:56 for Ardour by
1.9.1