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

#include <filetransfer.h>

Inheritance diagram for FileTransfer:
Inheritance graph
[legend]
Collaboration diagram for FileTransfer:
Collaboration graph
[legend]

Public Member Functions

 FileTransfer (QString &filename, MythSocket *remote, MythSocketManager *parent, bool usereadahead, std::chrono::milliseconds timeout)
 
 FileTransfer (QString &filename, MythSocket *remote, MythSocketManager *parent, bool write)
 
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 SocketHandler
 SocketHandler (MythSocket *sock, MythSocketManager *parent, QString hostname)
 
 ~SocketHandler () override
 
bool DoesBlockShutdown (void) const
 
bool GetsStandardEvents (void) const
 
bool GetsSystemEvents (void) const
 
QString GetHostname (void)
 
MythSocketGetSocket (void)
 
MythSocketManagerGetParent (void)
 
bool WriteStringList (const QStringList &strlist)
 
bool SendReceiveStringList (QStringList &strlist, uint min_reply_length=0)
 
void BlockShutdown (bool block)
 
void AllowStandardEvents (bool allow)
 
void AllowSystemEvents (bool allow)
 
- 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

 ~FileTransfer () override
 

Private Attributes

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

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 18 of file libs/libmythprotoserver/sockethandler/filetransfer.h.

Constructor & Destructor Documentation

◆ FileTransfer() [1/2]

FileTransfer::FileTransfer ( QString &  filename,
MythSocket remote,
MythSocketManager parent,
bool  usereadahead,
std::chrono::milliseconds  timeout 
)

◆ FileTransfer() [2/2]

FileTransfer::FileTransfer ( QString &  filename,
MythSocket remote,
MythSocketManager parent,
bool  write 
)

◆ ~FileTransfer()

FileTransfer::~FileTransfer ( )
overrideprivate

Member Function Documentation

◆ isOpen()

bool FileTransfer::isOpen ( void  )

◆ ReOpen()

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

◆ Stop()

void FileTransfer::Stop ( void  )

◆ Pause()

void FileTransfer::Pause ( void  )

Definition at line 89 of file libs/libmythprotoserver/sockethandler/filetransfer.cpp.

Referenced by Seek().

◆ Unpause()

void FileTransfer::Unpause ( void  )

Definition at line 100 of file libs/libmythprotoserver/sockethandler/filetransfer.cpp.

Referenced by Seek().

◆ RequestBlock()

int FileTransfer::RequestBlock ( int  size)

◆ WriteBlock()

int FileTransfer::WriteBlock ( int  size)

◆ Seek()

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

◆ GetFileSize()

uint64_t FileTransfer::GetFileSize ( void  )

◆ GetFileName()

QString FileTransfer::GetFileName ( void  )

◆ SetTimeout()

void FileTransfer::SetTimeout ( bool  fast)

Member Data Documentation

◆ m_readthreadlive

volatile bool FileTransfer::m_readthreadlive {true}
private

Definition at line 47 of file libs/libmythprotoserver/sockethandler/filetransfer.h.

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

◆ m_readsLocked

bool FileTransfer::m_readsLocked {false}
private

◆ m_readsUnlockedCond

QWaitCondition FileTransfer::m_readsUnlockedCond
private

Definition at line 49 of file libs/libmythprotoserver/sockethandler/filetransfer.h.

Referenced by RequestBlock(), and Unpause().

◆ m_pginfo

ProgramInfo* FileTransfer::m_pginfo {nullptr}
private

◆ m_rbuffer

MythMediaBuffer* FileTransfer::m_rbuffer {nullptr}
private

◆ m_ateof

bool FileTransfer::m_ateof {false}
private

Definition at line 53 of file libs/libmythprotoserver/sockethandler/filetransfer.h.

Referenced by Seek().

◆ m_requestBuffer

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

◆ m_lock

QMutex FileTransfer::m_lock
private

◆ m_writemode

bool FileTransfer::m_writemode {false}
private

Definition at line 59 of file libs/libmythprotoserver/sockethandler/filetransfer.h.

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


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