eformat::write::ROBFragment Class Reference

forward More...

#include <ROBFragment.h>

List of all members.

Public Member Functions

 ROBFragment (uint32_t source_id, uint32_t run_no, uint32_t lvl1_id, uint32_t bc_id, uint32_t lvl1_type, uint32_t detev_type, uint32_t ndata, const uint32_t *data, uint32_t status_position)
 ROBFragment ()
 ROBFragment (const ROBFragment &other)
 ROBFragment (uint32_t *rod, uint32_t size_word)
 ROBFragment (uint32_t *rob)
virtual ~ROBFragment ()
ROBFragmentoperator= (const ROBFragment &other)
void status (uint32_t n, const uint32_t *status)
uint32_t nstatus (void) const
const uint32_t * status (void) const
void minor_version (uint16_t v)
uint16_t minor_version (void) const
void rod_status (uint32_t n, const uint32_t *status)
uint32_t rod_nstatus (void) const
const uint32_t * rod_status (void) const
void status_position (uint32_t v)
uint32_t status_position (void) const
void rod_minor_version (uint16_t v)
void rod_data (uint32_t n, const uint32_t *data)
uint32_t rod_ndata (void) const
const uint32_t * rod_data (void) const
void source_id (uint32_t s)
uint32_t source_id (void) const
void rod_run_no (uint32_t s)
uint32_t rod_run_no (void) const
void rod_lvl1_id (uint32_t s)
uint32_t rod_lvl1_id (void) const
void rod_bc_id (uint32_t s)
uint32_t rod_bc_id (void) const
void rod_lvl1_type (uint32_t s)
uint32_t rod_lvl1_type (void) const
void rod_detev_type (uint32_t s)
uint32_t rod_detev_type (void) const
uint32_t meta_size_word (void) const
uint32_t size_word (void) const
uint32_t page_count (void) const
const eformat::write::node_tbind (void) const
void parent (eformat::write::ROSFragment *ros)
const ROSFragmentparent (void) const
void next (const ROBFragment *n)
const ROBFragmentnext (void) const

Private Attributes

uint32_t m_header [7]
 The ROB Header.
uint32_t m_rod_header [9]
 The ROD Header.
uint32_t m_rod_trailer [3]
 The ROD trailer.
eformat::write::node_t m_node [7]
 Node representation.
eformat::write::ROSFragmentm_parent
 My parent.
const eformat::write::ROBFragmentm_next
 Next sibling.


Detailed Description

forward

Defines a helper class to aid the creation of ROB fragments.

Definition at line 28 of file ROBFragment.h.


Constructor & Destructor Documentation

eformat::write::ROBFragment::ROBFragment ( uint32_t  source_id,
uint32_t  run_no,
uint32_t  lvl1_id,
uint32_t  bc_id,
uint32_t  lvl1_type,
uint32_t  detev_type,
uint32_t  ndata,
const uint32_t *  data,
uint32_t  status_position 
)

Builds a new ROB fragment from scratch

Parameters:
source_id The source identifier to be using for this ROB
run_no The run number for this ROB/ROD
lvl1_id The LVL1 identifier for this ROB/ROD
bc_id The bunch crossing identifier for this ROB/ROD
lvl1_type The LVL1 trigger type identifier for this ROB/ROD
detev_type The detector event type for this ROB/ROD
ndata The number of 32-bits pointed by "data" bellow
data A set of 32-bit words that consist the data block of this ROB fragment
status_position The status block position you want to have on the ROD format. Use the definitions available in Status.h to get generic identifiers for the possibilities.

Definition at line 21 of file ROBFragment.cxx.

References eformat::DEFAULT_STATUS, eformat::DEFAULT_VERSION, ERS_DEBUG_3, eformat::ROB, eformat::ROD, eformat::write::set(), and eformat::STATUS_FRONT.

00028   : m_parent(0),
00029     m_next(0)
00030 {
00031   m_header[0] = eformat::ROB; //marker
00032   m_header[1] = 21 + ndata; //total fragment size in words
00033   m_header[2] = 8; //this header size + status size
00034   m_header[3] = eformat::DEFAULT_VERSION; //format version
00035   m_header[4] = source_id;
00036   m_header[5] = 1; //number of status
00037   m_header[6] = 0; //number of fragment specific
00038   m_rod_header[0] = eformat::ROD; //ROD marker
00039   m_rod_header[1] = 9; //ROD header size
00040   m_rod_header[2] = eformat::DEFAULT_VERSION; //format version
00041   m_rod_header[3] = source_id;
00042   m_rod_header[4] = run_no;
00043   m_rod_header[5] = lvl1_id;
00044   m_rod_header[6] = bc_id;
00045   m_rod_header[7] = lvl1_type;
00046   m_rod_header[8] = detev_type;
00047   m_rod_trailer[0] = 1; //number of status in the ROD
00048   m_rod_trailer[1] = ndata; //number of data words in the ROD
00049   m_rod_trailer[2] = status_position;
00050 
00051   //now initialize pages
00052   set(m_node[0], m_header, 6, &m_node[1]);
00053   set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]);
00054   set(m_node[2], &m_header[6], 1, &m_node[3]); //specific part
00055   if (m_rod_trailer[2] == eformat::STATUS_FRONT) {
00056     set(m_node[3], m_rod_header, 9, &m_node[4]);
00057     set(m_node[4], &eformat::DEFAULT_STATUS, 1, &m_node[5]); //status
00058     set(m_node[5], data, ndata, &m_node[6]); //data
00059   }
00060   else {
00061     set(m_node[3], m_rod_header, 9, &m_node[5]);
00062     set(m_node[5], data, ndata, &m_node[4]); //data
00063     set(m_node[4], &eformat::DEFAULT_STATUS, 1, &m_node[6]); //status
00064   }
00065   set(m_node[6], m_rod_trailer, 3, 0);
00066   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 
00067               "Built (write) rob/rod fragment from scratch, with",
00068               ROBFragment::source_id(), rod_lvl1_id(), rod_run_no());
00069 }

eformat::write::ROBFragment::ROBFragment (  ) 

Builds a new "empty" ROB fragment, otherwise invalid. Use the methods bellow to set its fields. This is useful to pre-allocate objects of this class in the stack and later use them by assigment. Another option are standard containers, that demand the contained classes to have this method.

Definition at line 71 of file ROBFragment.cxx.

References eformat::DEFAULT_STATUS, eformat::DEFAULT_VERSION, ERS_DEBUG_3, m_header, m_node, m_rod_header, m_rod_trailer, eformat::ROB, eformat::ROD, rod_lvl1_id(), rod_run_no(), eformat::write::set(), source_id(), and eformat::STATUS_FRONT.

00072   : m_parent(0),
00073     m_next(0)
00074 {
00075   m_header[0] = eformat::ROB; //marker
00076   m_header[1] = 21;
00077   m_header[2] = 8; //this header size + status size
00078   m_header[3] = eformat::DEFAULT_VERSION; //format version
00079   m_header[4] = 0; //source identifier of the ROB fragment
00080   m_header[5] = 1; //number of status
00081   m_header[6] = 0; //number of fragment specific
00082   m_rod_header[0] = eformat::ROD; //ROD marker
00083   m_rod_header[1] = 9; //ROD header size
00084   m_rod_header[2] = eformat::DEFAULT_VERSION; //format version
00085   m_rod_header[3] = 0; //source identifier of the ROD fragment
00086   m_rod_header[4] = 0; //run number
00087   m_rod_header[5] = 0; //LVL1 identifier
00088   m_rod_header[6] = 0; //bunch crossing identifier
00089   m_rod_header[7] = 0; //LVL1 type
00090   m_rod_header[8] = 0; //detector event type
00091   m_rod_trailer[0] = 1; //number of status in the ROD
00092   m_rod_trailer[1] = 0; //number of data words in the ROD
00093   m_rod_trailer[2] = eformat::STATUS_FRONT; //status block position
00094 
00095   //now initialize pages
00096   set(m_node[0], m_header, 6, &m_node[1]);
00097   set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]);
00098   set(m_node[2], &m_header[6], 1, &m_node[3]); //specific part
00099   if (m_rod_trailer[2] == eformat::STATUS_FRONT) {
00100     set(m_node[3], m_rod_header, 9, &m_node[4]);
00101     set(m_node[4], &eformat::DEFAULT_STATUS, 1, &m_node[5]); //status
00102     set(m_node[5], 0, 0, &m_node[6]); //data
00103   }
00104   else {
00105     set(m_node[3], m_rod_header, 9, &m_node[5]);
00106     set(m_node[5], 0, 0, &m_node[4]); //data
00107     set(m_node[4], &eformat::DEFAULT_STATUS, 1, &m_node[6]); //status
00108   }
00109   set(m_node[6], m_rod_trailer, 3, 0);
00110   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d",
00111               "Built (write) empty rob/rod fragment, with",
00112               ROBFragment::source_id(), rod_lvl1_id(), rod_run_no());
00113 }

eformat::write::ROBFragment::ROBFragment ( const ROBFragment other  ) 

Copy constructor. This will perform a shallow copy of the fragment. In this case, the data and status blocks are not copied, only the meta information, i.e., all but the payload of the underlying ROD fragment and non-variable data blocks are copied. If you wish to have the data/status copied, you have to copy it manually yourself and set the data pointer with the rod_data() and status() and rod_status() methods. The parent fragment remains unset, and you have to append this fragment manually after creation. Binding also doesn't take place.

Parameters:
other The other fragment to copy the meta data from.

Definition at line 116 of file ROBFragment.cxx.

References ERS_DEBUG_3, EvtCyclic3::other(), and source_id().

00117   : m_parent(0),
00118     m_next(0)
00119 {
00120   *this = other;
00121   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 
00122               "Built new (write) rob/rod fragment from copy, with",
00123               ROBFragment::source_id(), rod_lvl1_id(), rod_run_no());
00124 }

eformat::write::ROBFragment::ROBFragment ( uint32_t *  rod,
uint32_t  size_word 
)

Builds a new ROB fragment from scratch, starting from an existing ROD fragment as basis.

Parameters:
rod The rod fragment you want to start with, in a contiguous block of memory
size_word The size of the ROD fragment, in words

Definition at line 126 of file ROBFragment.cxx.

References eformat::DEFAULT_STATUS, eformat::DEFAULT_VERSION, ERS_DEBUG_3, m_header, m_node, eformat::ROB, rod_lvl1_id(), rod_run_no(), eformat::write::set(), source_id(), and eformat::STATUS_FRONT.

00127   : m_parent(0),
00128     m_next(0)
00129 {
00130   m_header[0] = eformat::ROB; //marker
00131   m_header[1] = 8 + size_word; //total fragment size in words
00132   m_header[2] = 8; //this header size + status size
00133   m_header[3] = eformat::DEFAULT_VERSION; //format version
00134   m_header[4] = rod[3];
00135   m_header[5] = 1; //number of status
00136   m_header[6] = 0; //number of fragment specific
00137   
00138   //now initialize pages
00139   set(m_node[0], m_header, 6, &m_node[1]);
00140   set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]);
00141   set(m_node[2], &m_header[6], 1, &m_node[3]);
00142   set(m_node[6], &rod[size_word-3], 3, 0); //ROD trailer
00143   if (m_node[6].base[2] == eformat::STATUS_FRONT) {
00144     set(m_node[3], rod, 9, &m_node[4]); //ROD header
00145     set(m_node[4], &rod[9], m_node[6].base[0], &m_node[5]); //status
00146     set(m_node[5], &rod[9+m_node[6].base[0]], m_node[6].base[1], &m_node[6]);
00147   }
00148   else {
00149     set(m_node[3], rod, 9, &m_node[5]); //ROD header
00150     set(m_node[4], &rod[9+m_node[6].base[1]], m_node[6].base[0], &m_node[6]);
00151     set(m_node[5], &rod[9], m_node[6].base[1], &m_node[4]); //data
00152   }
00153   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 
00154               "Built (write) rob/rod fragment from rod on memory, with",
00155               source_id(), rod_lvl1_id(), rod_run_no());
00156 }

eformat::write::ROBFragment::ROBFragment ( uint32_t *  rob  ) 

Builds a new ROB fragment from an existing ROB fragment in contiguous memory

Warning:
You cannot build from non-contiguous memory. If you have that requirement, please post it to the eformat developers.
Parameters:
rob The ROB fragment you want to start with, in a contiguous block of memory

Definition at line 158 of file ROBFragment.cxx.

References ERS_DEBUG_3, m_node, rod_lvl1_id(), rod_run_no(), eformat::write::set(), source_id(), and eformat::STATUS_FRONT.

00159   : m_parent(0),
00160     m_next(0)
00161 {
00162   //now initialize pages
00163   set(m_node[0], rob, 6, &m_node[1]);
00164   set(m_node[1], &rob[6], rob[5], &m_node[2]);
00165   set(m_node[2], &rob[6+rob[5]], 1, &m_node[3]);
00166   set(m_node[6], &rob[rob[1]-3], 3, 0); //ROD trailer
00167   if (m_node[6].base[2] == eformat::STATUS_FRONT) {
00168     set(m_node[3], &rob[rob[2]], 9, &m_node[4]); //ROD header
00169     set(m_node[4], &rob[rob[2]+9], m_node[6].base[0], &m_node[5]); //status
00170     set(m_node[5], &rob[rob[2]+9+m_node[6].base[0]], m_node[6].base[1], 
00171         &m_node[6]); //data
00172   }
00173   else {
00174     set(m_node[3], &rob[rob[2]], 9, &m_node[5]); //ROD header
00175     set(m_node[4], &rob[rob[2]+9+m_node[6].base[1]], m_node[6].base[0], 
00176         &m_node[6]);
00177     set(m_node[5], &rob[rob[2]+9], m_node[6].base[1], &m_node[4]); //data
00178   }
00179   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 
00180               "Built (write) rob/rod fragment from cont. memory, with",
00181               source_id(), rod_lvl1_id(), rod_run_no());
00182 }

virtual eformat::write::ROBFragment::~ROBFragment (  )  [inline, virtual]

Base destructor

Definition at line 107 of file ROBFragment.h.

00107 {}


Member Function Documentation

const eformat::write::node_t* eformat::write::ROBFragment::bind ( void   )  const [inline]

Outputs a concatenation of eformat::write::node making up a list with the contents of this ROB fragment.

Definition at line 327 of file ROBFragment.h.

References m_node.

00328       { return m_node; }

uint32_t eformat::write::ROBFragment::meta_size_word ( void   )  const [inline]

Returns the total size for the meta data (everything that does not encompass the contents of the m_data pointer in the private representation of this class) in the fragment, in words

Definition at line 309 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

Referenced by size_word().

00310       { return 7 + m_node[0].base[5] + 12 + m_node[6].base[0]; }

uint16_t eformat::write::ROBFragment::minor_version ( void   )  const [inline]

Returns the minor version number of the fragment

Definition at line 154 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00155       { return 0xffff & m_node[0].base[3]; }

void eformat::write::ROBFragment::minor_version ( uint16_t  v  )  [inline]

Changes the minor version number of the fragment

Parameters:
v The new minor version for this header

Definition at line 148 of file ROBFragment.h.

References eformat::write::node_t::base, eformat::DEFAULT_VERSION, and m_node.

Referenced by eformat::old::convert(), and convert_ros().

00149       { m_node[0].base[3] = eformat::DEFAULT_VERSION | v; }

const ROBFragment* eformat::write::ROBFragment::next ( void   )  const [inline]

Returns the next sibling

Definition at line 353 of file ROBFragment.h.

References m_next.

00353 { return m_next; }

void eformat::write::ROBFragment::next ( const ROBFragment n  )  [inline]

Sets the next sibling

Parameters:
n The sibling following this fragment

Definition at line 348 of file ROBFragment.h.

References m_next.

Referenced by eformat::write::ROSFragment::append(), eformat::write::ROSFragment::bind(), PackedRawDataCnvSvc::commitOutput(), and eformat::write::ROSFragment::page_count().

00348 { m_next = n; }

uint32_t eformat::write::ROBFragment::nstatus ( void   )  const [inline]

Returns the number of status wors in this fragment

Definition at line 136 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00136 { return m_node[0].base[5]; }

eformat::write::ROBFragment & eformat::write::ROBFragment::operator= ( const ROBFragment other  ) 

Assignment operator. This will perform a shallow copy of the fragment. In this case, the data and status blocks are not copied, only the meta information, i.e., all but the payload of the underlying ROD fragment and non-variable data blocks are copied. If you wish to have the data/status copied, you have to copy it manually yourself and set the data pointer with the rod_data() and status() and rod_status() methods. The parent fragment is not changed in this operation. Previous binding operations remain valid after assignment.

Parameters:
other The other fragment to copy the meta data from.

Definition at line 185 of file ROBFragment.cxx.

References ERS_DEBUG_3, EvtCyclic3::other(), eformat::write::set(), source_id(), and eformat::STATUS_FRONT.

00186 {
00187   //get the ROB header
00188   memcpy(reinterpret_cast<void*>(m_header),
00189          reinterpret_cast<const void*>(other.m_node[0].base), 
00190          6*sizeof(uint32_t));
00191   m_header[6] = other.m_node[2].base[0];
00192   memcpy(reinterpret_cast<void*>(m_rod_header),
00193          reinterpret_cast<const void*>(other.m_node[3].base),
00194          9*sizeof(uint32_t));
00195   memcpy(reinterpret_cast<void*>(m_rod_trailer), 
00196          reinterpret_cast<const void*>(other.m_node[6].base),
00197          3*sizeof(uint32_t));
00198 
00199   //now re-initialize the pages
00200   set(m_node[0], m_header, 6, &m_node[1]);
00201   set(m_node[1], other.m_node[1].base, other.m_node[1].size_word, &m_node[2]);
00202   set(m_node[2], &m_header[6], 1, &m_node[3]); //specific part
00203   if (m_rod_trailer[2] == eformat::STATUS_FRONT) {
00204     set(m_node[3], m_rod_header, 9, &m_node[4]);
00205     set(m_node[4], other.m_node[4].base, 
00206         other.m_node[4].size_word, &m_node[5]); //status
00207     set(m_node[5], other.m_node[5].base, 
00208         other.m_node[5].size_word, &m_node[6]); //data
00209   }
00210   else {
00211     set(m_node[3], m_rod_header, 9, &m_node[5]);
00212     set(m_node[5], other.m_node[5].base, 
00213         other.m_node[5].size_word, &m_node[4]); //data
00214     set(m_node[4], other.m_node[4].base, 
00215         other.m_node[4].size_word, &m_node[6]); //status
00216   }
00217   set(m_node[6], m_rod_trailer, 3, 0);
00218   ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 
00219               "Copied (write) rob/rod fragment with",
00220               ROBFragment::source_id(), rod_lvl1_id(), rod_run_no());
00221 
00222   return *this;
00223 }

uint32_t eformat::write::ROBFragment::page_count ( void   )  const [inline]

Returns the number of pages of memory I have

Definition at line 321 of file ROBFragment.h.

00321 { return 7; }

const ROSFragment* eformat::write::ROBFragment::parent ( void   )  const [inline]

This returns the parent fragment

Definition at line 341 of file ROBFragment.h.

References m_parent.

00341 { return m_parent; }

void eformat::write::ROBFragment::parent ( eformat::write::ROSFragment ros  )  [inline]

This sets the parent fragment

Parameters:
ros The ROS parent fragment of this ROB/ROD

Definition at line 335 of file ROBFragment.h.

References m_parent.

Referenced by eformat::write::ROSFragment::append().

00336       { m_parent = ros; }

uint32_t eformat::write::ROBFragment::rod_bc_id ( void   )  const [inline]

Returns the bunch crossing identifier for the ROD fragment

Definition at line 273 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00274       { return m_node[3].base[6]; }

void eformat::write::ROBFragment::rod_bc_id ( uint32_t  s  )  [inline]

Changes the bunch crossing identifier in the ROD fragment

Parameters:
s The new value to set

Definition at line 267 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00268       { m_node[3].base[6] = s; }

const uint32_t* eformat::write::ROBFragment::rod_data ( void   )  const [inline]

Returns a pointer to the first of the data words at the ROD fragment

Definition at line 218 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00218 { return m_node[5].base; }

void eformat::write::ROBFragment::rod_data ( uint32_t  n,
const uint32_t *  data 
)

Changes the number of data words and the data words themselves from the ROD fragment

Parameters:
n How many data words the underlying ROD fragment supposed to have
status A pointer to n pre-allocated words

Definition at line 264 of file ROBFragment.cxx.

References eformat::write::node_t::base, m_node, m_parent, eformat::write::ROSFragment::size_change(), and eformat::write::node_t::size_word.

00265 {
00266   if (m_parent) m_parent->size_change(m_node[0].base[1], 
00267                                       m_node[0].base[1]-m_node[6].base[1]+n);
00268 
00269   //remove count from previous data size
00270   m_node[0].base[1] -= m_node[6].base[1]; 
00271   m_node[5].size_word = m_node[6].base[1] = n; //set new values
00272   m_node[0].base[1] += n; //set ROB header's total fragment size back
00273   m_node[5].base = const_cast<uint32_t*>(data); 
00274 }

uint32_t eformat::write::ROBFragment::rod_detev_type ( void   )  const [inline]

Returns the detector event type identifier for the ROD fragment

Definition at line 301 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00302       { return m_node[3].base[8]; }

void eformat::write::ROBFragment::rod_detev_type ( uint32_t  s  )  [inline]

Changes the detector event type in the ROD fragment

Parameters:
s The new value to set

Definition at line 295 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00296       { m_node[3].base[8] = s; }

uint32_t eformat::write::ROBFragment::rod_lvl1_id ( void   )  const [inline]

Returns the lvl1 identifier for the ROD fragment

Definition at line 259 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

Referenced by ROBFragment().

00260       { return m_node[3].base[5]; }

void eformat::write::ROBFragment::rod_lvl1_id ( uint32_t  s  )  [inline]

Changes the lvl1 identifier in the ROD fragment

Parameters:
s The new value to set

Definition at line 253 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00254       { m_node[3].base[5] = s; }

uint32_t eformat::write::ROBFragment::rod_lvl1_type ( void   )  const [inline]

Returns the lvl1 event type identifier for the ROD fragment

Definition at line 287 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00288       { return m_node[3].base[7]; }

void eformat::write::ROBFragment::rod_lvl1_type ( uint32_t  s  )  [inline]

Changes the lvl1 trigger type in the ROD fragment

Parameters:
s The new value to set

Definition at line 281 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00282       { m_node[3].base[7] = s; }

void eformat::write::ROBFragment::rod_minor_version ( uint16_t  v  )  [inline]

Changes the minor version number of the underlying ROD fragment

Parameters:
v The new minor version for this header

Definition at line 197 of file ROBFragment.h.

References eformat::write::node_t::base, eformat::DEFAULT_VERSION, and m_node.

Referenced by eformat::old::convert(), and convert_ros().

00198       { m_node[3].base[2] = eformat::DEFAULT_VERSION | v; }

uint32_t eformat::write::ROBFragment::rod_ndata ( void   )  const [inline]

Returns the number of data words at the ROD fragment

Definition at line 213 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00213 { return m_node[6].base[1]; }

uint32_t eformat::write::ROBFragment::rod_nstatus ( void   )  const [inline]

Returns the number of status wors in this fragment

Definition at line 170 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00170 { return m_node[6].base[0]; }

uint32_t eformat::write::ROBFragment::rod_run_no ( void   )  const [inline]

Returns the run number for the ROD fragment

Definition at line 245 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

Referenced by ROBFragment().

00246       { return m_node[3].base[4]; }

void eformat::write::ROBFragment::rod_run_no ( uint32_t  s  )  [inline]

Changes the run number for the ROD fragment

Parameters:
s The new value to set

Definition at line 239 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00240       { m_node[3].base[4] = s; }

const uint32_t* eformat::write::ROBFragment::rod_status ( void   )  const [inline]

Returns a pointer to the first ROD status word to be used by this fragment

Definition at line 176 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00176 { return m_node[4].base; }

void eformat::write::ROBFragment::rod_status ( uint32_t  n,
const uint32_t *  status 
)

Changes the number of status words and the status words themselves from the ROD fragment

Parameters:
n How many status words the underlying ROD fragment supposed to have
status A pointer to n pre-allocated words

Definition at line 237 of file ROBFragment.cxx.

References eformat::write::node_t::base, m_node, m_parent, eformat::write::ROSFragment::size_change(), and eformat::write::node_t::size_word.

Referenced by Builder::append2event(), eformat::old::convert(), and convert_ros().

00239 { 
00240   if (m_parent) m_parent->size_change(m_node[0].base[1], 
00241                                       m_node[0].base[1]-m_node[6].base[0]+n);
00242   m_node[0].base[1] -= m_node[6].base[0]; //remove count from previous status
00243   m_node[4].size_word = m_node[6].base[0] = n; //set new values
00244   m_node[0].base[1] += n; //set ROB header's total fragment size
00245   m_node[4].base = const_cast<uint32_t*>(status); 
00246 }

uint32_t eformat::write::ROBFragment::size_word ( void   )  const [inline]

Returns the total size for this fragment, in words

Definition at line 315 of file ROBFragment.h.

References eformat::write::node_t::base, m_node, and meta_size_word().

Referenced by eformat::write::ROSFragment::append().

00316       { return meta_size_word() + m_node[6].base[1]; }

uint32_t eformat::write::ROBFragment::source_id ( void   )  const [inline]

Returns the source identifier for both the ROB and the ROD fragments

Definition at line 231 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

Referenced by operator=(), and ROBFragment().

00232       { return m_node[0].base[4]; }

void eformat::write::ROBFragment::source_id ( uint32_t  s  )  [inline]

Changes the source identifier for both the ROB and the ROD fragments

Parameters:
s The new value to set

Definition at line 225 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

Referenced by eformat::write::ROSFragment::append().

00226       { m_node[0].base[4] = m_node[3].base[3] = s; }

const uint32_t* eformat::write::ROBFragment::status ( void   )  const [inline]

Returns a pointer to the first status word to be used by this fragment

Definition at line 141 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00141 { return m_node[1].base; }

void eformat::write::ROBFragment::status ( uint32_t  n,
const uint32_t *  status 
)

Changes the number of status words and the status words themselves from the fragment

Parameters:
n How many status words the underlying ROD fragment supposed to have.
status A pointer to n pre-allocated words

Definition at line 225 of file ROBFragment.cxx.

References eformat::write::node_t::base, m_node, m_parent, eformat::write::ROSFragment::size_change(), and eformat::write::node_t::size_word.

Referenced by Builder::append2event(), eformat::old::convert(), and convert_ros().

00226 { 
00227   if (m_parent) m_parent->size_change(m_node[0].base[1],
00228                                       m_node[0].base[1]-m_node[0].base[5]+n);
00229   m_node[0].base[1] -= m_node[0].base[5]; //remove count from previous status
00230   m_node[0].base[2] -= m_node[0].base[5]; //remove count from previous status
00231   m_node[1].size_word = m_node[0].base[5] = n; //set new values
00232   m_node[0].base[1] += n;
00233   m_node[0].base[2] += n;
00234   m_node[1].base = const_cast<uint32_t*>(status);
00235 }

uint32_t eformat::write::ROBFragment::status_position ( void   )  const [inline]

Returns the current status position

Definition at line 189 of file ROBFragment.h.

References eformat::write::node_t::base, and m_node.

00190       { return m_node[6].base[2]; }

void eformat::write::ROBFragment::status_position ( uint32_t  v  ) 

Changes the order of the status and data blocks in the ROD fragment

Parameters:
s The new value. If v is zero, the status will preceed the data, while the contrary will happen if v equals 1.

Definition at line 248 of file ROBFragment.cxx.

References eformat::write::node_t::base, m_node, eformat::write::node_t::next, and eformat::STATUS_FRONT.

00249 { 
00250   if (v == m_node[6].base[2]) return; //do nothing in this case:)
00251   m_node[6].base[2] = v;
00252   if (m_node[6].base[2] == eformat::STATUS_FRONT) {
00253     m_node[3].next = &m_node[4];
00254     m_node[4].next = &m_node[5];
00255     m_node[5].next = &m_node[6];
00256   }
00257   else {
00258     m_node[3].next = &m_node[5];
00259     m_node[5].next = &m_node[4];
00260     m_node[4].next = &m_node[6];
00261   }
00262 }


Member Data Documentation

uint32_t eformat::write::ROBFragment::m_header[7] [private]

The ROB Header.

Definition at line 357 of file ROBFragment.h.

Referenced by ROBFragment().

const eformat::write::ROBFragment* eformat::write::ROBFragment::m_next [private]

Next sibling.

Definition at line 362 of file ROBFragment.h.

Referenced by next().

eformat::write::node_t eformat::write::ROBFragment::m_node[7] [private]

Node representation.

Definition at line 360 of file ROBFragment.h.

Referenced by bind(), meta_size_word(), minor_version(), nstatus(), ROBFragment(), rod_bc_id(), rod_data(), rod_detev_type(), rod_lvl1_id(), rod_lvl1_type(), rod_minor_version(), rod_ndata(), rod_nstatus(), rod_run_no(), rod_status(), size_word(), source_id(), status(), and status_position().

eformat::write::ROSFragment* eformat::write::ROBFragment::m_parent [private]

My parent.

Definition at line 361 of file ROBFragment.h.

Referenced by parent(), rod_data(), rod_status(), and status().

uint32_t eformat::write::ROBFragment::m_rod_header[9] [private]

The ROD Header.

Definition at line 358 of file ROBFragment.h.

Referenced by ROBFragment().

uint32_t eformat::write::ROBFragment::m_rod_trailer[3] [private]

The ROD trailer.

Definition at line 359 of file ROBFragment.h.

Referenced by ROBFragment().


Generated on Tue Nov 29 23:36:30 2016 for BOSS_7.0.2 by  doxygen 1.4.7