CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
edm::MsgCode Class Reference

#include <Messages.h>

Inheritance diagram for edm::MsgCode:
edm::EventMsg edm::InitMsg

Public Types

enum  Codes { INVALID = 0, INIT = 1, EVENT = 2, DONE = 3 }
 

Public Member Functions

int codeSize () const
 
Codes getCode () const
 
 MsgCode (void *buffer, int size)
 
 MsgCode (void *buffer)
 
 MsgCode (void *buffer, Codes c)
 
 MsgCode (void *buffer, int size, Codes c)
 
void * payload () const
 
int payloadSize () const
 
void setCode (Codes c)
 
int totalSize () const
 

Private Attributes

unsigned char * buffer_
 
int size_
 

Detailed Description

Definition at line 55 of file Messages.h.

Member Enumeration Documentation

Enumerator
INVALID 
INIT 
EVENT 
DONE 

Definition at line 58 of file Messages.h.

Constructor & Destructor Documentation

edm::MsgCode::MsgCode ( void *  buffer,
int  size 
)
inline

Definition at line 64 of file Messages.h.

References size_.

64  :
65  buffer_((unsigned char*)buffer),size_(size<4?0:size-4)
66  { assert(size_>=0); }
unsigned char * buffer_
Definition: Messages.h:100
tuple size
Write out results.
edm::MsgCode::MsgCode ( void *  buffer)
inlineexplicit

Definition at line 69 of file Messages.h.

69  :
70  buffer_((unsigned char*)buffer),size_(0)
71  { }
unsigned char * buffer_
Definition: Messages.h:100
edm::MsgCode::MsgCode ( void *  buffer,
Codes  c 
)
inline

Definition at line 74 of file Messages.h.

References setCode().

74  :
75  buffer_((unsigned char*)buffer),size_(0)
76  { setCode(c); }
void setCode(Codes c)
Definition: Messages.h:83
unsigned char * buffer_
Definition: Messages.h:100
edm::MsgCode::MsgCode ( void *  buffer,
int  size,
Codes  c 
)
inline

Definition at line 79 of file Messages.h.

References setCode().

79  :
80  buffer_((unsigned char*)buffer),size_(size-4)
81  { setCode(c); }
void setCode(Codes c)
Definition: Messages.h:83
unsigned char * buffer_
Definition: Messages.h:100
tuple size
Write out results.

Member Function Documentation

int edm::MsgCode::codeSize ( ) const
inline

Definition at line 96 of file Messages.h.

Referenced by edm::EventMsg::msgSize(), and edm::InitMsg::msgSize().

96 { return 4; }
Codes edm::MsgCode::getCode ( ) const
inline

Definition at line 88 of file Messages.h.

References buffer_, and edm::decodeInt().

Referenced by edm::JobHeaderDecoder::decodeJobHeader().

89  {
90  return (Codes)decodeInt(buffer_);
91  }
unsigned char * buffer_
Definition: Messages.h:100
unsigned int decodeInt(unsigned char *v)
Definition: Messages.h:33
void* edm::MsgCode::payload ( ) const
inline

Definition at line 94 of file Messages.h.

References buffer_.

Referenced by edm::EventMsg::data(), and edm::InitMsg::data().

94 { return &buffer_[4]; }
unsigned char * buffer_
Definition: Messages.h:100
int edm::MsgCode::payloadSize ( ) const
inline

Definition at line 95 of file Messages.h.

References size_.

Referenced by edm::InitMsg::dataSize().

95 { return size_; }
void edm::MsgCode::setCode ( Codes  c)
inline

Definition at line 83 of file Messages.h.

References buffer_, and edm::encodeInt().

Referenced by edm::EventMsg::EventMsg(), edm::InitMsg::InitMsg(), and MsgCode().

84  {
86  }
void encodeInt(unsigned int i, unsigned char *v)
Definition: Messages.h:41
unsigned char * buffer_
Definition: Messages.h:100
int edm::MsgCode::totalSize ( ) const
inline

Definition at line 97 of file Messages.h.

References size_.

97 { return size_+4; }

Member Data Documentation

unsigned char* edm::MsgCode::buffer_
private

Definition at line 100 of file Messages.h.

Referenced by getCode(), payload(), and setCode().

int edm::MsgCode::size_
private

Definition at line 101 of file Messages.h.

Referenced by MsgCode(), payloadSize(), and totalSize().