#include <ROSFragment.h>
Public Member Functions | |
void | append (eformat::write::ROBFragment *rob) |
void | append (eformat::write::ROBFragment *rob) |
uint32_t | bc_id (void) const |
void | bc_id (uint32_t s) |
uint32_t | bc_id (void) const |
void | bc_id (uint32_t s) |
const eformat::write::node_t * | bind (void) |
const eformat::write::node_t * | bind (void) |
const eformat::write::node_t * | extra (void) |
const eformat::write::node_t * | extra (void) |
const ROBFragment * | first_child (void) const |
const ROBFragment * | first_child (void) const |
uint32_t | lvl1_id (void) const |
void | lvl1_id (uint32_t s) |
uint32_t | lvl1_id (void) const |
void | lvl1_id (uint32_t s) |
uint32_t | meta_size_word (void) const |
uint32_t | meta_size_word (void) const |
uint16_t | minor_version (void) const |
void | minor_version (uint16_t v) |
uint16_t | minor_version (void) const |
void | minor_version (uint16_t v) |
void | next (const ROSFragment *n) |
const ROSFragment * | next (void) const |
void | next (const ROSFragment *n) |
const ROSFragment * | next (void) const |
uint32_t | nstatus (void) const |
uint32_t | nstatus (void) const |
ROSFragment & | operator= (const ROSFragment &other) |
ROSFragment & | operator= (const ROSFragment &other) |
uint32_t | page_count (void) const |
uint32_t | page_count (void) const |
void | parent (eformat::write::SubDetectorFragment *sd) |
const SubDetectorFragment * | parent (void) const |
void | parent (eformat::write::SubDetectorFragment *sd) |
const SubDetectorFragment * | parent (void) const |
ROSFragment (const ROSFragment &other) | |
ROSFragment () | |
ROSFragment (eformat::write::node_t *ros) | |
ROSFragment (uint32_t *ros) | |
ROSFragment (uint32_t source_id, uint32_t run_no, uint32_t lvl1_id, uint32_t bc_id) | |
ROSFragment (const ROSFragment &other) | |
ROSFragment () | |
ROSFragment (eformat::write::node_t *ros) | |
ROSFragment (uint32_t *ros) | |
ROSFragment (uint32_t source_id, uint32_t run_no, uint32_t lvl1_id, uint32_t bc_id) | |
uint32_t | run_no (void) const |
void | run_no (uint32_t s) |
uint32_t | run_no (void) const |
void | run_no (uint32_t s) |
void | size_change (uint32_t o, uint32_t n) |
void | size_change (uint32_t o, uint32_t n) |
uint32_t | size_word (void) const |
uint32_t | size_word (void) const |
uint32_t | source_id (void) const |
void | source_id (uint32_t s) |
uint32_t | source_id (void) const |
void | source_id (uint32_t s) |
const uint32_t * | status (void) const |
void | status (uint32_t n, const uint32_t *status) |
const uint32_t * | status (void) const |
void | status (uint32_t n, const uint32_t *status) |
virtual | ~ROSFragment () |
virtual | ~ROSFragment () |
Private Attributes | |
eformat::write::ROBFragment * | m_child |
my ROB children | |
eformat::write::ROBFragment * | m_child |
my ROB children | |
eformat::write::node_t | m_extra |
Extra pages I may have. | |
uint32_t | m_extra_count |
How many extra pages I have. | |
uint32_t | m_header [10] |
The ROS Header. | |
eformat::write::ROBFragment * | m_last |
my last ROB child | |
eformat::write::ROBFragment * | m_last |
my last ROB child | |
const eformat::write::ROSFragment * | m_next |
Next sibling. | |
const eformat::write::ROSFragment * | m_next |
Next sibling. | |
eformat::write::node_t | m_node [3] |
Node representation. | |
eformat::write::SubDetectorFragment * | m_parent |
my parent | |
eformat::write::SubDetectorFragment * | m_parent |
my parent |
|
Builds a new ROS fragment from scratch
00021 : m_parent(0), 00022 m_child(0), 00023 m_last(0), 00024 m_next(0), 00025 m_extra_count(0) 00026 { 00027 m_header[0] = eformat::ROS; //marker 00028 m_header[1] = 11; //this header size + status size 00029 m_header[2] = 11; //this header size + status size 00030 m_header[3] = eformat::DEFAULT_VERSION; //format version 00031 m_header[4] = source_id; 00032 m_header[5] = 1; //number of status 00033 m_header[6] = 3; //number of fragment specific 00034 m_header[7] = run_no; 00035 m_header[8] = lvl1_id; 00036 m_header[9] = bc_id; 00037 00038 //now initialize pages 00039 set(m_node[0], m_header, 6, &m_node[1]); 00040 set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]); 00041 set(m_node[2], &m_header[6], 4, 0); 00042 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00043 "Built (write) ros fragment from scratch, with", 00044 ROSFragment::source_id(), ROSFragment::lvl1_id(), 00045 ROSFragment::run_no()); 00046 }
|
|
Builds a new ROS fragment from an existing ROS fragment in contiguous memory.
00049 : m_parent(0), 00050 m_child(0), 00051 m_last(0), 00052 m_next(0), 00053 m_extra_count(0) 00054 { 00055 //now initialize pages 00056 set(m_node[0], ros, 6, &m_node[1]); 00057 set(m_node[1], &ros[6], ros[5], &m_node[2]); 00058 set(m_node[2], &ros[6+ros[5]], 4, &m_extra); 00059 eformat::write::set(m_extra, &ros[10+ros[5]], ros[1]-ros[2]); 00060 ++m_extra_count; 00061 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00062 "Built (write) ros fragment from contiguous memory, with", 00063 source_id(), lvl1_id(), run_no()); 00064 }
|
|
Builds a new ROS fragment from an existing ROS fragment in non-contiguous memory. The top-level fragment header is expected to be on a contiguous area of memory, together with the first word of the first child fragment (i.e. the ROB header marker). The following data can be spread around.
00067 : m_parent(0), 00068 m_child(0), 00069 m_last(0), 00070 m_next(0), 00071 m_extra_count(0) 00072 { 00073 //now initialize pages 00074 set(m_node[0], ros->base, 6, &m_node[1]); 00075 set(m_node[1], &ros->base[6], ros->base[5], &m_node[2]); 00076 set(m_node[2], &ros->base[6+ros->base[5]], 4, &m_extra); 00077 eformat::write::set(m_extra, &ros->base[10+ros->base[5]], 00078 ros->size_word - ros->base[2], ros->next); 00079 m_extra_count += eformat::write::count(m_extra); 00080 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00081 "Built (write) ros fragment from paged memory, with", 00082 source_id(), lvl1_id(), run_no()); 00083 }
|
|
Builds a new empty ROS fragment, otherwise invalid. This is useful for array builds and standard containers. 00086 : m_parent(0), 00087 m_child(0), 00088 m_last(0), 00089 m_next(0), 00090 m_extra_count(0) 00091 { 00092 m_header[0] = eformat::ROS; //marker 00093 m_header[1] = 11; //this header size + status size 00094 m_header[2] = 11; //this header size + status size 00095 m_header[3] = eformat::DEFAULT_VERSION; //format version 00096 m_header[4] = 0; //source identifier 00097 m_header[5] = 1; //number of status 00098 m_header[6] = 3; //number of fragment specific 00099 m_header[7] = 0; //run number 00100 m_header[8] = 0; //LVL1 identifier 00101 m_header[9] = 0; //bunch crossing identifier 00102 00103 //now initialize pages 00104 set(m_node[0], m_header, 6, &m_node[1]); 00105 set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]); 00106 set(m_node[2], &m_header[6], 4, 0); 00107 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00108 "Built empty (write) ros fragment from scratch, with", 00109 ROSFragment::source_id(), ROSFragment::lvl1_id(), 00110 ROSFragment::run_no()); 00111 }
|
|
Copy constructor. This will only copy the meta data, not the fragment relationships and block-data (children, parent and status block) contained in the to-be-copied fragment. If you wish this fragment has the same parents, and children of the copied fragment, you have to do this operation manually, after copying. If you wish to make a copy of the status as well, do it manually and then assign it to this fragment using the status() method.
00115 : m_parent(0), 00116 m_child(0), 00117 m_last(0), 00118 m_next(0), 00119 m_extra_count(0) 00120 { 00121 *this = other; 00122 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00123 "Built (write) ros fragment from copy, with", 00124 ROSFragment::source_id(), ROSFragment::lvl1_id(), 00125 ROSFragment::run_no()); 00126 }
|
|
Base destructor 00084 {}
|
|
Builds a new ROS fragment from scratch
|
|
Builds a new ROS fragment from an existing ROS fragment in contiguous memory.
|
|
Builds a new ROS fragment from an existing ROS fragment in non-contiguous memory. The top-level fragment header is expected to be on a contiguous area of memory, together with the first word of the first child fragment (i.e. the ROB header marker). The following data can be spread around.
|
|
Builds a new empty ROS fragment, otherwise invalid. This is useful for array builds and standard containers. |
|
Copy constructor. This will only copy the meta data, not the fragment relationships and block-data (children, parent and status block) contained in the to-be-copied fragment. If you wish this fragment has the same parents, and children of the copied fragment, you have to do this operation manually, after copying. If you wish to make a copy of the status as well, do it manually and then assign it to this fragment using the status() method.
|
|
Base destructor 00084 {}
|
|
Appends a new ROB fragment to this ROS fragment.
|
|
Appends a new ROB fragment to this ROS fragment.
00170 { 00171 ERS_DEBUG_3("%s Source Id. = 0x%x to ros fragment with Source Id. = 0x%x", 00172 "Appending rob fragment with", 00173 rob->source_id(), source_id()); 00174 rob->parent(this); 00175 uint32_t old_size = m_node[0].base[1]; 00176 m_node[0].base[1] += rob->size_word(); 00177 00178 //adjust `m_last' and `m_child' to point to the new last ROB 00179 if (m_last) m_last->next(rob); 00180 else m_child = rob; 00181 m_last = rob; 00182 00183 //propagate changes to my parent 00184 if (m_parent) m_parent->size_change(old_size, m_node[0].base[1]); 00185 }
|
|
Returns the bunch crossing identifier for this fragment
|
|
Changes the bunch crossing identifier in this fragment
|
|
Returns the bunch crossing identifier for this fragment
|
|
Changes the bunch crossing identifier in this fragment
|
|
Returns the first node of a list of nodes that represent the fragment you have constructed. To make use of it, just browse the list as defined in node.h |
|
Returns the first node of a list of nodes that represent the fragment you have constructed. To make use of it, just browse the list as defined in node.h 00196 { 00197 //the header is already concatenated by construction 00198 eformat::write::node_t* last = &m_node[2]; 00199 if (m_extra_count) { 00200 last = &m_extra; 00201 while (last->next) last = last->next; 00202 } 00203 for (const ROBFragment* curr = m_child; curr; curr = curr->next()) { 00204 last->next = const_cast<eformat::write::node_t*>(curr->bind()); 00205 while (last->next) last = last->next; //advance until end 00206 } 00207 return m_node; 00208 }
|
|
Return the extra node of the fragment for OHFiller_write. lifei 00281 {return & m_extra;};
|
|
Return the extra node of the fragment for OHFiller_write. lifei 00281 {return & m_extra;};
|
|
This returns the first child of this fragment. The system operates as a concatenated list of fragments. From this child you can get to the next. 00222 { return m_child; }
|
|
This returns the first child of this fragment. The system operates as a concatenated list of fragments. From this child you can get to the next. 00222 { return m_child; }
|
|
Returns the lvl1 identifier for this fragment
|
|
Changes the lvl1 identifier in this fragment
|
|
Returns the lvl1 identifier for this fragment
|
|
Changes the lvl1 identifier in this fragment
|
|
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
|
|
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
|
|
Returns the minor version number of the fragment
|
|
Changes the minor version number of the fragment
|
|
Returns the minor version number of the fragment
|
|
Changes the minor version number of the fragment
|
|
Sets the next sibling
00257 { m_next = n; }
|
|
Returns the next sibling 00250 { return m_next; }
|
|
Sets the next sibling
00257 { m_next = n; }
|
|
Returns the next sibling 00250 { return m_next; }
|
|
Returns the number of status wors in this fragment
|
|
Returns the number of status wors in this fragment
|
|
Assigment operator. This will only copy the meta data, not the fragment relationships and block-data (children and parent and status block) contained in the to-be-copied fragment. If you wish this fragment has the same parents, and children of the copied fragment, you have to do this operation manually, after copying. If you wish to make a copy of the status as well, do it manually and then assign it to this fragment using the status() method.
|
|
Assigment operator. This will only copy the meta data, not the fragment relationships and block-data (children and parent and status block) contained in the to-be-copied fragment. If you wish this fragment has the same parents, and children of the copied fragment, you have to do this operation manually, after copying. If you wish to make a copy of the status as well, do it manually and then assign it to this fragment using the status() method.
00130 { 00131 memcpy(reinterpret_cast<void*>(m_header), 00132 reinterpret_cast<const void*>(other.m_node[0].base), 00133 6*sizeof(uint32_t)); 00134 memcpy(reinterpret_cast<void*>(m_header+6), 00135 reinterpret_cast<const void*>(other.m_node[2].base), 00136 4*sizeof(uint32_t)); 00137 00138 //now initialize pages 00139 set(m_node[0], m_header, 6, &m_node[1]); 00140 set(m_node[1], other.m_node[1].base, other.m_node[1].size_word, &m_node[2]); 00141 set(m_node[2], &m_header[6], 4, 0); 00142 ERS_DEBUG_3("%s Source Id. = 0x%x., LVL1 Id. = %d, Run Number = %d", 00143 "Copied (write) ros fragment, with", 00144 ROSFragment::source_id(), ROSFragment::lvl1_id(), 00145 ROSFragment::run_no()); 00146 return *this; 00147 }
|
|
Returns the total number of (raw memory) pages this fragment is composed of.
|
|
Returns the total number of (raw memory) pages this fragment is composed of.
00188 { 00189 uint32_t retval = 3 + m_extra_count; 00190 for (const ROBFragment* curr = m_child; curr; curr = curr->next()) 00191 retval += curr->page_count(); 00192 return retval; 00193 }
|
|
This sets the parent fragment
00245 { m_parent = sd; }
|
|
This returns the parent fragment 00237 { return m_parent; }
|
|
This sets the parent fragment
00245 { m_parent = sd; }
|
|
This returns the parent fragment 00237 { return m_parent; }
|
|
Returns the run number for this fragment
|
|
Changes the run number
|
|
Returns the run number for this fragment
|
|
Changes the run number
|
|
This method is used by children of this fragment to notify fragment size changes.
|
|
This method is used by children of this fragment to notify fragment size changes.
00162 { 00163 uint32_t old_size = m_node[0].base[1]; 00164 m_node[0].base[1] -= o; 00165 m_node[0].base[1] += n; 00166 if (m_parent) m_parent->size_change(old_size, m_node[0].base[1]); 00167 }
|
|
Returns the total size for this fragment, in words
|
|
Returns the total size for this fragment, in words
|
|
Returns the source identifier for this fragment
|
|
Changes the source identifier for this fragment
|
|
Returns the source identifier for this fragment
|
|
Changes the source identifier for this fragment
|
|
Returns a pointer to the first status word to be used by this fragment
|
|
Changes the number of status words and the status words themselves from the fragment
|
|
Returns a pointer to the first status word to be used by this fragment
|
|
Changes the number of status words and the status words themselves from the fragment
00150 { 00151 if (m_parent) m_parent->size_change(m_node[0].base[1], 00152 m_node[0].base[1]-m_node[0].base[5]+n); 00153 m_node[0].base[1] -= m_node[0].base[5]; //remove count from previous status 00154 m_node[0].base[2] -= m_node[0].base[5]; //remove count from previous status 00155 m_node[1].size_word = m_node[0].base[5] = n; //set new values 00156 m_node[0].base[1] += n; 00157 m_node[0].base[2] += n; 00158 m_node[1].base = const_cast<uint32_t*>(status); 00159 }
|
|
my ROB children
|
|
my ROB children
|
|
Extra pages I may have.
|
|
How many extra pages I have.
|
|
The ROS Header.
|
|
my last ROB child
|
|
my last ROB child
|
|
Next sibling.
|
|
Next sibling.
|
|
Node representation.
|
|
my parent
|
|
my parent
|