CPPMyth
Library to interoperate with MythTV server
Loading...
Searching...
No Matches
Myth::ProtoTransfer Class Reference
Inheritance diagram for Myth::ProtoTransfer:
Collaboration diagram for Myth::ProtoTransfer:

Public Member Functions

 ProtoTransfer (const std::string &server, unsigned port, const std::string &pathname, const std::string &sgname)
virtual bool Open ()
virtual void Close ()
void Lock ()
void Unlock ()
bool TryLock ()
void Flush ()
 Flushing unread data previously requested.
uint32_t GetFileId () const
std::string GetPathName () const
std::string GetStorageGroupName () const
int64_t GetSize () const
int64_t GetPosition () const
int64_t GetRequested () const
int64_t GetRemaining () const
void SetSize (int64_t size)
void SetPosition (int64_t position)
void SetRequested (int64_t requested)
Public Member Functions inherited from Myth::ProtoBase
 ProtoBase (const std::string &server, unsigned port)
virtual bool IsOpen ()
virtual unsigned GetProtoVersion () const
virtual std::string GetServer () const
virtual unsigned GetPort () const
virtual int GetSocketErrNo () const
virtual int GetSocket () const
virtual bool HasHanging () const
virtual void CleanHanging ()
virtual ERROR_t GetProtoError () const

Private Member Functions

bool Announce75 ()

Private Attributes

int64_t m_fileSize
 Size of file.
int64_t m_filePosition
 Current read position.
int64_t m_fileRequest
 Current requested position.
uint32_t m_fileId
std::string m_pathName
std::string m_storageGroupName

Additional Inherited Members

Public Types inherited from Myth::ProtoBase
enum  ERROR_t { ERROR_NO_ERROR = 0 , ERROR_SERVER_UNREACHABLE , ERROR_SOCKET_ERROR , ERROR_UNKNOWN_VERSION }
Protected Member Functions inherited from Myth::ProtoBase
bool OpenConnection (int rcvbuf)
void HangException ()
bool SendCommand (const char *cmd, bool feedback=true)
size_t GetMessageLength () const
bool ReadField (std::string &field)
bool IsMessageOK (const std::string &field) const
size_t FlushMessage ()
bool RcvMessageLength ()
ProgramPtr RcvProgramInfo ()
void MakeProgramInfo (const Program &program, std::string &msg)
Protected Attributes inherited from Myth::ProtoBase
OS::Latch * m_latch
TcpSocket * m_socket
unsigned m_protoVersion
std::string m_server
unsigned m_port
bool m_hang
 Connection hang: while true allow retry.
bool m_tainted
 Connection has hung since last reset.
size_t m_msgLength
size_t m_msgConsumed

Detailed Description

Definition at line 35 of file mythprototransfer.h.

Constructor & Destructor Documentation

◆ ProtoTransfer()

ProtoTransfer::ProtoTransfer ( const std::string & server,
unsigned port,
const std::string & pathname,
const std::string & sgname )

Definition at line 38 of file mythprototransfer.cpp.

Member Function Documentation

◆ Announce75()

bool ProtoTransfer::Announce75 ( )
private

Definition at line 112 of file mythprototransfer.cpp.

◆ Close()

void ProtoTransfer::Close ( )
virtual

Reimplemented from Myth::ProtoBase.

Definition at line 70 of file mythprototransfer.cpp.

◆ Flush()

void ProtoTransfer::Flush ( )

Flushing unread data previously requested.

Returns
void

Definition at line 91 of file mythprototransfer.cpp.

References m_filePosition, and m_fileRequest.

◆ GetFileId()

uint32_t ProtoTransfer::GetFileId ( ) const

Definition at line 138 of file mythprototransfer.cpp.

◆ GetPathName()

std::string ProtoTransfer::GetPathName ( ) const

Definition at line 143 of file mythprototransfer.cpp.

◆ GetPosition()

int64_t ProtoTransfer::GetPosition ( ) const

Definition at line 159 of file mythprototransfer.cpp.

◆ GetRemaining()

int64_t ProtoTransfer::GetRemaining ( ) const

Definition at line 171 of file mythprototransfer.cpp.

◆ GetRequested()

int64_t ProtoTransfer::GetRequested ( ) const

Definition at line 165 of file mythprototransfer.cpp.

◆ GetSize()

int64_t ProtoTransfer::GetSize ( ) const

Definition at line 153 of file mythprototransfer.cpp.

◆ GetStorageGroupName()

std::string ProtoTransfer::GetStorageGroupName ( ) const

Definition at line 148 of file mythprototransfer.cpp.

◆ Lock()

void ProtoTransfer::Lock ( )

Definition at line 81 of file mythprototransfer.cpp.

◆ Open()

bool ProtoTransfer::Open ( )
virtual

Implements Myth::ProtoBase.

Definition at line 49 of file mythprototransfer.cpp.

◆ SetPosition()

void ProtoTransfer::SetPosition ( int64_t position)

Definition at line 183 of file mythprototransfer.cpp.

◆ SetRequested()

void ProtoTransfer::SetRequested ( int64_t requested)

Definition at line 189 of file mythprototransfer.cpp.

◆ SetSize()

void ProtoTransfer::SetSize ( int64_t size)

Definition at line 177 of file mythprototransfer.cpp.

◆ Unlock()

void ProtoTransfer::Unlock ( )

Definition at line 86 of file mythprototransfer.cpp.

Field Documentation

◆ m_fileId

uint32_t Myth::ProtoTransfer::m_fileId
private

Definition at line 69 of file mythprototransfer.h.

◆ m_filePosition

int64_t Myth::ProtoTransfer::m_filePosition
private

Current read position.

Definition at line 67 of file mythprototransfer.h.

Referenced by Flush().

◆ m_fileRequest

int64_t Myth::ProtoTransfer::m_fileRequest
private

Current requested position.

Definition at line 68 of file mythprototransfer.h.

Referenced by Flush().

◆ m_fileSize

int64_t Myth::ProtoTransfer::m_fileSize
private

Size of file.

Definition at line 66 of file mythprototransfer.h.

◆ m_pathName

std::string Myth::ProtoTransfer::m_pathName
private

Definition at line 70 of file mythprototransfer.h.

◆ m_storageGroupName

std::string Myth::ProtoTransfer::m_storageGroupName
private

Definition at line 71 of file mythprototransfer.h.


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