Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::netio::NetworkTask Class Reference

Base class for network loop tasks. More...

#include <network_task.h>

Inheritance diagram for roc::netio::NetworkTask:
Collaboration diagram for roc::netio::NetworkTask:

Public Member Functions

bool success () const
 Check that the task finished and succeeded. More...
 
- Public Member Functions inherited from roc::core::MpscQueueNode< Tag >
MpscQueueDatampsc_queue_data () const
 Get pointer to internal data. More...
 

Protected Types

enum  State {
  StateInitialized , StatePending , StateClosingPort , StateFinishing ,
  StateFinished
}
 Task state. More...
 

Protected Attributes

void(NetworkLoop::* func_ )(NetworkTask &)
 Task implementation method. More...
 
core::Atomic< int > state_
 Task state, defines whether task is finished already. The task becomes immutable after setting state to Finished. More...
 
core::Atomic< int > success_
 Task result, defines wether finished task succeeded or failed. Makes sense only after setting state_ to Finished. This atomic should be assigned before setting state_ to Finished. More...
 
core::SharedPtr< BasicPortport_
 On which port the task operates. More...
 
void * port_handle_
 Port handle. More...
 
INetworkTaskCompletercompleter_
 Completion handler. More...
 
core::Optional< core::Semaphoresem_
 Completion semaphore. More...
 

Friends

class NetworkLoop
 

Additional Inherited Members

- Static Public Member Functions inherited from roc::core::MpscQueueNode< Tag >
static MpscQueueNodempsc_queue_node (MpscQueueData *data)
 Get pointer to parent node from pointer to internal data. More...
 

Detailed Description

Base class for network loop tasks.

Definition at line 29 of file network_task.h.

Member Enumeration Documentation

◆ State

Task state.

Definition at line 42 of file network_task.h.

Member Function Documentation

◆ success()

bool roc::netio::NetworkTask::success ( ) const

Check that the task finished and succeeded.

Member Data Documentation

◆ completer_

INetworkTaskCompleter* roc::netio::NetworkTask::completer_
protected

Completion handler.

Definition at line 65 of file network_task.h.

◆ func_

void(NetworkLoop::* roc::netio::NetworkTask::func_) (NetworkTask &)
protected

Task implementation method.

Definition at line 51 of file network_task.h.

◆ port_

core::SharedPtr<BasicPort> roc::netio::NetworkTask::port_
protected

On which port the task operates.

Definition at line 62 of file network_task.h.

◆ port_handle_

void* roc::netio::NetworkTask::port_handle_
protected

Port handle.

Definition at line 63 of file network_task.h.

◆ sem_

core::Optional<core::Semaphore> roc::netio::NetworkTask::sem_
protected

Completion semaphore.

Definition at line 66 of file network_task.h.

◆ state_

core::Atomic<int> roc::netio::NetworkTask::state_
protected

Task state, defines whether task is finished already. The task becomes immutable after setting state to Finished.

Definition at line 55 of file network_task.h.

◆ success_

core::Atomic<int> roc::netio::NetworkTask::success_
protected

Task result, defines wether finished task succeeded or failed. Makes sense only after setting state_ to Finished. This atomic should be assigned before setting state_ to Finished.

Definition at line 60 of file network_task.h.


The documentation for this class was generated from the following file: