GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRB / V1-3-1 > grb_doc / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

GRB_msgdef.h File Reference

The public part of the messaging between the client and server. More...

#include <PBI/Endianness.h>
#include <PBI/BSWP.ih>

Classes

struct  _GRB_msgHdr
 The message header. More...

Typedefs

typedef struct _GRB_msgHdr GRB_msgHdr
 Typedef for struct _GRB_msgHdr.

Functions

static __inline void GRB__msgCompose (GRB_msgHdr *hdr, unsigned char len32, unsigned long long key)
 Composes the message header, filling in the length and message sorting key.
static __inline unsigned int GRB__msgLength (const GRB_msgHdr *hdr)
 Accessor to return the length of the message in 32-bit units.
static __inline unsigned long
long int 
GRB__msgKey (const GRB_msgHdr *hdr)
 Accessor to return the message sorting key.
static __inline const GRB_msgHdrGRB__msgNext (const GRB_msgHdr *hdr)
 Returns a pointer to the message header following the specified message header hdr.
static __inline const GRB_msgHdrGRB__msgAdvance (const GRB_msgHdr *hdr, int len32)
 Returns a pointer to the location of hdr + len32.


Detailed Description

The public part of the messaging between the client and server.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: GRB_msgdef.h,v 1.7 2011/03/25 23:20:51 apw Exp $

This defines the interface to the GRB message header. As a word of warning, do not access the structure's directly in user code. There are accessor functions that avoid endianness issues. Compliance with using the specified interface routines will at least keep the user code compile time compatiable to changes in this package.


Typedef Documentation

Typedef for struct _GRB_msgHdr.

This structure is the public part of the message, allowing one to iterate and sort the messages without knowledge of the actual message contents.
Note:
This structure should not be accessed directly, use the accessor functions GRB__msgLength and GRB__msgKey. This will provide compile time protection in case the format changes.


Function Documentation

static __inline const GRB_msgHdr * GRB__msgAdvance ( const GRB_msgHdr hdr,
int  len32 
) [static]

Returns a pointer to the location of hdr + len32.

Returns:
A pointer to the location of hdr + len32.
Parameters:
hdr The target message header
len32 The amount, in 32-bit units to advance hdr by.
Note:
This routine can be used instead of GRB__msgNext when the length of message has already been extracted or when advancing by multiple messages. Otherwise, GRB__msgNext should be used.
Warning:
This routine only advances the pointer to the address following the target message header. There is no guarantee that a message header actually occupies that memory. That question can only be answered by some higher level protocol

static __inline void GRB__msgCompose ( GRB_msgHdr hdr,
unsigned char  len32,
unsigned long long  key 
) [static]

Composes the message header, filling in the length and message sorting key.

Parameters:
hdr The message header to compose
len32 The length of the message, in 32-bit units
key The sorting key. This is meant to a unique, increasing unsigned 48 bit number. Here unique means unique within a run and amongst the data taking CPUs.
Warning:
Do not fill these locations in by hand. One should use this routine to avoid big/little endian issues.

References _GRB_msgHdr::keylo.

static __inline unsigned long long int GRB__msgKey ( const GRB_msgHdr hdr  )  [static]

Accessor to return the message sorting key.

Returns:
The message sorting key
Parameters:
hdr The target message header

References _GRB_msgHdr::keylo.

static __inline unsigned int GRB__msgLength ( const GRB_msgHdr hdr  )  [static]

Accessor to return the length of the message in 32-bit units.

Returns:
The length of the message in 32-bit units
Parameters:
hdr The target message header

Referenced by GRB__msgNext().

static __inline const GRB_msgHdr * GRB__msgNext ( const GRB_msgHdr hdr  )  [static]

Returns a pointer to the message header following the specified message header hdr.

Returns:
A pointer to the message header following the specified message header hdr.
Parameters:
hdr The target message header
Warning:
This routine only advances the pointer to the address following the target message header. There is no guarantee that a message header actually occupies that memory. That question can only be answered by some higher level protocol

References GRB__msgLength().


Generated on Tue Nov 29 18:08:40 2011 by  doxygen 1.5.8