CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

evf::EvffedFillerRB Class Reference

#include <EvffedFillerRB.h>

List of all members.

Classes

union  Payload

Public Member Functions

 EvffedFillerRB (FUResourceBroker *rb)
unsigned int fedId () const
unsigned char *const getPayload ()
uint32_t getSize ()
void putHeader (unsigned int l1id, unsigned int bxid)
void putTrailer ()
void setEPProcessId (pid_t pid)
void setRBEventCount (uint32_t evtcnt)
void setRBTimeStamp (uint64_t ts)
unsigned int size () const

Private Attributes

unsigned int hostid_
Payload payload_

Detailed Description

Definition at line 29 of file EvffedFillerRB.h.


Constructor & Destructor Documentation

evf::EvffedFillerRB::EvffedFillerRB ( FUResourceBroker rb) [inline]

Definition at line 32 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asHWords, evf::EvffedFillerRB::Payload::asWords, evf::fedinterface::EVFFED_LENGTH, evf::fedinterface::EVFFED_RBIDENT_OFFSET, evf::fedinterface::EVFFED_RBINSTA_MASK, evf::fedinterface::EVFFED_RBINSTA_SHIFT, evf::fedinterface::EVFFED_RBPCIDE_MASK, evf::fedinterface::EVFFED_RBPCIDE_SHIFT, hostid_, i, evf::FUResourceBroker::instanceNumber(), AlCaHLTBitMon_ParallelJobs::p, and payload_.

                                             {
                for (unsigned int i = 0; i < fedinterface::EVFFED_LENGTH; i++) {
                        *(payload_.asWords + i) = 0;
                }
                char hostname[32];
                int retval = gethostname(hostname, 32);
                if (retval != 0) {
                        hostid_ = 0xdead;
                } else {
                        if (strtok(hostname, "-") == 0)
                                hostid_ = 0xdead;
                        char *p = strtok(0, "-"); // rack id
                        long hostid = 0xdead;
                        if (p != 0)
                                hostid = strtol(p, 0, 16) << 8;
                        p = strtok(0, "-"); // node id
                        if (p == 0)
                                hostid += 0xdead;
                        else
                                hostid += strtol(p, 0, 16);
                        hostid_ = hostid;
                }
                *(payload_.asHWords + (fedinterface::EVFFED_RBIDENT_OFFSET/sizeof(uint32_t)))
                                = ((hostid_ & fedinterface::EVFFED_RBPCIDE_MASK)
                                                << fedinterface::EVFFED_RBPCIDE_SHIFT)
                                                + ((rb->instanceNumber()
                                                                & fedinterface::EVFFED_RBINSTA_MASK)
                                                                << fedinterface::EVFFED_RBINSTA_SHIFT);
        }

Member Function Documentation

unsigned int evf::EvffedFillerRB::fedId ( ) const [inline]

Definition at line 98 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_ID.

Referenced by evf::FUResource::process().

unsigned char* const evf::EvffedFillerRB::getPayload ( ) [inline]

Definition at line 61 of file EvffedFillerRB.h.

References evf::EvffedFillerRB::Payload::asBytes, and payload_.

Referenced by evf::FUResource::process().

                                           {
                return payload_.asBytes;
        }
uint32_t evf::EvffedFillerRB::getSize ( ) [inline]

Definition at line 64 of file EvffedFillerRB.h.

References evf::fedinterface::EVFFED_TOTALSIZE.

void evf::EvffedFillerRB::putHeader ( unsigned int  l1id,
unsigned int  bxid 
) [inline]
void evf::EvffedFillerRB::putTrailer ( ) [inline]
void evf::EvffedFillerRB::setEPProcessId ( pid_t  pid) [inline]
void evf::EvffedFillerRB::setRBEventCount ( uint32_t  evtcnt) [inline]
void evf::EvffedFillerRB::setRBTimeStamp ( uint64_t  ts) [inline]
unsigned int evf::EvffedFillerRB::size ( void  ) const [inline]

Member Data Documentation

unsigned int evf::EvffedFillerRB::hostid_ [private]

Definition at line 111 of file EvffedFillerRB.h.

Referenced by EvffedFillerRB().