Data Structures | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

roc::UdpDataSocket Class Reference

#include <UdpTransport.h>

Collaboration diagram for roc::UdpDataSocket:
Collaboration graph
[legend]

Data Structures

struct  ResendInfo

Public Member Functions

 UdpDataSocket (UdpDevice *dev, dabc::Reference port, dabc::Command cmd, int fd, int fmt)
virtual ~UdpDataSocket ()
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 Types

enum  EUdpEvents { evntStartTransport = evntSocketLast + 1, evntStopTransport, evntConfirmCmd, evntFillBuffer }
enum  EDaqState {
  daqInit, daqStarting, daqRuns, daqStopping,
  daqFails
}

Protected Member Functions

bool daqActive () const
virtual bool ReplyCommand (dabc::Command cmd)
virtual void ProcessPoolChanged (dabc::MemoryPool *pool)
virtual bool ProcessPoolRequest ()
virtual double ProcessTimeout (double last_diff)
void AddBuffersToQueue (bool checkanyway=true)
bool CheckNextRequest (bool check_retrans=true)
void AddDataPacket (int len, void *tgt)
void CompressBuffer (dabc::Buffer &buf)
void CheckReadyBuffers (bool doflush=false)
void FinishTgtBuffer ()
void ResetDaq ()
bool prepareForSuspend ()
virtual int GetParameter (const char *name)
void setFlushTimeout (double tmout)
double getFlushTimeout () const

Protected Attributes

UdpDevicefDev
dabc::Mutex fQueueMutex
dabc::BuffersQueue fQueue
unsigned fReadyBuffers
unsigned fTransportBuffers
dabc::Buffer * fTgtBuf
unsigned fTgtBufIndx
unsigned fTgtShift
unsigned fTgtZeroShift
UdpDataPacket fTgtHdr
char * fTgtPtr
uint32_t fTgtNextId
uint32_t fTgtTailId
bool fTgtCheckGap
char fTempBuf [2000]
dabc::Queue< ResendInfofResend
EDaqState daqState
bool daqCheckStop
UdpDataPacketFull fRecvBuf
unsigned fBufferSize
unsigned fTransferWindow
dabc::MemoryPoolRef fPool
dabc::TimeStamp lastRequestTm
bool lastRequestSeen
uint32_t lastRequestId
uint32_t lastSendFrontId
unsigned rocNumber
uint64_t fTotalRecvPacket
uint64_t fTotalResubmPacket
double fFlushTimeout
dabc::TimeStamp fLastDelivery
base::OperList fStartList
int fFormat
bool fMbsHeader
int fBufCounter

Friends

class UdpDevice

Detailed Description

Definition at line 47 of file UdpTransport.h.


Member Enumeration Documentation

Enumerator:
daqInit 
daqStarting 
daqRuns 
daqStopping 
daqFails 

Definition at line 60 of file UdpTransport.h.

Enumerator:
evntStartTransport 
evntStopTransport 
evntConfirmCmd 
evntFillBuffer 

Definition at line 55 of file UdpTransport.h.


Constructor & Destructor Documentation

roc::UdpDataSocket::UdpDataSocket ( UdpDevice dev,
dabc::Reference  port,
dabc::Command  cmd,
int  fd,
int  fmt 
)
roc::UdpDataSocket::~UdpDataSocket (  )  [virtual]

Definition at line 100 of file UdpTransport.cxx.

References roc::UdpDevice::fDataCh, fDev, and ResetDaq().


Member Function Documentation

void roc::UdpDataSocket::AddBuffersToQueue ( bool  checkanyway = true  )  [protected]
void roc::UdpDataSocket::AddDataPacket ( int  len,
void *  tgt 
) [protected]
bool roc::UdpDataSocket::CheckNextRequest ( bool  check_retrans = true  )  [protected]
void roc::UdpDataSocket::CheckReadyBuffers ( bool  doflush = false  )  [protected]
void roc::UdpDataSocket::CompressBuffer ( dabc::Buffer &  buf  )  [protected]
bool roc::UdpDataSocket::daqActive (  )  const [inline, protected]

Definition at line 148 of file UdpTransport.h.

References daqState, and fDev.

Referenced by CheckNextRequest(), prepareForSuspend(), ProcessEvent(), and ProcessTimeout().

void roc::UdpDataSocket::FinishTgtBuffer (  )  [protected]
double roc::UdpDataSocket::getFlushTimeout (  )  const [inline, protected]

Definition at line 174 of file UdpTransport.h.

References fFlushTimeout.

int roc::UdpDataSocket::GetParameter ( const char *  name  )  [protected, virtual]
virtual unsigned roc::UdpDataSocket::MaxSendSegments (  )  [inline, virtual]

Definition at line 190 of file UdpTransport.h.

bool roc::UdpDataSocket::prepareForSuspend (  )  [protected]

Definition at line 740 of file UdpTransport.cxx.

References daqActive(), and daqCheckStop.

Referenced by roc::UdpDevice::ExecuteCommand().

void roc::UdpDataSocket::ProcessEvent ( const dabc::EventId &  evnt  )  [virtual]
virtual void roc::UdpDataSocket::ProcessPoolChanged ( dabc::MemoryPool *  pool  )  [inline, protected, virtual]

Definition at line 152 of file UdpTransport.h.

bool roc::UdpDataSocket::ProcessPoolRequest (  )  [protected, virtual]

Definition at line 254 of file UdpTransport.cxx.

References evntFillBuffer.

double roc::UdpDataSocket::ProcessTimeout ( double  last_diff  )  [protected, virtual]
virtual bool roc::UdpDataSocket::ProvidesInput (  )  [inline, virtual]

Definition at line 182 of file UdpTransport.h.

virtual bool roc::UdpDataSocket::ProvidesOutput (  )  [inline, virtual]

Definition at line 183 of file UdpTransport.h.

bool roc::UdpDataSocket::Recv ( dabc::Buffer &  buf  )  [virtual]

Definition at line 217 of file UdpTransport.cxx.

References evntFillBuffer, fQueue, fQueueMutex, and fReadyBuffers.

dabc::Buffer & roc::UdpDataSocket::RecvBuffer ( unsigned  indx  )  const [virtual]

Definition at line 244 of file UdpTransport.cxx.

References fQueue, fQueueMutex, and fReadyBuffers.

unsigned roc::UdpDataSocket::RecvQueueSize (  )  const [virtual]

Definition at line 237 of file UdpTransport.cxx.

References fQueueMutex, and fReadyBuffers.

bool roc::UdpDataSocket::ReplyCommand ( dabc::Command  cmd  )  [protected, virtual]

Definition at line 206 of file UdpTransport.cxx.

References evntConfirmCmd.

void roc::UdpDataSocket::ResetDaq (  )  [protected]
virtual bool roc::UdpDataSocket::Send ( const dabc::Buffer &  buf  )  [inline, virtual]

Definition at line 188 of file UdpTransport.h.

virtual unsigned roc::UdpDataSocket::SendQueueSize (  )  [inline, virtual]

Definition at line 189 of file UdpTransport.h.

void roc::UdpDataSocket::setFlushTimeout ( double  tmout  )  [inline, protected]

Definition at line 173 of file UdpTransport.h.

References fFlushTimeout.

Referenced by roc::UdpDevice::ExecuteCommand().

void roc::UdpDataSocket::StartTransport (  )  [virtual]

Definition at line 260 of file UdpTransport.cxx.

References evntStartTransport.

void roc::UdpDataSocket::StopTransport (  )  [virtual]

Definition at line 267 of file UdpTransport.cxx.

References evntStopTransport, and fTotalRecvPacket.


Friends And Related Function Documentation

friend class UdpDevice [friend]

Definition at line 50 of file UdpTransport.h.


Field Documentation

Definition at line 118 of file UdpTransport.h.

Referenced by AddDataPacket(), prepareForSuspend(), ResetDaq(), and UdpDataSocket().

Definition at line 117 of file UdpTransport.h.

Referenced by daqActive(), ProcessEvent(), ResetDaq(), and UdpDataSocket().

Definition at line 146 of file UdpTransport.h.

Referenced by FinishTgtBuffer(), and UdpDataSocket().

unsigned roc::UdpDataSocket::fBufferSize [protected]

Definition at line 122 of file UdpTransport.h.

Referenced by AddBuffersToQueue(), AddDataPacket(), CheckNextRequest(), and UdpDataSocket().

Definition at line 138 of file UdpTransport.h.

Referenced by getFlushTimeout(), ProcessTimeout(), setFlushTimeout(), and UdpDataSocket().

int roc::UdpDataSocket::fFormat [protected]
dabc::TimeStamp roc::UdpDataSocket::fLastDelivery [protected]

Definition at line 145 of file UdpTransport.h.

Referenced by AddBuffersToQueue(), FinishTgtBuffer(), and UdpDataSocket().

dabc::MemoryPoolRef roc::UdpDataSocket::fPool [protected]

Definition at line 126 of file UdpTransport.h.

Referenced by AddBuffersToQueue(), and UdpDataSocket().

dabc::BuffersQueue roc::UdpDataSocket::fQueue [protected]
dabc::Mutex roc::UdpDataSocket::fQueueMutex [protected]
unsigned roc::UdpDataSocket::fReadyBuffers [protected]

Definition at line 120 of file UdpTransport.h.

dabc::Queue<ResendInfo> roc::UdpDataSocket::fResend [protected]

Definition at line 141 of file UdpTransport.h.

Referenced by ProcessEvent().

char roc::UdpDataSocket::fTempBuf[2000] [protected]

Definition at line 113 of file UdpTransport.h.

Referenced by ProcessEvent().

dabc::Buffer* roc::UdpDataSocket::fTgtBuf [protected]
unsigned roc::UdpDataSocket::fTgtBufIndx [protected]

Definition at line 107 of file UdpTransport.h.

Referenced by AddDataPacket(), and ProcessEvent().

uint32_t roc::UdpDataSocket::fTgtNextId [protected]

Definition at line 109 of file UdpTransport.h.

Referenced by AddDataPacket(), CheckNextRequest(), ResetDaq(), and UdpDataSocket().

char* roc::UdpDataSocket::fTgtPtr [protected]
unsigned roc::UdpDataSocket::fTgtShift [protected]
uint32_t roc::UdpDataSocket::fTgtTailId [protected]

Definition at line 110 of file UdpTransport.h.

Referenced by AddDataPacket(), CheckNextRequest(), ResetDaq(), and UdpDataSocket().

unsigned roc::UdpDataSocket::fTgtZeroShift [protected]

Definition at line 106 of file UdpTransport.h.

Referenced by AddBuffersToQueue(), AddDataPacket(), CheckReadyBuffers(), and UdpDataSocket().

Definition at line 135 of file UdpTransport.h.

Referenced by ProcessEvent(), StopTransport(), and UdpDataSocket().

Definition at line 136 of file UdpTransport.h.

Referenced by AddDataPacket(), and UdpDataSocket().

Definition at line 123 of file UdpTransport.h.

Referenced by CheckNextRequest(), and UdpDataSocket().

uint32_t roc::UdpDataSocket::lastRequestId [protected]

Definition at line 130 of file UdpTransport.h.

Referenced by AddDataPacket(), CheckNextRequest(), and ResetDaq().

Definition at line 129 of file UdpTransport.h.

Referenced by AddDataPacket(), CheckNextRequest(), and ResetDaq().

dabc::TimeStamp roc::UdpDataSocket::lastRequestTm [protected]

Definition at line 128 of file UdpTransport.h.

Referenced by CheckNextRequest(), ResetDaq(), and UdpDataSocket().

Definition at line 131 of file UdpTransport.h.

Referenced by CheckNextRequest(), and ResetDaq().

unsigned roc::UdpDataSocket::rocNumber [protected]

Definition at line 133 of file UdpTransport.h.

Referenced by CheckNextRequest(), FinishTgtBuffer(), and UdpDataSocket().


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