GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSE / V1-6-4

Constituent: qseprint     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QSE_map.h File Reference

Utility routine to find index bit maps. More...

#include "QSE/impl/QSE_map.xx-xxx-xxx.h"

Include dependency graph for QSE_map.h:

This graph shows which files directly or indirectly include this file:


Typedefs

typedef unsigned int QSE_map
 Due to endianness issues, all maps manipulated by these routines must be 32-unsigned ints. This typedef reenforces this notion.

Functions

static __inline int QSE_mapScanf (QSE_map map)
 Finds the first set bit (LSB = bit 0) in the specified map The scan is a forward scan from LSB to MSB.
static __inline int QSE_mapScanr (QSE_map map)
 Finds the first set bit (LSB = bit 0) in the specified map The scan is a reverse scan from MSB to LSB.
static __inline int QSE_mapScanF (QSE_map map)
 Finds the first set bit (MSB = bit 0) in the specified map The scan is a forward scan from LSB to MSB.
static __inline int QSE_mapScanR (QSE_map map)
 Finds the first set bit (MSB = bit 0) in the specified map The scan is a reverse scan from MSB to LSB.
static __inline QSE_map QSE_mapRemove (QSE_map map, int bit)
 Removes the specified bit, bit from map.
static __inline QSE_map QSE_mapInsert (QSE_map map, int bit)
 Inserts the specified bit, bit into map.
static __inline QSE_map QSE_mapMask (int bit)
 Converts the bit to a bit mask.
static __inline QSE_map QSE_mapShiftIn (QSE_map map)
 Shifts the map to make room in the low bit numbers for a new bit.
static __inline QSE_map QSE_mapShiftOut (QSE_map map)
 Shifts the map to make room in the low bit numbers for a new bit.

Detailed Description

Utility routine to find index bit maps.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QSE_map.h,v 1.3 2006/02/22 01:24:42 russell Exp $

This is a packaging of the commonly found Find First Set bit that is native to many machines. The QSE data structure contain numerous instances where, instead of using an array to pack non-dense data, like the list of towers with calorimeter hits, a bit list is used. The advantages are
  1. Compactness
  2. Can be used efficiently either in a random or sequentail access mode.

Function Documentation

static __inline QSE_map QSE_mapInsert QSE_map  map,
int  bit
[static]
 

Inserts the specified bit, bit into map.

Returns:
The value of the input map with the specified bit inserted
Parameters:
map The map to insert the bit into
bit The bit (LSB = 0) to add
This is merely a convenience routine. Nothing fancy is going on here, just a straightforward insertion of the specified bit using an OR operation.

static __inline QSE_map QSE_mapMask int  bit  )  [static]
 

Converts the bit to a bit mask.

Returns:
A 32 bit value with the specified bit set (LSB = bit 0)
Parameters:
bit The bit LMSB = 0) to set.
Nothing fancy, this routine exists for consistency across the QSE_map routines.

static __inline QSE_map QSE_mapRemove QSE_map  map,
int  bit
[static]
 

Removes the specified bit, bit from map.

Returns:
The value of the input map with the specified bit eliminated.
Parameters:
map The map to eliminate the bit from
bit The bit (LSB = 0) to eliminate
This is merely a convenience routine. Nothing fancy is going on here, just a straightforward elimination of the specified bit using a mask operation.

static __inline int QSE_mapScanF QSE_map  map  )  [static]
 

Finds the first set bit (MSB = bit 0) in the specified map The scan is a forward scan from LSB to MSB.

Returns:
Returns the bit number of the first set bit
Overview
This routine scans a 32 bit longword from right (LSB) to left (MSB) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.

static __inline int QSE_mapScanf QSE_map  map  )  [static]
 

Finds the first set bit (LSB = bit 0) in the specified map The scan is a forward scan from LSB to MSB.

Returns:
Returns the bit number of the first set bit
Overview
This routine scans a 32 bit longword from right (LSB) to left (MSB) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.

static __inline int QSE_mapScanR QSE_map  map  )  [static]
 

Finds the first set bit (MSB = bit 0) in the specified map The scan is a reverse scan from MSB to LSB.

Returns:
Returns the bit number of the first set bit
Overview
This routine scans a 32 bit longword from left (MSB) to right (LSB) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.

static __inline int QSE_mapScanr QSE_map  map  )  [static]
 

Finds the first set bit (LSB = bit 0) in the specified map The scan is a reverse scan from MSB to LSB.

Returns:
Returns the bit number of the first set bit
Overview
This routine scans a 32 bit longword from left (MSB) to right (LSB) looking for the first bit set. If it finds a bit it returns a value in the range 0-31. The routine is not protected against 0 as an input and the result is undefined.

static __inline QSE_map QSE_mapShiftIn QSE_map  map  )  [static]
 

Shifts the map to make room in the low bit numbers for a new bit.

Parameters:
map The map to shift
On little endian machines this is a shift left operation On big endian machines this is a shift right operation

static __inline QSE_map QSE_mapShiftOut QSE_map  map  )  [static]
 

Shifts the map to make room in the low bit numbers for a new bit.

Parameters:
map The map to shift
On little endian machines this is a shift right operation On big endian machines this is a shift left operation


Generated on Tue Jul 17 04:26:23 2007 by  doxygen 1.4.4