CMS 3D CMS Logo

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 l1t::MTF7Payload

Public Member Functions

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

Protected Attributes

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

Detailed Description

Definition at line 74 of file Block.h.

Constructor & Destructor Documentation

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

Definition at line 76 of file Block.h.

76 : data_(data), end_(end), algo_(0), infra_(0) {};
const uint32_t * end_
Definition: Block.h:88
#define end
Definition: vmac.h:39
unsigned infra_
Definition: Block.h:91
const uint32_t * data_
Definition: Block.h:87
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned algo_
Definition: Block.h:90
virtual l1t::Payload::~Payload ( )
inlinevirtual

Definition at line 77 of file Block.h.

77 {};

Member Function Documentation

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

Definition at line 78 of file Block.h.

78 { return algo_; };
unsigned algo_
Definition: Block.h:90
std::unique_ptr< Block > l1t::Payload::getBlock ( )
virtual

Reimplemented in l1t::CTP7Payload, and l1t::MTF7Payload.

Definition at line 73 of file Block.cc.

References end_, RecoTauValidation_cfi::header, LogDebug, and LogTrace.

74  {
75  if (end_ - data_ < getHeaderSize()) {
76  LogDebug("L1T") << "Reached end of payload";
77  return std::auto_ptr<Block>();
78  }
79 
80  if (data_[0] == 0xffffffff) {
81  LogDebug("L1T") << "Skipping padding word";
82  ++data_;
83  return getBlock();
84  }
85 
86  auto header = getHeader();
87 
88  if (end_ - data_ < header.getSize()) {
89  edm::LogError("L1T")
90  << "Expecting a block size of " << header.getSize()
91  << " but only " << (end_ - data_) << " words remaining";
92  return std::auto_ptr<Block>();
93  }
94 
95  LogTrace("L1T") << "Creating block with size " << header.getSize();
96 
97  auto res = std::unique_ptr<Block>(new Block(header, data_, data_ + header.getSize()));
98  data_ += header.getSize();
99  return res;
100  }
#define LogDebug(id)
const uint32_t * end_
Definition: Block.h:88
virtual std::unique_ptr< Block > getBlock()
Definition: Block.cc:73
Definition: Electron.h:6
virtual unsigned getHeaderSize() const =0
virtual BlockHeader getHeader()=0
#define LogTrace(id)
const uint32_t * data_
Definition: Block.h:87
virtual BlockHeader l1t::Payload::getHeader ( )
pure virtual
virtual unsigned l1t::Payload::getHeaderSize ( ) const
pure virtual
virtual unsigned l1t::Payload::getInfrastructureFWVersion ( ) const
inlinevirtual

Definition at line 79 of file Block.h.

79 { return infra_; };
unsigned infra_
Definition: Block.h:91

Member Data Documentation

unsigned l1t::Payload::algo_
protected
const uint32_t* l1t::Payload::data_
protected
const uint32_t* l1t::Payload::end_
protected
unsigned l1t::Payload::infra_
protected

Definition at line 91 of file Block.h.

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