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

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

Protected Attributes

unsigned algo_
 
const uint32_t * data_
 
const uint32_t * end_
 
unsigned infra_
 

Detailed Description

Definition at line 70 of file Block.h.

Constructor & Destructor Documentation

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

Definition at line 72 of file Block.h.

72 : data_(data), end_(end), algo_(0), infra_(0) {};
const uint32_t * end_
Definition: Block.h:84
#define end
Definition: vmac.h:37
unsigned infra_
Definition: Block.h:87
const uint32_t * data_
Definition: Block.h:83
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned algo_
Definition: Block.h:86

Member Function Documentation

virtual unsigned l1t::Payload::getAlgorithmFWVersion ( ) const
inlinevirtual

Definition at line 74 of file Block.h.

References algo_.

74 { return algo_; };
unsigned algo_
Definition: Block.h:86
std::auto_ptr< Block > l1t::Payload::getBlock ( )

Definition at line 22 of file Block.cc.

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

23  {
24  if (end_ - data_ < getHeaderSize()) {
25  LogDebug("L1T") << "Reached end of payload";
26  return std::auto_ptr<Block>();
27  }
28 
29  if (data_[0] == 0xffffffff) {
30  LogDebug("L1T") << "Skipping padding word";
31  ++data_;
32  return getBlock();
33  }
34 
35  auto header = getHeader();
36 
37  if (end_ - data_ < header.getSize()) {
38  edm::LogError("L1T")
39  << "Expecting a block size of " << header.getSize()
40  << " but only " << (end_ - data_) << " words remaining";
41  return std::auto_ptr<Block>();
42  }
43 
44  LogTrace("L1T") << "Creating block with size " << header.getSize();
45 
46  auto res = std::auto_ptr<Block>(new Block(header, data_, data_ + header.getSize()));
47  data_ += header.getSize();
48  return res;
49  }
#define LogDebug(id)
std::auto_ptr< Block > getBlock()
Definition: Block.cc:22
const uint32_t * end_
Definition: Block.h:84
virtual BlockHeader getHeader()=0
virtual unsigned getHeaderSize() const =0
#define LogTrace(id)
const uint32_t * data_
Definition: Block.h:83
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().

virtual unsigned l1t::Payload::getInfrastructureFWVersion ( ) const
inlinevirtual

Definition at line 75 of file Block.h.

References infra_.

75 { return infra_; };
unsigned infra_
Definition: Block.h:87

Member Data Documentation

unsigned l1t::Payload::algo_
protected

Definition at line 86 of file Block.h.

Referenced by getAlgorithmFWVersion(), and l1t::MP7Payload::MP7Payload().

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

Definition at line 84 of file Block.h.

Referenced by getBlock().

unsigned l1t::Payload::infra_
protected

Definition at line 87 of file Block.h.

Referenced by getInfrastructureFWVersion(), and l1t::MP7Payload::MP7Payload().