DebugServer2
Loading...
Searching...
No Matches
Headers
DebugServer2
Host
QueueChannel.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/Core/MessageQueue.h"
14
#include "DebugServer2/Host/Channel.h"
15
#include "DebugServer2/Types.h"
16
17
#include <string>
18
19
namespace
ds2 {
20
namespace
Host {
21
22
class
QueueChannel
:
public
Channel
{
23
public
:
24
Channel
*_remote;
25
MessageQueue
_queue;
26
27
public
:
28
QueueChannel
(
Channel
*remote);
29
~QueueChannel
()
override
;
30
31
public
:
32
inline
Channel
*remote()
const
{
33
return
const_cast<
QueueChannel
*
>
(
this
)->_remote;
34
}
35
inline
MessageQueue
&queue()
const
{
36
return
const_cast<
QueueChannel
*
>
(
this
)->_queue;
37
}
38
39
public
:
40
void
close()
override
;
41
42
public
:
43
bool
connected()
const override
;
44
45
public
:
46
bool
wait(
int
ms = -1)
override
;
47
48
public
:
49
ssize_t send(
void
const
*buffer,
size_t
length)
override
;
50
ssize_t receive(
void
*buffer,
size_t
length)
override
;
51
52
public
:
53
bool
receive(std::string &buffer)
override
;
54
};
55
}
// namespace Host
56
}
// namespace ds2
ds2::Host::Channel
Definition
Channel.h:18
ds2::Host::QueueChannel
Definition
QueueChannel.h:22
ds2::MessageQueue
Definition
MessageQueue.h:22
Generated by
1.12.0