DebugServer2
Loading...
Searching...
No Matches
Headers
DebugServer2
GDBRemote
PacketProcessor.h
1
//
2
// Copyright (c) 2014-present, Facebook, Inc.
3
// All rights reserved.
4
//
5
// This source code is licensed under the University of Illinois/NCSA Open
6
// Source License found in the LICENSE file in the root directory of this
7
// source tree. An additional grant of patent rights can be found in the
8
// PATENTS file in the same directory.
9
//
10
11
#pragma once
12
13
#include "DebugServer2/Types.h"
14
15
namespace
ds2 {
16
namespace
GDBRemote {
17
18
struct
PacketProcessorDelegate;
19
20
class
PacketProcessor
{
21
public
:
22
virtual
~PacketProcessor
() {}
23
24
protected
:
25
std::string _buffer;
26
size_t
_nreqs;
27
bool
_needhash;
28
PacketProcessorDelegate
*_delegate;
29
30
public
:
31
PacketProcessor
();
32
33
public
:
34
inline
void
setDelegate(
PacketProcessorDelegate
*delegate) {
35
_delegate = delegate;
36
}
37
inline
PacketProcessorDelegate
*delegate()
const
{
38
return
const_cast<
PacketProcessor
*
>
(
this
)->_delegate;
39
}
40
41
public
:
42
void
parse(std::string
const
&data);
43
44
private
:
45
void
process();
46
47
private
:
48
bool
validate();
49
};
50
51
struct
PacketProcessorDelegate
{
52
virtual
~PacketProcessorDelegate
() {}
53
virtual
void
onPacketData(std::string
const
&data,
bool
valid) = 0;
54
virtual
void
onInvalidData(std::string
const
&data) = 0;
55
};
56
}
// namespace GDBRemote
57
}
// namespace ds2
ds2::GDBRemote::PacketProcessor
Definition
PacketProcessor.h:20
ds2::GDBRemote::PacketProcessorDelegate
Definition
PacketProcessor.h:51
Generated by
1.12.0