NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Static Public Member Functions | List of all members
DDAS::SetFile Class Reference

#include <SetFile.h>

Static Public Member Functions

static VarOffsetArray readVarFile (const char *filename)
 
static VarMapByOffset createVarOffsetMap (const VarOffsetArray &offsets)
 
static VarMapByName createVarNameMap (const VarOffsetArray &offsets)
 
static std::pair< unsigned,
uint32_t * > 
readSetFile (const char *filename)
 
static void writeSetFile (const char *filename, unsigned nLongs, uint32_t *pVars)
 
static void freeSetFile (uint32_t *pVars)
 
static UnpackedSetFile populateSetFileArray (unsigned nLongs, const uint32_t *pVars, const VarOffsetArray &map)
 
static SetFileByName populateSetFileMap (unsigned nLong, const uint32_t *pVars, const VarOffsetArray &map)
 
static SetFileByName populateSetFileMap (const UnpackedSetFile &vars)
 

Detailed Description

A bunch of static methods that can manipulate set files:

Member Function Documentation

VarMapByName DDAS::SetFile::createVarNameMap ( const VarOffsetArray &  offsets)
static

createVarNameMap Takes an array of offset descriptors from a var file and tossses them up into a map that's indexed by variable name.

Parameters
offsets- the offset array descriptor.
Returns
VarMapByName - the map.
VarMapByOffset DDAS::SetFile::createVarOffsetMap ( const VarOffsetArray &  offsets)
static

createVaroffsetMap Create a map organized by offset values from the array of descriptors created by readVarFile.

Parameters
offsets- the array of offset descriptors.
Returns
VarMapByOffset - map of those descriptors organized by offset:
void DDAS::SetFile::freeSetFile ( uint32_t *  pVar)
static

freeSetFile Free the setfile data gotten by readSetFile

p - pointer to data returned from readSetFile

UnpackedSetFile DDAS::SetFile::populateSetFileArray ( unsigned  nLongs,
const uint32_t *  pVars,
const VarOffsetArray &  map 
)
static

populateSetFileArray Given the contents of a setfile and its variable offset definitions, returns a vector of set file descriptor/contents.

Parameters
nLongs- number of longs in the set file data.
pVars- Buffer contaning the set file data.
map- vars definition. Assumed sorted by offset.
Returns
UnpackedSetFile - vector of variable value definitions.
SetFileByName DDAS::SetFile::populateSetFileMap ( unsigned  nLong,
const uint32_t *  pVars,
const VarOffsetArray &  map 
)
static

populateSetFileMap Populates a set file map indexed by item name.

Parameters
nLong- Number of longs in the map.
pVars- Pointer to the variables in the set file buffer.
map- Variable mapping array.
Returns
SetFileByName
SetFileByName DDAS::SetFile::populateSetFileMap ( const UnpackedSetFile &  vars)
static

populateSetFileMap Overload to populate the map given an unpacked setfile:

Parameters
vars- the unpacked set file.
std::pair< unsigned, uint32_t * > DDAS::SetFile::readSetFile ( const char *  filename)
static

readSetFile Reads the set file in to a soup of storage.

  • Figures out how many bytes are in the file
  • allocates a buffer for that.
  • opens the file and suckes it all into the buffer.
Parameters
filename- path to the .set file.
Returns
std::pair<unsigned, uint32_t*> - first is number of longs, second pointer to the file contents.
VarOffsetArray DDAS::SetFile::readVarFile ( const char *  filename)
static

readVarFile Reads a Var file and provides descriptors for the variables it defines relative to the start of either the DSP var memory in the boards or relative to the file itself.

Parameters
filename- Pointer to the filename to open.
Returns
VarOffsetArray - Resulting description of all the variables.
Note
the array is in order of the definitions in the var file.
void DDAS::SetFile::writeSetFile ( const char *  filename,
unsigned  nLongs,
uint32_t *  pVars 
)
static

writeSetFile Writes a set file back out to disk.

Parameters
filename- name of the file to write to.
nLongs- Number of longs in the set file.
pVars- Pointer to the setfile data in memory.

The documentation for this class was generated from the following files: