Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
console.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Roc Streaming authors
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 //! @file roc_core/target_android/roc_core/console.h
10 //! @brief Console.
11 
12 #ifndef ROC_CORE_CONSOLE_H_
13 #define ROC_CORE_CONSOLE_H_
14 
15 #include "roc_core/attributes.h"
16 #include "roc_core/noncopyable.h"
17 #include "roc_core/singleton.h"
18 
19 namespace roc {
20 namespace core {
21 
22 //! Color ID.
23 enum Color {
24  Color_None,
25 };
26 
27 //! Console.
28 class Console : public NonCopyable<> {
29 public:
30  //! Get logger instance.
31  static Console& instance() {
33  }
34 
35  //! Check if colors can be used.
37 
38  //! Print line.
39  ROC_ATTR_PRINTF(3, 4) void println(Color color, const char* format, ...);
40 
41 private:
42  friend class Singleton<Console>;
43 
44  Console();
45 };
46 
47 } // namespace core
48 } // namespace roc
49 
50 #endif // ROC_CORE_CONSOLE_H_
Compiler attributes.
#define ROC_ATTR_PRINTF(fmt_pos, args_pos)
Function gets printf-like arguments.
Definition: attributes.h:35
Console.
Definition: console.h:28
static Console & instance()
Get logger instance.
Definition: console.h:31
void println(Color color, const char *format,...)
Print line.
bool colors_supported()
Check if colors can be used.
Base class for non-copyable objects.
Definition: noncopyable.h:23
static T & instance()
Get singleton instance.
Definition: singleton.h:29
Color
Color ID.
Definition: console.h:23
Root namespace.
Non-copyable object.
Singleton.