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

#include <libmythprotoserver/sockethandler/filetransfer.h>

Inheritance diagram for FileTransfer:
[legend]
Collaboration diagram for FileTransfer:
[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 filetransfer.h.

Constructor & Destructor Documentation

◆ FileTransfer() [1/2]

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

Definition at line 12 of file filetransfer.cpp.

◆ FileTransfer() [2/2]

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

Definition at line 22 of file filetransfer.cpp.

◆ ~FileTransfer()

FileTransfer::~FileTransfer ( )
overrideprivate

Definition at line 38 of file filetransfer.cpp.

Member Function Documentation

◆ isOpen()

bool FileTransfer::isOpen ( void  )

Definition at line 55 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

◆ ReOpen()

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

Definition at line 60 of file filetransfer.cpp.

◆ Stop()

void FileTransfer::Stop ( void  )

Definition at line 71 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer(), and ~FileTransfer().

◆ Pause()

void FileTransfer::Pause ( void  )

Definition at line 89 of file filetransfer.cpp.

Referenced by Seek().

◆ Unpause()

void FileTransfer::Unpause ( void  )

Definition at line 100 of file filetransfer.cpp.

Referenced by Seek().

◆ RequestBlock()

int FileTransfer::RequestBlock ( int  size)

Definition at line 114 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

◆ WriteBlock()

int FileTransfer::WriteBlock ( int  size)

Definition at line 154 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

◆ Seek()

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

Definition at line 215 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

◆ GetFileSize()

uint64_t FileTransfer::GetFileSize ( void  )

◆ GetFileName()

QString FileTransfer::GetFileName ( void  )

Definition at line 255 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

◆ SetTimeout()

void FileTransfer::SetTimeout ( bool  fast)

Definition at line 263 of file filetransfer.cpp.

Referenced by FileServerHandler::HandleQueryFileTransfer().

Member Data Documentation

◆ m_readthreadlive

volatile bool FileTransfer::m_readthreadlive {true}
private

Definition at line 47 of file filetransfer.h.

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

◆ m_readsLocked

bool FileTransfer::m_readsLocked {false}
private

Definition at line 48 of file filetransfer.h.

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

◆ m_readsUnlockedCond

QWaitCondition FileTransfer::m_readsUnlockedCond
private

Definition at line 49 of file 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 filetransfer.h.

Referenced by Seek().

◆ m_requestBuffer

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

Definition at line 55 of file filetransfer.h.

Referenced by RequestBlock(), and WriteBlock().

◆ m_lock

QMutex FileTransfer::m_lock
private

Definition at line 57 of file filetransfer.h.

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

◆ m_writemode

bool FileTransfer::m_writemode {false}
private

Definition at line 59 of file filetransfer.h.

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


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