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

#include <FragmentIndex.h>

Public Types

typedef Container::iterator iterator
 
typedef Container::const_iterator const_iterator
 

Public Member Functions

 FragmentIndex ()
 
 FragmentIndex (uint16_t *data)
 
FragmentInfo getFragment (size_t i)
 
size_t getNumberFragments () const
 
void indexFragments (uint16_t *begin, uint16_t *end)
 
void indexFragments (uint16_t *data, size_t max_bytes)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Detailed Description

! FragmentIndex

A class that finds the start of every fragment in a built ring item.

Constructor & Destructor Documentation

FragmentIndex::FragmentIndex ( )

! Default constructor Does nothing besides initialize the empty list of fragments

FragmentIndex::FragmentIndex ( uint16_t *  data)

! Given the body pointer, index all of the fragmentsa

Parameters
apointer to the first word in the body (this is b/4 the first fragment)

! Given the body pointer, index all of the fragments

Parameters
apointer to the first word in the body (this is b/4 the first fragment)

Member Function Documentation

FragmentInfo FragmentIndex::getFragment ( size_t  i)
inline

! Get a fragment Checks whether the index provided is valid. If index is out of range, returns a null pointer. Otherwise, it returns the ith pointer.

Parameters
iis the index of the fragment in the body (starting at 0)
Returns
the pointer to the ith fragment or null if ith index doesn't exist
void FragmentIndex::indexFragments ( uint16_t *  begin,
uint16_t *  end 
)

! The indexing algorithm This will traverse the range of data in addresses [begin, end] and find all of the complete fragments. Every fragment found will be appended to the list of fragments m_frags. This is very similar to the constructor but differs in the arguments. The constructor expects that the first word of the body is passed, this expects that the pointer to the first fragment is passed. There should be a difference of 32-bits between the two arguments.

Parameters
begina pointer to the first fragment
endpointer just beyond the last fragment

! Indexes all of the fragments

Parameters
dataa pointer to the first fragment
nbytesthe number of bytes from start of first fragment to end of the body
void FragmentIndex::indexFragments ( uint16_t *  data,
size_t  max_bytes 
)
inline

! The indexing algorithm

Parameters
dataa pointer to the first fragment
nbytesthe number of bytes from start of first fragment to end of the body

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