Files
rk35xx-android14/external/libchrome-gestures/include/tracer.h
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

38 lines
1.0 KiB
C++

// Copyright 2012 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <gtest/gtest.h>
#include "include/prop_registry.h"
#ifndef GESTURES_TRACER_H__
#define GESTURES_TRACER_H__
namespace gestures {
typedef void (*WriteFn)(const char*);
// This class will automatically help us manage tracing stuff.
// It has a X Property "Tracing Enabled". You can set it true to
// enable tracing.
// In the main program, you can simply use Trace function provided
// by this class to write tracing messages, and it will handle
// whether to output the message or not automatically.
class Tracer {
FRIEND_TEST(TracerTest, TraceTest);
public:
Tracer(PropRegistry* prop_reg, WriteFn write_fn);
~Tracer() {};
void Trace(const char* message, const char* name);
private:
WriteFn write_fn_;
// Disable and enable tracing by setting false and true respectively
BoolProperty tracing_enabled_;
};
} // namespace gestures
#endif // GESTURES_TRACER_H__