Public Member Functions | Protected Member Functions | Protected Attributes | Private Types

fasp::Transport Class Reference

#include <Transport.h>

Collaboration diagram for fasp::Transport:
Collaboration graph
[legend]

Public Member Functions

 Transport (dabc::Reference port, dabc::Command cmd)
virtual ~Transport ()
bool IsRawSocket () const
virtual void ProcessEvent (const dabc::EventId &)
virtual bool ProvidesInput ()
virtual bool ProvidesOutput ()
virtual bool Recv (dabc::Buffer &buf)
virtual unsigned RecvQueueSize () const
virtual dabc::Buffer & RecvBuffer (unsigned indx) const
virtual bool Send (const dabc::Buffer &buf)
virtual unsigned SendQueueSize ()
virtual unsigned MaxSendSegments ()
virtual void StartTransport ()
virtual void StopTransport ()

Protected Member Functions

virtual void ProcessPoolChanged (dabc::MemoryPool *pool)
virtual bool ProcessPoolRequest ()
virtual double ProcessTimeout (double lastdiff)
void ConfigureFor (dabc::Port *port, dabc::Command cmd)
bool ReadFromSocket ()
void WriteToSocket ()
void setFlushTimeout (double tmout)
double getFlushTimeout () const
void FlushBuffer (bool force=false)
void CloseCurrentEvent ()

Protected Attributes

std::string fIfName
int fSockfd
uint8_t fSendbuf [BUF_SIZ]
uint8_t fLastRecvedBlock [BUF_SIZ]
struct sockaddr_ll fSockAddr
uint8_t fSourceMAC [6]
uint8_t fDestMAC [6]
double fSendDelay
bool fPlainData
int rcvCounterNew
int rcvCounterDubl
dabc::TimeStamp fLastFlushTime
dabc::TimeStamp fLastSendTime
size_t fMTU
dabc::Mutex fQueueMutex
dabc::BuffersQueue fQueue
dabc::Buffer fTgtBuf
dabc::Pointer fHdrPtr
dabc::Pointer fDataPtr
unsigned fBufferSize
unsigned fRawSync
dabc::MemoryPoolRef fPool
double fFlushTimeout

Private Types

enum  { BUF_SIZ = 1024 }
enum  { FaspBlockSize = 44, FaspSyncPos = 34 }
enum  { DummySync = 0xffffffff }

Detailed Description

Definition at line 47 of file Transport.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
BUF_SIZ 

Definition at line 53 of file Transport.h.

anonymous enum [private]
Enumerator:
FaspBlockSize 
FaspSyncPos 

Definition at line 55 of file Transport.h.

anonymous enum [private]
Enumerator:
DummySync 

Definition at line 57 of file Transport.h.


Constructor & Destructor Documentation

fasp::Transport::Transport ( dabc::Reference  port,
dabc::Command  cmd 
)
fasp::Transport::~Transport (  )  [virtual]

Definition at line 59 of file Transport.cxx.

References fDataPtr, fHdrPtr, fPool, fQueue, fRawSync, and fTgtBuf.


Member Function Documentation

void fasp::Transport::CloseCurrentEvent (  )  [protected]

Definition at line 362 of file Transport.cxx.

References FaspBlockSize, fDataPtr, fHdrPtr, fRawSync, and roc::proc_FASP.

Referenced by FlushBuffer(), and ReadFromSocket().

void fasp::Transport::ConfigureFor ( dabc::Port *  port,
dabc::Command  cmd 
) [protected]

Index of the network device

Definition at line 71 of file Transport.cxx.

References BUF_SIZ, dest_mac, fBufferSize, fDestMAC, fFlushTimeout, fIfName, fPlainData, fPool, fSendbuf, fSendDelay, fSockAddr, fSockfd, and fSourceMAC.

Referenced by Transport().

void fasp::Transport::FlushBuffer ( bool  force = false  )  [protected]
double fasp::Transport::getFlushTimeout (  )  const [inline, protected]

Definition at line 113 of file Transport.h.

References fFlushTimeout.

bool fasp::Transport::IsRawSocket (  )  const [inline]

Definition at line 126 of file Transport.h.

References fSockfd.

Referenced by fasp::Factory::CreateTransport(), and StartTransport().

virtual unsigned fasp::Transport::MaxSendSegments (  )  [inline, virtual]

Definition at line 139 of file Transport.h.

void fasp::Transport::ProcessEvent ( const dabc::EventId &  evnt  )  [virtual]

Definition at line 330 of file Transport.cxx.

References fLastSendTime, fSendDelay, ReadFromSocket(), and WriteToSocket().

virtual void fasp::Transport::ProcessPoolChanged ( dabc::MemoryPool *  pool  )  [inline, protected, virtual]

Definition at line 99 of file Transport.h.

bool fasp::Transport::ProcessPoolRequest (  )  [protected, virtual]

Definition at line 501 of file Transport.cxx.

double fasp::Transport::ProcessTimeout ( double  lastdiff  )  [protected, virtual]
virtual bool fasp::Transport::ProvidesInput (  )  [inline, virtual]

Definition at line 131 of file Transport.h.

virtual bool fasp::Transport::ProvidesOutput (  )  [inline, virtual]

Definition at line 132 of file Transport.h.

bool fasp::Transport::ReadFromSocket (  )  [protected]

Returns true, when information from FASP/MAXIM received

Definition at line 195 of file Transport.cxx.

References BUF_SIZ, CloseCurrentEvent(), DummySync, FaspBlockSize, FaspBlockSize, FaspSyncPos, FaspSyncPos, fDataPtr, fDestMAC, fLastRecvedBlock, FlushBuffer(), fPlainData, fRawSync, fSockfd, and rcvCounterDubl.

Referenced by ProcessEvent().

bool fasp::Transport::Recv ( dabc::Buffer &  buf  )  [virtual]

Definition at line 476 of file Transport.cxx.

References fQueue, and fQueueMutex.

dabc::Buffer & fasp::Transport::RecvBuffer ( unsigned  indx  )  const [virtual]

Definition at line 494 of file Transport.cxx.

References fQueue, and fQueueMutex.

unsigned fasp::Transport::RecvQueueSize (  )  const [virtual]

Definition at line 487 of file Transport.cxx.

References fQueue, and fQueueMutex.

virtual bool fasp::Transport::Send ( const dabc::Buffer &  buf  )  [inline, virtual]

Definition at line 137 of file Transport.h.

virtual unsigned fasp::Transport::SendQueueSize (  )  [inline, virtual]

Definition at line 138 of file Transport.h.

void fasp::Transport::setFlushTimeout ( double  tmout  )  [inline, protected]

Definition at line 112 of file Transport.h.

References fFlushTimeout.

void fasp::Transport::StartTransport (  )  [virtual]
void fasp::Transport::StopTransport (  )  [virtual]

Definition at line 529 of file Transport.cxx.

References rcvCounterDubl, and rcvCounterNew.

void fasp::Transport::WriteToSocket (  )  [protected]

Definition at line 318 of file Transport.cxx.

References fLastSendTime, fSendbuf, fSockAddr, and fSockfd.

Referenced by ProcessEvent(), and ProcessTimeout().


Field Documentation

unsigned fasp::Transport::fBufferSize [protected]

Definition at line 89 of file Transport.h.

Referenced by ConfigureFor(), FlushBuffer(), StartTransport(), and Transport().

dabc::Pointer fasp::Transport::fDataPtr [protected]
uint8_t fasp::Transport::fDestMAC[6] [protected]

Definition at line 69 of file Transport.h.

Referenced by ConfigureFor(), ReadFromSocket(), and Transport().

double fasp::Transport::fFlushTimeout [protected]
dabc::Pointer fasp::Transport::fHdrPtr [protected]

Definition at line 87 of file Transport.h.

Referenced by CloseCurrentEvent(), FlushBuffer(), StartTransport(), and ~Transport().

std::string fasp::Transport::fIfName [protected]

Definition at line 61 of file Transport.h.

Referenced by ConfigureFor(), and Transport().

dabc::TimeStamp fasp::Transport::fLastFlushTime [protected]

Definition at line 77 of file Transport.h.

Referenced by FlushBuffer(), ProcessTimeout(), and StartTransport().

uint8_t fasp::Transport::fLastRecvedBlock[BUF_SIZ] [protected]

Definition at line 65 of file Transport.h.

Referenced by ReadFromSocket().

dabc::TimeStamp fasp::Transport::fLastSendTime [protected]

Definition at line 78 of file Transport.h.

Referenced by ProcessEvent(), ProcessTimeout(), and WriteToSocket().

size_t fasp::Transport::fMTU [protected]

Definition at line 82 of file Transport.h.

bool fasp::Transport::fPlainData [protected]

Definition at line 71 of file Transport.h.

Referenced by ConfigureFor(), ReadFromSocket(), and Transport().

dabc::MemoryPoolRef fasp::Transport::fPool [protected]

Definition at line 93 of file Transport.h.

Referenced by ConfigureFor(), FlushBuffer(), StartTransport(), and ~Transport().

dabc::BuffersQueue fasp::Transport::fQueue [protected]

Definition at line 84 of file Transport.h.

Referenced by FlushBuffer(), Recv(), RecvBuffer(), RecvQueueSize(), and ~Transport().

dabc::Mutex fasp::Transport::fQueueMutex [protected]

Definition at line 83 of file Transport.h.

Referenced by FlushBuffer(), Recv(), RecvBuffer(), and RecvQueueSize().

unsigned fasp::Transport::fRawSync [protected]
uint8_t fasp::Transport::fSendbuf[BUF_SIZ] [protected]

Definition at line 64 of file Transport.h.

Referenced by ConfigureFor(), and WriteToSocket().

double fasp::Transport::fSendDelay [protected]

Definition at line 70 of file Transport.h.

Referenced by ConfigureFor(), ProcessEvent(), ProcessTimeout(), and Transport().

struct sockaddr_ll fasp::Transport::fSockAddr [protected]

Definition at line 66 of file Transport.h.

Referenced by ConfigureFor(), and WriteToSocket().

int fasp::Transport::fSockfd [protected]

Definition at line 63 of file Transport.h.

Referenced by ConfigureFor(), IsRawSocket(), ReadFromSocket(), Transport(), and WriteToSocket().

uint8_t fasp::Transport::fSourceMAC[6] [protected]

Definition at line 68 of file Transport.h.

Referenced by ConfigureFor(), and Transport().

dabc::Buffer fasp::Transport::fTgtBuf [protected]

Definition at line 86 of file Transport.h.

Referenced by FlushBuffer(), StartTransport(), and ~Transport().

Definition at line 75 of file Transport.h.

Referenced by ReadFromSocket(), StopTransport(), and Transport().

Definition at line 74 of file Transport.h.

Referenced by StopTransport(), and Transport().


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