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

LATcontribution Class Reference

Base class for describing all contributions to a LATdatagram. More...

#include <LATcontribution.h>

Inheritance diagram for LATcontribution:

Inheritance graph
[legend]
Collaboration diagram for LATcontribution:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { ID = LATidentity_(LATprimaryId::Any, LATsecondaryId::Any) }

Public Member Functions

 LATcontribution ()
 Constructor setting up identity and length defaults.
 LATcontribution (LATtypeId identity, unsigned short length, unsigned short opaque)
 Constructor setting up identity and length defaults.
LATtypeId identity () const
 Return the identity of this block.
LATcontributionnext () const
 Return the next contribution in the datagram.
unsigned short length () const
 Return the length of this block.
unsigned short opaque () const
 Return the opaque (undefined) value in this block.
unsigned rawDataSize () const
 Return the size of the rawData in the contribution.
char * rawData () const
 Return a pointer to the rawData in the contribution.
void * operator new (size_t)
 Allocate a default LATcontribution off the memory heap.
void * operator new (size_t, LATtypeId identity, unsigned short length, unsigned short opaque)
 Allocate a LATcontribution with space for a payload off the memory heap.
void * operator new (size_t, const LATcontribution &)
 Copy a LATcontribution to a new one.
void * operator new (size_t, void *, unsigned short supplemental, bool swap=!DFC_BIG_ENDIAN)
 This operator new allows one to place a contribution at a given location.
void operator delete (void *, void *, unsigned short, bool)
 Delete operator used to delete a contribution.
void operator delete (void *)
 Delete operator used to delete a contribution.
unsigned char * string (bool swap=!DFC_BIG_ENDIAN)
 Return a pointer to a LATcontribution as a uchar buffer.

Static Public Member Functions

LATcontributioncreate (LATtypeId identity, unsigned short size, unsigned short opaque, unsigned char *buffer, bool swap=!DFC_BIG_ENDIAN)
 Create a LATcontribution from a uchar buffer.

Detailed Description

Base class for describing all contributions to a LATdatagram.

Author:
R. Claus -- GLAST LAT I&T/Online - (claus@slac.stanford.edu)
Revision
1.8
Date:
March 3, 2003 -- Created
Id
LATcontribution.h,v 1.8 2004/10/25 16:47:03 lmiller Exp

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


Constructor & Destructor Documentation

LATcontribution::LATcontribution LATtypeId  identity,
unsigned short  length,
unsigned short  opaque
[inline]
 

Constructor setting up identity and length defaults.

Parameters:
identity The structure identifier of this LATcontribution
length Amount of space in bytes to reserve for this LATcontribution Must be less than USHORT_MAX (64K Bytes)
opaque A user defined unsigned short


Member Function Documentation

LATcontribution * LATcontribution::create LATtypeId  identity,
unsigned short  size,
unsigned short  opaque,
unsigned char *  buffer,
bool  swap = !DFC_BIG_ENDIAN
[inline, static]
 

Create a LATcontribution 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:
identity The structure identifier of this LATcontribution
size Amount of space in bytes to reserve for this LATcontribution Must be less than USHORT_MAX (64K Bytes)
opaque A user defined unsigned short
buffer A pointer to a buffer containing LATcontribution data
swap Optionally byte swap the buffer in place
Returns:
A pointer to the buffer as a LATcontribution

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

Delete operator used to delete a contribution.

This method is used to avoid SIP constructor MemberCode.

void LATcontribution::operator delete void *  ,
void *  ,
unsigned  short,
bool 
[inline]
 

Delete operator used to delete a contribution.

This method is used to avoid SIP constructor MemberCode.

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

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

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

In the process or placing the contribution, 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 contribution
supplemental Additional space to include in the contribution
swap Optionally byte swap the buffer in place
Returns:
A pointer to the buffer as a LATcontribution

void * LATcontribution::operator new size_t  size,
const LATcontribution contribution
[inline]
 

Copy a LATcontribution to a new one.

This method is used to avoid SIP constructor MemberCode.

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

void * LATcontribution::operator new size_t  size,
LATtypeId  identity,
unsigned short  length,
unsigned short  opaque
[inline]
 

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

This method is used to avoid SIP constructor MemberCode.

Parameters:
size An ignored parameter
identity The structure identifier of this LATcontribution
length Amount of space in bytes to reserve for this LATcontribution Must be less than USHORT_MAX (64K Bytes)
opaque A user defined unsigned short
Returns:
A pointer to the newly allocated contribution

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

Allocate a default LATcontribution 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 contribution

char * LATcontribution::rawData  )  const [inline]
 

Return a pointer to the rawData in the contribution.

Returns:
A pointer to the rawData in the contribution

unsigned LATcontribution::rawDataSize  )  const [inline]
 

Return the size of the rawData in the contribution.

Returns:
The size of the rawData in the contribution

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

Return a pointer to a LATcontribution 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 LATcontribution as a string buffer

Reimplemented in ASCcontribution, and EBFevent.


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