GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > RIM / V2-0-1

Constituent: rim     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

RIM_map.c File Reference

Provides functionality concerned with creating and manipulating a RIM map. More...

#include "RIM_p.h"
#include "RIM/RIM_msgs.h"
#include "RIM_number.ic"
#include "RIM_AG_init_p.h"
#include <string.h>

Include dependency graph for RIM_map.c:


Functions

static unsigned mapIndex (const RIM_map *map, RIM_type type, const RIM_addr *addr, unsigned *index)
 Convert the address into an index appropriate for this type of map as well as performing various checks on the input parameters.
size_t RIM_sizeofMap (void)
 Calculate the total size of a RIM_map object.
RIM_mapRIM_constructMap (void *buf)
 Initialise the supplied memory as a RIM_map object.
unsigned RIM_setBit (RIM_map *map, RIM_type type, const RIM_addr *addr)
 Set a bit in the map.
unsigned RIM_clearBit (RIM_map *map, RIM_type type, const RIM_addr *addr)
 Clear a bit in the map.
int RIM_countMap (const RIM_map *map, RIM_type type)
 Count the number of set bits in the map.
int RIM_checkBit (const RIM_map *map, RIM_type type, const RIM_addr *addr)
 Check a bit in the map.
void RIM_clearMap (RIM_map *map)
 Clear the map.

Detailed Description

Provides functionality concerned with creating and manipulating a RIM map.

Author:
James Swain & Owen Saxton
Id
RIM_map.c,v 1.2 2007/11/09 23:22:49 saxton Exp

Function Documentation

unsigned mapIndex const RIM_map map,
RIM_type  type,
const RIM_addr addr,
unsigned *  index
[static]
 

Convert the address into an index appropriate for this type of map as well as performing various checks on the input parameters.

Parameters:
map Pointer to a map structure
type Type of the map
addr Pointer to an address structure identifying the required bit
index Pointer to location to store the calculated index
Return values:
RIM_SUCCESS if everything goes well
RIM_TYPEUNKN if the type does not exist
RIM_MAPNONE if there is no sub-map corresponding to this type
RIM_ADDRBCST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDRRNGE if any component of the address is out of range
RIM_ADDRINDX if the final index exceeds the total number of bits in the map

int RIM_checkBit const RIM_map map,
RIM_type  type,
const RIM_addr addr
 

Check a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to check
Return values:
0 if the bit is clear
1 if the bit is set

unsigned RIM_clearBit RIM_map map,
RIM_type  type,
const RIM_addr addr
 

Clear a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to clear
Return values:
RIM_SUCCESS if everything goes well
RIM_TYPEUNKN if the type does not exist
RIM_MAPNONE if there is no sub-map corresponding to this type
RIM_ADDRBCST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDRRNGE if any component of the address is out of range
RIM_ADDRINDX if the final index exceeds the total number of bits in the map

void RIM_clearMap RIM_map map  ) 
 

Clear the map.

Parameters:
map Structure being manipulated

RIM_map* RIM_constructMap void *  buf  ) 
 

Initialise the supplied memory as a RIM_map object.

Parameters:
buf Block of memory, at least as large as RIM_sizeofMap, to initalise as a RIM_map object
Returns:
Pointer to an initialised RIM_map object

int RIM_countMap const RIM_map map,
RIM_type  type
 

Count the number of set bits in the map.

Parameters:
map Structure being manipulated
type Identifies map to count
Returns:
Number of bits set in the map, or -1 for an illegal type

unsigned RIM_setBit RIM_map map,
RIM_type  type,
const RIM_addr addr
 

Set a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to set
Return values:
RIM_SUCCESS if everything goes well
RIM_TYPEUNKN if the type does not exist
RIM_MAPNONE if there is no sub-map corresponding to this type
RIM_ADDRBCST if the address contains a mixture of broadcast and unicast addresses
RIM_ADDRRNGE if any component of the address is out of range
RIM_ADDRINDX if the final index exceeds the total number of bits in the map

size_t RIM_sizeofMap void   ) 
 

Calculate the total size of a RIM_map object.

Returns:
Amount of memory required to accomodate a RIM_map object


Generated on Wed Nov 21 01:38:19 2007 by  doxygen 1.4.4