Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FdHubPort< HFlow >::ReadThread Class Reference

Thread performing the read operations on the device. More...

#include <HubDevice.hxx>

Inheritance diagram for FdHubPort< HFlow >::ReadThread:
FdHubPortBase::ReadThreadBase OSThread

Public Member Functions

 ReadThread (FdHubPort< HFlow > *port)
 Constructor.
 
FdHubPort< HFlow > * port ()
 
int unit () OVERRIDE
 
int buf_size () OVERRIDE
 
void send_message (const void *buf, int size) OVERRIDE
 Sends off a buffer.
 
void send_message (const void *buf, int size)
 Sends off a buffer.
 
void send_message (const void *buf, int size)
 Sends off a buffer.
 
- Public Member Functions inherited from FdHubPortBase::ReadThreadBase
 ReadThreadBase (FdHubPortBase *port)
 Constructor.
 
void * entry () OVERRIDE
 User entry point for the created thread.
 
- Public Member Functions inherited from OSThread
 OSThread (const char *name, int priority, size_t stack_size, void *(*start_routine)(void *), void *arg)
 Create a thread.
 
 OSThread ()
 Creates a thread via inheritance.
 
void start (const char *name, int priority, size_t stack_size)
 Starts the thread.
 
virtual ~OSThread ()
 Default destructor.
 
bool is_created ()
 
void inherit ()
 Inherits the current thread.
 
os_thread_t get_handle ()
 
void lock_to_thread ()
 Sets the thread handle to the current calling thread's.
 
void unlock_from_thread ()
 Resets the thread handle to none.
 

Private Member Functions

void init ()
 Initializes the semaphore notifiables.
 
const int kUnit
 
const int kBufSize
 
void init ()
 
const int kUnit
 
const int kBufSize
 
void init ()
 

Private Attributes

SemaphoreNotifiableBlocksemaphores_ {nullptr}
 If non-null, one slot will be acquired for each incoming message.
 

Static Private Attributes

static const int kUnit
 This is the minimum number of bytes that we will send.
 
static const int kBufSize
 We will allocate this many bytes for read buffer.
 

Additional Inherited Members

- Static Public Member Functions inherited from OSThread
static int getpriority (OSThread *thread)
 Return the current thread priority.
 
static int get_priority (OSThread *thread)
 Return the current thread priority.
 
static int get_priority_min ()
 Get the minimum thread priority.
 
static int get_priority_max ()
 Get the maximum thread priority.
 
- Protected Attributes inherited from FdHubPortBase::ReadThreadBase
FdHubPortBaseport_
 Parent port.
 

Detailed Description

template<class HFlow>
class FdHubPort< HFlow >::ReadThread

Thread performing the read operations on the device.

Definition at line 322 of file HubDevice.hxx.

Constructor & Destructor Documentation

◆ ReadThread()

template<class HFlow >
FdHubPort< HFlow >::ReadThread::ReadThread ( FdHubPort< HFlow > *  port)
inline

Constructor.

Parameters
portis the parent flow.

Definition at line 326 of file HubDevice.hxx.

◆ ~ReadThread()

template<class HFlow >
FdHubPort< HFlow >::ReadThread::~ReadThread ( )
inline

Definition at line 333 of file HubDevice.hxx.

Member Function Documentation

◆ buf_size()

template<class HFlow >
int FdHubPort< HFlow >::ReadThread::buf_size ( )
inlinevirtual
Returns
We will allocate this many bytes for read buffer. This is the maximum number of bytes that we'll send.

Implements FdHubPortBase::ReadThreadBase.

Definition at line 350 of file HubDevice.hxx.

◆ init() [1/2]

void FdHubPort::ReadThread< CanHubFlow >::init ( )
private

Definition at line 45 of file HubDevice.cxx.

◆ init() [2/2]

void FdHubPort::ReadThread< HubFlow >::init ( )
private

Definition at line 66 of file HubDevice.cxx.

◆ kBufSize() [1/2]

const int FdHubPort::ReadThread< CanHubFlow >::kBufSize
private

Definition at line 41 of file HubDevice.cxx.

◆ kBufSize() [2/2]

const int FdHubPort::ReadThread< HubFlow >::kBufSize
private

Definition at line 62 of file HubDevice.cxx.

◆ kUnit() [1/2]

const int FdHubPort::ReadThread< CanHubFlow >::kUnit
private

Definition at line 39 of file HubDevice.cxx.

◆ kUnit() [2/2]

const int FdHubPort::ReadThread< HubFlow >::kUnit
private

Definition at line 61 of file HubDevice.cxx.

◆ port()

template<class HFlow >
FdHubPort< HFlow > * FdHubPort< HFlow >::ReadThread::port ( )
inline
Returns
the parent flow

Definition at line 338 of file HubDevice.hxx.

◆ send_message() [1/3]

void FdHubPort::ReadThread< CanHubFlow >::send_message ( const void *  buf,
int  size 
)
virtual

Sends off a buffer.

Implements FdHubPortBase::ReadThreadBase.

Definition at line 52 of file HubDevice.cxx.

◆ send_message() [2/3]

void FdHubPort::ReadThread< HubFlow >::send_message ( const void *  buf,
int  size 
)
virtual

Sends off a buffer.

Implements FdHubPortBase::ReadThreadBase.

Definition at line 76 of file HubDevice.cxx.

◆ send_message() [3/3]

template<class HFlow >
void FdHubPort< HFlow >::ReadThread::send_message ( const void *  buf,
int  size 
)
virtual

Sends off a buffer.

Implements FdHubPortBase::ReadThreadBase.

◆ unit()

template<class HFlow >
int FdHubPort< HFlow >::ReadThread::unit ( )
inlinevirtual
Parameters
thisis the minimum number of bytes that we will send.

Implements FdHubPortBase::ReadThreadBase.

Definition at line 344 of file HubDevice.hxx.

Member Data Documentation

◆ kBufSize

template<class HFlow >
const int FdHubPort< HFlow >::ReadThread::kBufSize
staticprivate

We will allocate this many bytes for read buffer.

This is the maximum number of bytes that we'll send.

Definition at line 367 of file HubDevice.hxx.

◆ kUnit

template<class HFlow >
const int FdHubPort< HFlow >::ReadThread::kUnit
staticprivate

This is the minimum number of bytes that we will send.

Definition at line 364 of file HubDevice.hxx.

◆ semaphores_

template<class HFlow >
SemaphoreNotifiableBlock* FdHubPort< HFlow >::ReadThread::semaphores_ {nullptr}
private

If non-null, one slot will be acquired for each incoming message.

Definition at line 361 of file HubDevice.hxx.


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