Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

LATdatagram Class Reference

Class for decoding an LAT datagram. More...

#include <LATdatagram.h>

Collaboration diagram for LATdatagram:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { ID }

Public Member Functions

 LATdatagram ()
 Constructor setting up identity and length defaults.
 LATdatagram (unsigned length)
 Constructor setting up identity and length defaults.
LATtypeId identity () const
 Return the datagram's identity.
unsigned length () const
 Return the datagram's size in units of bytes.
LATdatagramnext () const
 Return the next datagram in the list of LATdatagrams.
unsigned payloadSize () const
 Return the size of the datagram's payload in units of bytes.
LATcontributionpayload () const
 Return a pointer to the start of the datagram's payload.
EBFeventevent () const
 Return a pointer to the datagram's payload cast as an EBFevent.
unsigned char * alloc (unsigned size)
 Method for allocating additional space in a datagram.
void * operator new (size_t)
 Allocate a default LATdatagram off the memory heap.
void * operator new (size_t, unsigned length)
 Allocate a LATdatagram with space for a payload off the memory heap.
void * operator new (size_t, const LATdatagram &)
 Copy a LATdatagram to a new one.
void * operator new (size_t, void *, unsigned supplemental, bool swap=!DFC_BIG_ENDIAN)
 This operator new allows one to place a datagram at a given location.
void operator delete (void *, void *, unsigned, bool)
 Delete operator used to delete a datagram.
void operator delete (void *)
 Delete operator used to delete a datagram.
unsigned char * string (bool swap=!DFC_BIG_ENDIAN)
 Return a pointer to a LATdatagram as a uchar buffer.

Static Public Member Functions

LATdatagramcreate (unsigned char *buffer, unsigned size, bool swap=!DFC_BIG_ENDIAN)
 Create a LATdatagram from a uchar buffer.

Detailed Description

Class for decoding an LAT datagram.

Author:
R. Claus -- GLAST LAT I&T/Online - (claus@slac.stanford.edu)
Revision
1.7
Date:
March 3, 2003 -- Created
Id
LATdatagram.h,v 1.7 2004/10/18 00:35:18 claus Exp

Copyright: Copyright 2004 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved.


Constructor & Destructor Documentation

LATdatagram::LATdatagram unsigned  length  )  [inline]
 

Constructor setting up identity and length defaults.

Parameters:
length Additional length to include in units of bytes


Member Function Documentation

unsigned char * LATdatagram::alloc unsigned  size  )  [inline]
 

Method for allocating additional space in a datagram.

This method is used to include additional space at the end of a LATdatagram as part of that LATdatagram. It assumes that the memory for that space has been properly allocated.

Returns:
A pointer to the additional space allocated in the datagram

LATdatagram * LATdatagram::create unsigned char *  buffer,
unsigned  size,
bool  swap = !DFC_BIG_ENDIAN
[inline, static]
 

Create a LATdatagram from a uchar buffer.

This method primarily exists for the Python interface.

The buffer can optionally be byte swapped by longwords in place. By default, if the endianness of the machine this code is running on is not big endian, then the buffer is byte swapped.

Parameters:
buffer A pointer to a buffer containing LATdatagram data
size Additional size to include into the LATdatagram
swap Optionally byte swap the buffer in place
Returns:
A pointer to the buffer as a LATdatagram

EBFevent * LATdatagram::event  )  const [inline]
 

Return a pointer to the datagram's payload cast as an EBFevent.

This is an obsolete method (I think) since one can't make the assumption that a particular LATdatagram payload is an EBFevent.

void LATdatagram::operator delete void *  location  )  [inline]
 

Delete operator used to delete a datagram.

This method is used to avoid SIP constructor MemberCode.

void LATdatagram::operator delete void *  ,
void *  ,
unsigned  ,
bool 
[inline]
 

Delete operator used to delete a datagram.

This method is used to avoid SIP constructor MemberCode.

void * LATdatagram::operator new size_t  size,
void *  location,
unsigned  supplemental,
bool  swap = !DFC_BIG_ENDIAN
[inline]
 

This operator new allows one to place a datagram at a given location.

This method is used to effectively label a piece of memory containing datagram data a LATdatagram. It is similar to casting a pointer to a LAT datagram pointer.

In the process or placing the datagram, the raw data occupying the space can optionally be byte swapped. By default, if the endianness of the machine this code is running on is not big endian, then the buffer is byte swapped.

Parameters:
size An ignored parameter
location A pointer to the location where to place the datagram
supplemental Additional space to include in the datagram
swap Optionally byte swap the buffer in place
Returns:
A pointer to the buffer as a LATdatagram

void * LATdatagram::operator new size_t  size,
const LATdatagram datagram
[inline]
 

Copy a LATdatagram to a new one.

This method is used to avoid SIP constructor MemberCode.

Parameters:
size An ignored parameter
datagram A reference to the datagram to be copied
Returns:
A pointer to the newly allocated datagram

void * LATdatagram::operator new size_t  size,
unsigned  length
[inline]
 

Allocate a LATdatagram with space for a payload off the memory heap.

This method is used to avoid SIP constructor MemberCode.

Parameters:
size An ignored parameter
length The additional amount of space to allocate in units of bytes
Returns:
A pointer to the newly allocated datagram

void * LATdatagram::operator new size_t  size  )  [inline]
 

Allocate a default LATdatagram off the memory heap.

This method is used to avoid SIP constructor MemberCode.

Parameters:
size An ignored parameter
Returns:
A pointer to the newly allocated datagram

LATcontribution * LATdatagram::payload  )  const [inline]
 

Return a pointer to the start of the datagram's payload.

The payload is the data portion of the datagram and does not include its mangement members identity and length.

unsigned LATdatagram::payloadSize  )  const [inline]
 

Return the size of the datagram's payload in units of bytes.

The payload is the data portion of the datagram and does not include its mangement members identity and length.

unsigned char * LATdatagram::string bool  swap = !DFC_BIG_ENDIAN  )  [inline]
 

Return a pointer to a LATdatagram as a uchar buffer.

This method primarily exists for the Python interface.

The buffer can optionally be byte swapped by longwords in place. By default, if the endianness of the machine this code is running on is not big endian, then the buffer is byte swapped. Be sure to supply FALSE for the swap argument if the buffer has already been swapped by a previous call.

Parameters:
swap Optionally byte swap the buffer in place
Returns:
A pointer to the LATdatagram as a string buffer


The documentation for this class was generated from the following file:
Generated on Thu Sep 29 12:13:42 2005 for LDF v05-07-00 by doxygen 1.3.9.1