-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathp44utils_defs.hpp
62 lines (50 loc) · 1.9 KB
/
p44utils_defs.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Copyright (c) 2014-2023 plan44.ch / Lukas Zeller, Zurich, Switzerland
//
// Author: Lukas Zeller <luz@plan44.ch>
//
// This file is part of p44utils.
//
// p44utils is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// p44utils is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with p44utils. If not, see <http://www.gnu.org/licenses/>.
#ifndef __p44utils__p44utils_defs__
#define __p44utils__p44utils_defs__
#include "p44utils_minimal.hpp"
/// Definitions: types, constants with no dependency on any other header file
using namespace std;
namespace p44 {
/// @name Mainloop timing unit
/// @{
typedef long long MLMicroSeconds; ///< Mainloop time in microseconds
const MLMicroSeconds Never = 0;
const MLMicroSeconds Infinite = -1;
const MLMicroSeconds MicroSecond = 1;
const MLMicroSeconds MilliSecond = 1000;
const MLMicroSeconds Second = 1000*MilliSecond;
const MLMicroSeconds Minute = 60*Second;
const MLMicroSeconds Hour = 60*Minute;
const MLMicroSeconds Day = 24*Hour;
/// @}
/// Special Constant to use for empty boost::function arguments
/// @note use this, not NULL, because NULL is nullptr in more recent C++ environments,
/// which is incompatible with boost::function constructors. A plain 0 is compatible.
#define NoOP 0
/// tristate type
typedef enum {
yes = 1,
no = 0,
undefined = -1
} Tristate;
} // namespace p44
#endif /* __p44utils__p44utils_defs__ */