75 template <
typename,
typename,
typename>
76 friend class ScalarIterator;
78 using T_BaseRecord = T_BaseRecord_;
79 using T_BaseRecordData = T_BaseRecordData_;
80 using T_RecordComponent =
typename T_BaseRecord::T_RecordComponent;
81 using T_Container =
typename T_BaseRecord::T_Container;
83 std::remove_reference_t<decltype(*std::declval<T_BaseIterator>())>;
84 using Left = T_BaseIterator;
87 constexpr bool operator==(Right
const &)
const noexcept
91 constexpr bool operator!=(Right
const &)
const noexcept
100 T_BaseRecordData *m_baseRecordData =
nullptr;
102 std::optional<std::pair<std::string const, T_RecordComponent>>;
103 ScalarTuple m_scalarTuple;
104 std::variant<Left, Right> m_iterator;
106 explicit ScalarIterator();
108 ScalarIterator(T_BaseRecord *baseRecord,
bool is_end);
109 ScalarIterator(T_BaseRecord *baseRecord, Left
iterator);
130 typename SFINAE = std::enable_if_t<
131 !std::is_same_v<T_BaseRecord, typename Other::T_BaseRecord>>>
133 : m_baseRecordData(other.m_baseRecordData)
135 other.m_scalarTuple.has_value()
140 other.m_scalarTuple.value().second)))
141 : ScalarTuple(
std::nullopt))
144 auxiliary::overloaded{
145 [](typename Other::Left const &left) {
148 return std::variant<Left, Right>(left);
150 [](
typename Other::Right
const &) {
151 return std::variant<Left, Right>(Right());
158 T_Value *operator->();
160 T_Value &operator*();
180 :
public Container<T_elem>
184 using T_RecordComponent = T_elem;
185 using T_Container = Container<T_elem>;
188 using T_Self = BaseRecord<T_elem>;
189 friend class Iteration;
190 friend class ParticleSpecies;
191 friend class PatchRecord;
194 template <
typename,
typename>
196 template <
typename,
typename,
typename>
198 template <
typename T>
199 friend T &internal::makeOwning(
T &self, Series);
203 std::shared_ptr<Data_t> m_baseRecordData;
206 traits::GenerationPolicy<T_RecordComponent>::is_noop,
207 "Internal error: Scalar components cannot have generation policies.");
209 inline Data_t
const &get()
const
211 return *m_baseRecordData;
216 return *m_baseRecordData;
219 inline std::shared_ptr<Data_t> getShared()
221 return m_baseRecordData;
227 inline void setData(std::shared_ptr<Data_t> data)
229 m_baseRecordData = std::move(data);
230 T_Container::setData(m_baseRecordData);
231 T_RecordComponent::setData(m_baseRecordData);
235 using key_type =
typename Container<T_elem>::key_type;
236 using mapped_type =
typename Container<T_elem>::mapped_type;
237 using value_type =
typename Container<T_elem>::value_type;
238 using size_type =
typename Container<T_elem>::size_type;
239 using difference_type =
typename Container<T_elem>::difference_type;
240 using allocator_type =
typename Container<T_elem>::allocator_type;
241 using reference =
typename Container<T_elem>::reference;
242 using const_reference =
typename Container<T_elem>::const_reference;
243 using pointer =
typename Container<T_elem>::pointer;
244 using const_pointer =
typename Container<T_elem>::const_pointer;
249 typename T_Container::InternalContainer::iterator>;
253 typename T_Container::InternalContainer::const_iterator>;
257 typename T_Container::InternalContainer::reverse_iterator>;
261 typename T_Container::InternalContainer::const_reverse_iterator>;
264 template <
typename... Arg>
265 iterator makeIterator(Arg &&...arg)
267 return iterator{
this, std::forward<Arg>(arg)...};
269 template <
typename... Arg>
270 const_iterator makeIterator(Arg &&...arg)
const
272 return const_iterator{
this, std::forward<Arg>(arg)...};
274 template <
typename... Arg>
275 reverse_iterator makeReverseIterator(Arg &&...arg)
277 return reverse_iterator{
this, std::forward<Arg>(arg)...};
279 template <
typename... Arg>
280 const_reverse_iterator makeReverseIterator(Arg &&...arg)
const
282 return const_reverse_iterator{
this, std::forward<Arg>(arg)...};
287 const_iterator begin()
const;
288 const_iterator cbegin()
const;
290 const_iterator end()
const;
291 const_iterator cend()
const;
292 reverse_iterator rbegin();
293 const_reverse_iterator rbegin()
const;
294 const_reverse_iterator crbegin()
const;
295 reverse_iterator rend();
296 const_reverse_iterator rend()
const;
297 const_reverse_iterator crend()
const;
299 virtual ~BaseRecord();
301 mapped_type &operator[](key_type
const &key);
302 mapped_type &operator[](key_type &&key);
303 mapped_type &at(key_type
const &key);
304 mapped_type
const &at(key_type
const &key)
const;
305 size_type erase(key_type
const &key);
306 iterator erase(iterator res);
307 bool empty()
const noexcept;
308 iterator find(key_type
const &key);
309 const_iterator find(key_type
const &key)
const;
310 size_type count(key_type
const &key)
const;
311 size_type size()
const;
313 std::pair<iterator, bool> insert(value_type
const &value);
314 std::pair<iterator, bool> insert(value_type &&value);
315 iterator insert(const_iterator hint, value_type
const &value);
316 iterator insert(const_iterator hint, value_type &&value);
317 template <
class InputIt>
318 void insert(InputIt first, InputIt last);
319 void insert(std::initializer_list<value_type> ilist);
320 void swap(BaseRecord &other)
noexcept;
321 bool contains(key_type
const &key)
const;
322 template <
class... Args>
323 auto emplace(Args &&...args) -> std::pair<iterator, bool>;
348 void setDatasetDefined(BaseRecordComponent::Data_t &data)
override
350 if (!T_Container::empty())
353 "A scalar component can not be contained at the same time as "
354 "one or more regular components.");
356 T_RecordComponent::setDatasetDefined(data);