Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
basic_control_endpoint.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_ctl/basic_control_endpoint.h
10
//! @brief Base class for control endpoints.
11
12
#ifndef ROC_CTL_BASIC_CONTROL_ENDPOINT_H_
13
#define ROC_CTL_BASIC_CONTROL_ENDPOINT_H_
14
15
#include "
roc_address/endpoint_uri.h
"
16
#include "
roc_core/list_node.h
"
17
#include "
roc_core/ref_counted.h
"
18
#include "
roc_ctl/control_task.h
"
19
#include "
roc_pipeline/receiver_loop.h
"
20
#include "
roc_pipeline/sender_loop.h
"
21
22
namespace
roc
{
23
namespace
ctl
{
24
25
//! Base class for control endpoints.
26
class
BasicControlEndpoint
27
:
public
core::RefCounted
<BasicControlEndpoint, core::ArenaAllocation>,
28
public
core::ListNode
<> {
29
public
:
30
//! Initialization.
31
BasicControlEndpoint
(
core::IArena
&);
32
33
virtual
~BasicControlEndpoint
();
34
35
//! Check if endpoint is successfully bound to local URI.
36
virtual
bool
is_bound
()
const
= 0;
37
38
//! Check if endpoint is successfully connected to remote URI.
39
virtual
bool
is_connected
()
const
= 0;
40
41
//! Initiate asynchronous binding to local URI.
42
//! On completion, resumes @p notify_task.
43
virtual
bool
async_bind
(
const
address::EndpointUri
& uri,
44
ControlTask
& notify_task) = 0;
45
46
//! Initiate asynchronous connecting to remote URI.
47
//! Should be called after successfull bind.
48
//! On completion, resumes @p notify_task.
49
virtual
bool
async_connect
(
const
address::EndpointUri
& uri,
50
ControlTask
& notify_task) = 0;
51
52
//! Initiate asynchronous closing of endpoint.
53
//! On completion, resumes @p notify_task.
54
virtual
void
async_close
(
ControlTask
& notify_task) = 0;
55
56
//! Add sink pipeline controlled by this endpoint.
57
//! Should be called after successfull bind.
58
virtual
bool
attach_sink
(
const
address::EndpointUri
& uri,
59
pipeline::SenderLoop
& sink) = 0;
60
61
//! Remove sink pipeline.
62
//! Should be called for earlier attached sink.
63
virtual
bool
detach_sink
(
pipeline::SenderLoop
& sink) = 0;
64
65
//! Add source pipeline controlled by this endpoint.
66
//! Should be called after successfull bind.
67
virtual
bool
attach_source
(
const
address::EndpointUri
& uri,
68
pipeline::ReceiverLoop
& source) = 0;
69
70
//! Remove source pipeline.
71
//! Should be called for earlier attached source.
72
virtual
bool
detach_source
(
pipeline::ReceiverLoop
& source) = 0;
73
};
74
75
}
// namespace ctl
76
}
// namespace roc
77
78
#endif
// ROC_CTL_BASIC_CONTROL_ENDPOINT_H_
roc::address::EndpointUri
Network endpoint URI.
Definition
endpoint_uri.h:27
roc::core::IArena
Memory arena interface.
Definition
iarena.h:23
roc::core::ListNode
Base class for List element.
Definition
list_node.h:48
roc::core::RefCounted
Base class for object with reference counter.
Definition
ref_counted.h:40
roc::ctl::BasicControlEndpoint::detach_sink
virtual bool detach_sink(pipeline::SenderLoop &sink)=0
Remove sink pipeline. Should be called for earlier attached sink.
roc::ctl::BasicControlEndpoint::async_close
virtual void async_close(ControlTask ¬ify_task)=0
Initiate asynchronous closing of endpoint. On completion, resumes notify_task.
roc::ctl::BasicControlEndpoint::detach_source
virtual bool detach_source(pipeline::ReceiverLoop &source)=0
Remove source pipeline. Should be called for earlier attached source.
roc::ctl::BasicControlEndpoint::is_bound
virtual bool is_bound() const =0
Check if endpoint is successfully bound to local URI.
roc::ctl::BasicControlEndpoint::attach_sink
virtual bool attach_sink(const address::EndpointUri &uri, pipeline::SenderLoop &sink)=0
Add sink pipeline controlled by this endpoint. Should be called after successfull bind.
roc::ctl::BasicControlEndpoint::async_bind
virtual bool async_bind(const address::EndpointUri &uri, ControlTask ¬ify_task)=0
Initiate asynchronous binding to local URI. On completion, resumes notify_task.
roc::ctl::BasicControlEndpoint::BasicControlEndpoint
BasicControlEndpoint(core::IArena &)
Initialization.
roc::ctl::BasicControlEndpoint::async_connect
virtual bool async_connect(const address::EndpointUri &uri, ControlTask ¬ify_task)=0
Initiate asynchronous connecting to remote URI. Should be called after successfull bind....
roc::ctl::BasicControlEndpoint::is_connected
virtual bool is_connected() const =0
Check if endpoint is successfully connected to remote URI.
roc::ctl::BasicControlEndpoint::attach_source
virtual bool attach_source(const address::EndpointUri &uri, pipeline::ReceiverLoop &source)=0
Add source pipeline controlled by this endpoint. Should be called after successfull bind.
roc::ctl::ControlTask
Base class for control tasks.
Definition
control_task.h:53
roc::pipeline::ReceiverLoop
Receiver pipeline loop.
Definition
receiver_loop.h:46
roc::pipeline::SenderLoop
Sender pipeline loop.
Definition
sender_loop.h:44
control_task.h
Control task.
endpoint_uri.h
Network endpoint URI.
list_node.h
Linked list node.
roc::ctl
Control tasks event loop.
roc
Root namespace.
receiver_loop.h
Receiver pipeline loop.
ref_counted.h
Base class for object with reference counter.
sender_loop.h
Sender pipeline loop.
roc_ctl
basic_control_endpoint.h
Generated by
1.17.0