Commit a0f327b6 authored by Sylvain Thery's avatar Sylvain Thery

add nbElements function to all attribute handlers

parent c2deab7f
......@@ -135,6 +135,11 @@ public:
*/
const std::string& name() const ;
/**
* give the number of elements of the attribute container
*/
unsigned int nbElements() const;
/**
* [] operator with dart parameter
*/
......
......@@ -54,6 +54,7 @@ AttributeHandler<T, ORBIT>::AttributeHandler() :
AttributeHandlerGen(NULL, false), m_attrib(NULL)
{}
template <typename T, unsigned int ORBIT>
AttributeHandler<T, ORBIT>::AttributeHandler(GenericMap* m, AttributeMultiVector<T>* amv) :
AttributeHandlerGen(m, false), m_attrib(amv)
......@@ -120,6 +121,13 @@ inline const std::string& AttributeHandler<T, ORBIT>::name() const
return m_attrib->getName() ;
}
template <typename T, unsigned int ORBIT>
inline unsigned int AttributeHandler<T, ORBIT>::nbElements() const
{
return m_map->getAttributeContainer<ORBIT>().size() ;
}
template <typename T, unsigned int ORBIT>
inline T& AttributeHandler<T, ORBIT>::operator[](Dart d)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment