CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::JobHeaderDecoder Class Reference

#include <Utilities.h>

List of all members.

Public Member Functions

std::auto_ptr< SendJobHeaderdecodeJobHeader (InitMsg const &msg)
 JobHeaderDecoder ()
 ~JobHeaderDecoder ()

Private Attributes

TBufferFile buf_
TClass * desc_

Detailed Description

Definition at line 28 of file Utilities.h.


Constructor & Destructor Documentation

edm::JobHeaderDecoder::JobHeaderDecoder ( )

Definition at line 53 of file Utilities.cc.

                                    :
    desc_(getTClassFor<SendJobHeader>()),
    buf_(TBuffer::kRead)
  {
  }
edm::JobHeaderDecoder::~JobHeaderDecoder ( )

Definition at line 59 of file Utilities.cc.

{ }

Member Function Documentation

std::auto_ptr< SendJobHeader > edm::JobHeaderDecoder::decodeJobHeader ( InitMsg const &  msg)

Definition at line 62 of file Utilities.cc.

References edm::InitMsg::data(), desc_, Exception, FDEBUG, edm::MsgCode::getCode(), edm::InitMsg::getDataSize(), edm::MsgCode::INIT, and sd.

Referenced by edm::JobHeaderInserter::insert().

  {
    FDEBUG(6) << "StreamInput: decodeRegistry" << std::endl;

    if(msg.getCode()!=MsgCode::INIT)
      throw cms::Exception("HeaderDecode","EventStreamerInput")
        << "received wrong message type: expected INIT, got "
        << msg.getCode() << "\n";

    // This "SetBuffer" stuff does not appear to work or I don't understand
    // what needs to be done to actually make it go. (JBK)
    //buf_.SetBuffer((char*)msg.data(),msg.getDataSize(),kFALSE);
    TBufferFile xbuf(TBuffer::kRead,msg.getDataSize(),(char*)msg.data(),kFALSE);
    RootDebug tracer(10,10);
    std::auto_ptr<SendJobHeader> sd((SendJobHeader*)xbuf.ReadObjectAny(desc_));

    if(sd.get()==0) {
        throw cms::Exception("HeaderDecode","DecodeProductList")
          << "Could not read the initial product registry list\n";
    }

    return sd;
  }

Member Data Documentation

TBufferFile edm::JobHeaderDecoder::buf_ [private]

Definition at line 38 of file Utilities.h.

TClass* edm::JobHeaderDecoder::desc_ [private]

Definition at line 37 of file Utilities.h.

Referenced by decodeJobHeader().