CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
l1t::Payload Class Referenceabstract

#include <Block.h>

Inheritance diagram for l1t::Payload:
l1t::CTP7Payload l1t::MP7Payload

Public Member Functions

std::auto_ptr< BlockgetBlock ()
 
unsigned getFirmwareId () const
 
virtual BlockHeader getHeader ()=0
 
virtual unsigned getHeaderSize () const =0
 
 Payload (const uint32_t *data, const uint32_t *end)
 

Protected Attributes

const uint32_t * data_
 
const uint32_t * end_
 
unsigned fw_
 

Detailed Description

Definition at line 66 of file Block.h.

Constructor & Destructor Documentation

l1t::Payload::Payload ( const uint32_t *  data,
const uint32_t *  end 
)
inline

Definition at line 68 of file Block.h.

68 : data_(data), end_(end), fw_(0) {};
unsigned fw_
Definition: Block.h:81
const uint32_t * end_
Definition: Block.h:79
#define end
Definition: vmac.h:37
const uint32_t * data_
Definition: Block.h:78
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Member Function Documentation

std::auto_ptr< Block > l1t::Payload::getBlock ( )

Definition at line 20 of file Block.cc.

References data_, end_, getHeader(), getHeaderSize(), and LogTrace.

21  {
22  if (end_ - data_ < getHeaderSize())
23  return std::auto_ptr<Block>();
24  auto header = getHeader();
25 
26  if (end_ - data_ < header.getSize()) {
27  edm::LogError("L1T")
28  << "Expecting a block size of " << header.getSize()
29  << " but only " << (end_ - data_) << " words remaining";
30  return std::auto_ptr<Block>();
31  }
32 
33  LogTrace("L1T") << "Creating block with size " << header.getSize();
34 
35  auto res = std::auto_ptr<Block>(new Block(header, data_, data_ + header.getSize()));
36  data_ += header.getSize();
37  return res;
38  }
const uint32_t * end_
Definition: Block.h:79
virtual BlockHeader getHeader()=0
virtual unsigned getHeaderSize() const =0
#define LogTrace(id)
const uint32_t * data_
Definition: Block.h:78
unsigned l1t::Payload::getFirmwareId ( ) const
inline

Definition at line 70 of file Block.h.

References fw_.

70 { return fw_; };
unsigned fw_
Definition: Block.h:81
virtual BlockHeader l1t::Payload::getHeader ( )
pure virtual

Implemented in l1t::CTP7Payload, and l1t::MP7Payload.

Referenced by getBlock().

virtual unsigned l1t::Payload::getHeaderSize ( ) const
pure virtual

Implemented in l1t::CTP7Payload, and l1t::MP7Payload.

Referenced by getBlock().

Member Data Documentation

const uint32_t* l1t::Payload::data_
protected
const uint32_t* l1t::Payload::end_
protected

Definition at line 79 of file Block.h.

Referenced by getBlock().

unsigned l1t::Payload::fw_
protected

Definition at line 81 of file Block.h.

Referenced by getFirmwareId().