Atoms Crowd  7.0.0
ArrayMetadata.impl.h
1 namespace AtomsCore
2 {
3  template<class T>
4  AtomsPtr<T> ArrayMetadata::getTypedElement(size_t index)
5  {
6  if ((index < m_value.size()) && m_value[index].get() && (m_value[index]->typeId() == T::staticTypeId()))
7  return std::static_pointer_cast<T>(m_value[index]);
8  else
9  return AtomsPtr<T>();
10  }
11 
12  template<class T>
13  AtomsPtr<const T> ArrayMetadata::getTypedElement(size_t index) const
14  {
15  if ((index < m_value.size()) && m_value[index].get() && (m_value[index]->typeId() == T::staticTypeId()))
16  return std::static_pointer_cast<const T>(m_value[index]);
17  else
18  return AtomsPtr<const T>();
19  }
20 }
AtomsPtr< T > getTypedElement(size_t index)
Get a typed element.
Definition: ArrayMetadata.impl.h:4
AtomsCore namespace.
Definition: Agent.h:344