#include <SubDetectorFragment.h>
|
Builds a new SubDetector fragment from scratch
00020 : m_parent(0), 00021 m_child(0), 00022 m_last(0), 00023 m_next(0), 00024 m_extra_count(0) 00025 { 00026 m_header[0] = eformat::SUB_DETECTOR; //marker 00027 m_header[1] = 8; //this header size + status size 00028 m_header[2] = 8; //this header size + status size 00029 m_header[3] = eformat::DEFAULT_VERSION; //format version 00030 m_header[4] = source_id; 00031 m_header[5] = 1; //number of status 00032 m_header[6] = 0; //number of fragment specific 00033 00034 //now initialize pages 00035 set(m_node[0], m_header, 6, &m_node[1]); 00036 set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]); 00037 set(m_node[2], &m_header[6], 1, 0); 00038 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00039 "Built (write) subdetector from scratch, with", 00040 SubDetectorFragment::source_id()); 00041 }
|
|
Builds a new SubDetector fragment from an existing SubDetector fragment in contiguous memory.
00068 : m_parent(0), 00069 m_child(0), 00070 m_last(0), 00071 m_next(0), 00072 m_extra_count(0) 00073 { 00074 //now initialize pages 00075 set(m_node[0], sd, 6, &m_node[1]); 00076 set(m_node[1], &sd[6], sd[5], &m_node[2]); 00077 set(m_node[2], &sd[6+sd[5]], 1, &m_extra); 00078 eformat::write::set(m_extra, &sd[7+sd[5]], sd[1]-sd[2], 0); 00079 ++m_extra_count; 00080 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00081 "Built (write) subdetector from contiguous memory, with", 00082 source_id()); 00083 }
|
|
Builds a new SubDetector fragment from an existing SubDetector 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 ROS header marker). The following data can be spread around.
00087 : m_parent(0), 00088 m_child(0), 00089 m_last(0), 00090 m_next(0), 00091 m_extra_count(0) 00092 { 00093 //now initialize pages 00094 set(m_node[0], sd->base, 6, &m_node[1]); 00095 set(m_node[1], &sd->base[6], sd->base[5], &m_node[2]); 00096 set(m_node[2], &sd->base[6+sd->base[5]], 1, &m_extra); 00097 eformat::write::set(m_extra, &sd->base[7+sd->base[5]], 00098 sd->size_word - sd->base[2], sd->next); 00099 m_extra_count += eformat::write::count(m_extra); 00100 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00101 "Built (write) subdetector from paged memory, with", 00102 source_id()); 00103 }
|
|
Builds a new empty SubDetectorFragment, otherwise invalid. This is useful for array builds and standard containers. 00044 : m_parent(0), 00045 m_child(0), 00046 m_last(0), 00047 m_next(0), 00048 m_extra_count(0) 00049 { 00050 m_header[0] = eformat::SUB_DETECTOR; //marker 00051 m_header[1] = 8; //this header size + status size 00052 m_header[2] = 8; //this header size + status size 00053 m_header[3] = eformat::DEFAULT_VERSION; //format version 00054 m_header[4] = 0; //source identifier 00055 m_header[5] = 1; //number of status 00056 m_header[6] = 0; //number of fragment specific 00057 00058 //now initialize pages 00059 set(m_node[0], m_header, 6, &m_node[1]); 00060 set(m_node[1], &eformat::DEFAULT_STATUS, 1, &m_node[2]); 00061 set(m_node[2], &m_header[6], 1, 0); 00062 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00063 "Built empty (write) subdetector from scratch, with", 00064 SubDetectorFragment::source_id()); 00065 }
|
|
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.
00107 : m_parent(0), 00108 m_child(0), 00109 m_last(0), 00110 m_next(0), 00111 m_extra_count(0) 00112 { 00113 *this = other; 00114 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00115 "Built (write) subdetector from copy, with", 00116 source_id()); 00117 }
|
|
Base destructor 00081 {}
|
|
Builds a new SubDetector fragment from scratch
|
|
Builds a new SubDetector fragment from an existing SubDetector fragment in contiguous memory.
|
|
Builds a new SubDetector fragment from an existing SubDetector 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 ROS header marker). The following data can be spread around.
|
|
Builds a new empty SubDetectorFragment, 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 00081 {}
|
|
Appends a new ROS fragment to this SubDetector fragment.
|
|
Appends a new ROS fragment to this SubDetector fragment.
00161 { 00162 ERS_DEBUG_3("%s Source Id. = 0x%x to subdetector with Source Id. = 0x%x", 00163 "Appending ros fragment with", 00164 ros->source_id(), source_id()); 00165 ros->parent(this); 00166 uint32_t old_size = m_node[0].base[1]; 00167 m_node[0].base[1] += ros->size_word(); 00168 00169 //adjust `m_last' and `m_child' to point to the new last ROB 00170 if (m_last) m_last->next(ros); 00171 else m_child = ros; 00172 m_last = ros; 00173 00174 //propagate changes to my parent 00175 if (m_parent) m_parent->size_change(old_size, m_node[0].base[1]); 00176 }
|
|
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 00188 { 00189 //the header is already concatenated by construction 00190 eformat::write::node_t* last = &m_node[2]; 00191 if (m_extra_count) { 00192 last = &m_extra; 00193 while (last->next) last = last->next; 00194 } 00195 for (ROSFragment* curr = m_child; curr; 00196 curr = const_cast<ROSFragment*>(curr->next())) { 00197 last->next = const_cast<eformat::write::node_t*>(curr->bind()); 00198 while (last->next) last = last->next; //advance until end 00199 } 00200 return m_node; 00201 }
|
|
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. 00178 { 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. 00178 { return m_child; }
|
|
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
00213 { m_next = n; }
|
|
Returns the next sibling 00206 { return m_next; }
|
|
Sets the next sibling
00213 { m_next = n; }
|
|
Returns the next sibling 00206 { 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.
00122 { 00123 memcpy(reinterpret_cast<void*>(m_header), 00124 reinterpret_cast<const void*>(other.m_node[0].base), 00125 6*sizeof(uint32_t)); 00126 m_header[6] = other.m_node[2].base[0]; 00127 00128 //now initialize pages 00129 set(m_node[0], m_header, 6, &m_node[1]); 00130 set(m_node[1], other.m_node[1].base, other.m_node[1].size_word, &m_node[2]); 00131 set(m_node[2], &m_header[6], 1, 0); 00132 ERS_DEBUG_3("%s Source Id. = 0x%x.", 00133 "Copied (write) subdetector with", 00134 SubDetectorFragment::source_id()); 00135 return *this; 00136 }
|
|
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.
00179 { 00180 uint32_t retval = 3 + m_extra_count; 00181 for (const ROSFragment* curr = m_child; curr; curr = curr->next()) 00182 retval += curr->page_count(); 00183 return retval; 00184 }
|
|
This sets the parent fragment
00201 { m_parent = fe; }
|
|
This returns the parent fragment 00193 { return m_parent; }
|
|
This sets the parent fragment
00201 { m_parent = fe; }
|
|
This returns the parent fragment 00193 { return m_parent; }
|
|
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.
00152 { 00153 uint32_t old_size = m_node[0].base[1]; 00154 m_node[0].base[1] -= o; 00155 m_node[0].base[1] += n; 00156 if (m_parent) m_parent->size_change(old_size, m_node[0].base[1]); 00157 }
|
|
Returns the total size for this fragment, in words
|
|
Returns the total size for this fragment, in words
|
|
Returns the source identifier of this fragment
|
|
Changes the source identifier for this fragment
|
|
Returns the source identifier of 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
00140 { 00141 if (m_parent) m_parent->size_change(m_node[0].base[1], 00142 m_node[0].base[1]-m_node[0].base[5]+n); 00143 m_node[0].base[1] -= m_node[0].base[5]; //remove count from previous status 00144 m_node[0].base[2] -= m_node[0].base[5]; //remove count from previous status 00145 m_node[1].size_word = m_node[0].base[5] = n; //set new values 00146 m_node[0].base[1] += n; 00147 m_node[0].base[2] += n; 00148 m_node[1].base = const_cast<uint32_t*>(status); 00149 }
|
|
my ROS children
|
|
my ROS children
|
|
Extra pages I may have.
|
|
How many extra pages I have.
|
|
The SubDetector Header.
|
|
my last ROS child
|
|
my last ROS child
|
|
Next sibling.
|
|
Next sibling.
|
|
Node representation.
|
|
my parent
|
|
my parent
|