MythTV master
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
BEFileTransfer Class Reference

#include <mythbackend/filetransfer.h>

Inheritance diagram for BEFileTransfer:
[legend]
Collaboration diagram for BEFileTransfer:
[legend]

Public Member Functions

 BEFileTransfer (QString &filename, MythSocket *remote, bool usereadahead, std::chrono::milliseconds timeout)
 
 BEFileTransfer (QString &filename, MythSocket *remote, bool write)
 
MythSocketgetSocket ()
 
bool isOpen (void)
 
bool ReOpen (const QString &newFilename="")
 
void Stop (void)
 
void Pause (void)
 
void Unpause (void)
 
int RequestBlock (int size)
 
int WriteBlock (int size)
 
long long Seek (long long curpos, long long pos, int whence)
 
uint64_t GetFileSize (void)
 
QString GetFileName (void)
 
void SetTimeout (bool fast)
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Private Member Functions

 ~BEFileTransfer () override
 

Private Attributes

volatile bool m_readthreadlive {true}
 
bool m_readsLocked {false}
 
QWaitCondition m_readsUnlockedCond
 
ProgramInfom_pginfo {nullptr}
 
MythMediaBufferm_rbuffer {nullptr}
 
MythSocketm_sock {nullptr}
 
bool m_ateof {false}
 
std::vector< char > m_requestBuffer
 
QMutex m_lock
 
bool m_writemode {false}
 

Friends

class QObject
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Detailed Description

Definition at line 20 of file filetransfer.h.

Constructor & Destructor Documentation

◆ BEFileTransfer() [1/2]

BEFileTransfer::BEFileTransfer ( QString &  filename,
MythSocket remote,
bool  usereadahead,
std::chrono::milliseconds  timeout 
)

Definition at line 19 of file filetransfer.cpp.

◆ BEFileTransfer() [2/2]

BEFileTransfer::BEFileTransfer ( QString &  filename,
MythSocket remote,
bool  write 
)

Definition at line 31 of file filetransfer.cpp.

◆ ~BEFileTransfer()

BEFileTransfer::~BEFileTransfer ( )
overrideprivate

Definition at line 45 of file filetransfer.cpp.

Member Function Documentation

◆ GetFileName()

QString BEFileTransfer::GetFileName ( void  )

Definition at line 269 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

◆ GetFileSize()

uint64_t BEFileTransfer::GetFileSize ( void  )

◆ getSocket()

MythSocket * BEFileTransfer::getSocket ( )
inline

Definition at line 29 of file filetransfer.h.

◆ isOpen()

bool BEFileTransfer::isOpen ( void  )

◆ Pause()

void BEFileTransfer::Pause ( void  )

Definition at line 101 of file filetransfer.cpp.

Referenced by Seek().

◆ ReOpen()

bool BEFileTransfer::ReOpen ( const QString &  newFilename = "")

Definition at line 70 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

◆ RequestBlock()

int BEFileTransfer::RequestBlock ( int  size)

Definition at line 128 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

◆ Seek()

long long BEFileTransfer::Seek ( long long  curpos,
long long  pos,
int  whence 
)

Definition at line 229 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

◆ SetTimeout()

void BEFileTransfer::SetTimeout ( bool  fast)

Definition at line 277 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

◆ Stop()

void BEFileTransfer::Stop ( void  )

Definition at line 81 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery(), and ~BEFileTransfer().

◆ Unpause()

void BEFileTransfer::Unpause ( void  )

Definition at line 113 of file filetransfer.cpp.

Referenced by Seek().

◆ WriteBlock()

int BEFileTransfer::WriteBlock ( int  size)

Definition at line 168 of file filetransfer.cpp.

Referenced by MainServer::HandleFileTransferQuery().

Friends And Related Function Documentation

◆ QObject

friend class QObject
friend

Definition at line 22 of file filetransfer.h.

Member Data Documentation

◆ m_ateof

bool BEFileTransfer::m_ateof {false}
private

Definition at line 58 of file filetransfer.h.

Referenced by Seek().

◆ m_lock

QMutex BEFileTransfer::m_lock
private

Definition at line 62 of file filetransfer.h.

Referenced by Pause(), RequestBlock(), Stop(), Unpause(), and WriteBlock().

◆ m_pginfo

ProgramInfo* BEFileTransfer::m_pginfo {nullptr}
private

◆ m_rbuffer

MythMediaBuffer* BEFileTransfer::m_rbuffer {nullptr}
private

◆ m_readsLocked

bool BEFileTransfer::m_readsLocked {false}
private

Definition at line 52 of file filetransfer.h.

Referenced by Pause(), RequestBlock(), Stop(), and Unpause().

◆ m_readsUnlockedCond

QWaitCondition BEFileTransfer::m_readsUnlockedCond
private

Definition at line 53 of file filetransfer.h.

Referenced by RequestBlock(), and Unpause().

◆ m_readthreadlive

volatile bool BEFileTransfer::m_readthreadlive {true}
private

Definition at line 51 of file filetransfer.h.

Referenced by RequestBlock(), Seek(), and Stop().

◆ m_requestBuffer

std::vector<char> BEFileTransfer::m_requestBuffer
private

Definition at line 60 of file filetransfer.h.

Referenced by RequestBlock(), and WriteBlock().

◆ m_sock

MythSocket* BEFileTransfer::m_sock {nullptr}
private

Definition at line 57 of file filetransfer.h.

Referenced by getSocket(), RequestBlock(), WriteBlock(), and ~BEFileTransfer().

◆ m_writemode

bool BEFileTransfer::m_writemode {false}
private

Definition at line 64 of file filetransfer.h.

Referenced by ReOpen(), Stop(), and WriteBlock().


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