|
CuteHMI - Modbus (CuteHMI.Modbus.2)
|
1 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_DATACONTAINER_HPP
2 #define H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_DATACONTAINER_HPP
7 #include <QReadWriteLock>
20 template <
typename T, std::
size_t N = 65536>
79 const T *
at(
std::
size_t i) const;
90 T *
at(
std::
size_t i);
151 template <typename T,
std::
size_t N>
153 m_lock(& container->
lock()),
154 m_it(container->
keys())
158 template <
typename T, std::
size_t N>
163 return m_it.hasNext();
166 template <
typename T, std::
size_t N>
174 template <
typename T, std::
size_t N>
179 return m_it.previous();
182 template <
typename T, std::
size_t N>
189 template <
typename T, std::
size_t N>
195 return m_array.size();
199 template <
typename T, std::
size_t N>
204 return m_array.at(i);
207 template <
typename T, std::
size_t N>
212 return m_array.at(i);
215 template <
typename T, std::
size_t N>
223 result = m_array.at(i);
226 if (result ==
nullptr) {
230 result = m_array.at(i);
232 if (result ==
nullptr) {
242 template <
typename T, std::
size_t N>
251 template <
typename T, std::
size_t N>
258 std::fill(m_array.begin(), m_array.end(),
nullptr);
261 template <
typename T, std::
size_t N>
267 delete m_array.at(*it);
271 std::fill(m_array.begin(), m_array.end(),
nullptr);
274 template <
typename T, std::
size_t N>
280 template <
typename T, std::
size_t N>
QReadWriteLock & lock() const
Definition: DataContainer.hpp:281
bool hasNext() const
Definition: DataContainer.hpp:159
constexpr std::size_t size() const noexcept
Get container size.
Definition: DataContainer.hpp:190
const typedef T * const_pointer
Definition: DataContainer.hpp:31
KeysContainer::value_type previous()
Definition: DataContainer.hpp:175
void free()
Delete container contents.
Definition: DataContainer.hpp:262
KeysIterator(const DataContainer< T, N > *container)
Definition: DataContainer.hpp:152
KeysContainer::value_type next()
Definition: DataContainer.hpp:167
QLinkedList< std::size_t > KeysContainer
Definition: DataContainer.hpp:35
DataContainer()
Definition: DataContainer.hpp:184
Keys iterator.
Definition: DataContainer.hpp:44
const typedef T & const_reference
Definition: DataContainer.hpp:29
void clear()
Clear container.
Definition: DataContainer.hpp:252
static constexpr std::size_t ADDRESS_SPACE
Definition: DataContainer.hpp:38
void insert(std::size_t i, T *value)
Insert value.
Definition: DataContainer.hpp:243
T value_type
Definition: DataContainer.hpp:27
const T * at(std::size_t i) const
Get value at given index.
Definition: DataContainer.hpp:200
const KeysContainer & keys() const
Get keys container.
Definition: DataContainer.hpp:275
Data container.
Definition: DataContainer.hpp:21
T * pointer
Definition: DataContainer.hpp:30
T * value(std::size_t i)
Get value at given index.
Definition: DataContainer.hpp:216
T & reference
Definition: DataContainer.hpp:28