HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_UniversalLogSink.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: UT_UniversalLogSink.h ( FS Library, C++)
7
*
8
* COMMENTS:
9
*
10
*/
11
12
#ifndef __UT_UniversalLogSink__
13
#define __UT_UniversalLogSink__
14
15
#include "
UT_API.h
"
16
#include "
UT_Function.h
"
17
#include "
UT_Lock.h
"
18
#include "
UT_StringSet.h
"
19
#include "
UT_UniversalLogEntry.h
"
20
21
class
UT_StringArray
;
22
class
UT_StringHolder
;
23
24
/// This class exists to amalgamate logging information from a variety of
25
/// sources (UT_UniversalLogSource objects). Log entries can be fetched and
26
/// filtered to present the user with just the logging they are interested in.
27
class
UT_API
UT_UniversalLogSink
28
{
29
public
:
30
using
LogEntryFilterCallback
=
UT_Function
<bool(
31
const
UT_UniversalLogEntry
&)>;
32
33
UT_UniversalLogSink
();
34
virtual
~
UT_UniversalLogSink
();
35
36
/// Each sink creates its own source objects, and can only have one source
37
/// of any given type.
38
void
connect(
const
UT_StringHolder
&source_name);
39
void
disconnect(
const
UT_StringHolder
&source_name);
40
void
disconnectAll();
41
void
getConnectedSourceNames(
UT_StringArray
&source_names);
42
43
void
setFilterEntryCallback
(
const
LogEntryFilterCallback
&callback)
44
{ myLogEntryFilterCallback = callback; }
45
46
/// Record a message from a log source.
47
void
log
(
const
UT_UniversalLogEntry
&entry);
48
49
protected
:
50
virtual
void
doLog(
const
UT_UniversalLogEntry
&entry) = 0;
51
52
private
:
53
UT_StringSet
mySources;
54
UT_Lock
mySourcesLock;
55
LogEntryFilterCallback myLogEntryFilterCallback;
56
};
57
58
#endif
59
UT_API.h
UT_API
#define UT_API
Definition:
UT_API.h:14
UT_UniversalLogEntry.h
UT_SpinLockT< true, false >
UT_UniversalLogSink
Definition:
UT_UniversalLogSink.h:27
UT_UniversalLogSink::LogEntryFilterCallback
UT_Function< bool(const UT_UniversalLogEntry &)> LogEntryFilterCallback
Definition:
UT_UniversalLogSink.h:31
UT_StringHolder
Definition:
UT_StringHolder.h:999
UT_UniversalLogSink::setFilterEntryCallback
void setFilterEntryCallback(const LogEntryFilterCallback &callback)
Definition:
UT_UniversalLogSink.h:43
UT_StringArray
Definition:
UT_StringArray.h:24
UT_StringSet
Definition:
UT_StringSet.h:45
UT_StringSet.h
UT_Function.h
UT_Function
std::function< T > UT_Function
Definition:
UT_Function.h:37
simd::log
OIIO_FORCEINLINE T log(const T &v)
Definition:
simd.h:7688
UT_Lock.h
UT_UniversalLogEntry
Simple object to hold the data associated with a single log entry event.
Definition:
UT_UniversalLogEntry.h:58
UT
UT_UniversalLogSink.h
Generated on Thu Apr 18 2024 03:17:54 for HDK by
1.8.6