Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit 4f71806d authored by Sylvain Thery's avatar Sylvain Thery
Browse files

attribute handler type checking

parent 193a7dae
...@@ -77,7 +77,10 @@ typename ATT::DATA_TYPE smooth(MAP& map, Vertex v, const ATT& attributs) ...@@ -77,7 +77,10 @@ typename ATT::DATA_TYPE smooth(MAP& map, Vertex v, const ATT& attributs)
template <typename MAP, typename ATT> template <typename MAP, typename ATT>
void applySmooth(MAP& map, const ATT& att_in, ATT& att_out) void applySmooth(MAP& map, const ATT& att_in, ATT& att_out)
{ {
foreach_cell<VERTEX>(map,[&](Vertex v) // for all edge e of map do // check at compile if ATT is an AttributeHandler on orbit VERTEX
CHECK_ATTRIBUTEHANDER_ORBIT_TYPE(ATT,VERTEX);
foreach_cell<VERTEX>(map,[&](Vertex v) // for all vertex v of map do
{ {
att_out[v] = smooth(map,v,att_in); att_out[v] = smooth(map,v,att_in);
}); });
......
...@@ -112,6 +112,8 @@ void computeNewPositions(MAP& map, VertexAttribute<VEC3, MAP>& pos) ...@@ -112,6 +112,8 @@ void computeNewPositions(MAP& map, VertexAttribute<VEC3, MAP>& pos)
template<typename ATTRIB> template<typename ATTRIB>
void dumpAttribute(const ATTRIB& attr) void dumpAttribute(const ATTRIB& attr)
{ {
CHECK_ATTRIBUTEHANDER__TYPE(ATTRIB);
std::cout << "Attribute " <<attr.name() << " of orbit "<< orbitName(attr.getOrbit())<< " of type "<< attr.typeName()<< std::endl; std::cout << "Attribute " <<attr.name() << " of orbit "<< orbitName(attr.getOrbit())<< " of type "<< attr.typeName()<< std::endl;
// NEVER USE 0 AND ++ IN FOR LOOP ON ATTRIBUTE ! // NEVER USE 0 AND ++ IN FOR LOOP ON ATTRIBUTE !
......
...@@ -33,6 +33,14 @@ ...@@ -33,6 +33,14 @@
#include "Container/fakeAttribute.h" #include "Container/fakeAttribute.h"
#include "Topology/generic/cells.h" #include "Topology/generic/cells.h"
/// Macro that check if ATTRIBUTEHANDLER type is an AttributeHandler of orbit ORBITVALUE
#define CHECK_ATTRIBUTEHANDER_ORBIT_TYPE(ATTRIBUTEHANDLER, ORBITVALUE) \
static_assert(std::is_base_of<AttributeHandlerGen,ATTRIBUTEHANDLER>::value, "Error not AttributeHandler");\
static_assert(ATTRIBUTEHANDLER::ORBIT==ORBITVALUE,"Error wrong orbit of AttributeHandler");
#define CHECK_ATTRIBUTEHANDER__TYPE(ATTRIBUTEHANDLER) \
static_assert(std::is_base_of<AttributeHandlerGen,ATTRIBUTEHANDLER>::value, "Error not AttributeHandler");
namespace CGoGN namespace CGoGN
{ {
...@@ -78,7 +86,7 @@ protected: ...@@ -78,7 +86,7 @@ protected:
* - [ dart ] * - [ dart ]
* - begin / end / next to manage indexing * - begin / end / next to manage indexing
*/ */
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
class AttributeHandler : public AttributeHandlerGen class AttributeHandler : public AttributeHandlerGen
{ {
protected: protected:
...@@ -92,6 +100,7 @@ protected: ...@@ -92,6 +100,7 @@ protected:
public: public:
typedef T DATA_TYPE ; typedef T DATA_TYPE ;
static const unsigned int ORBIT = ORB;
/** /**
* Default constructor * Default constructor
...@@ -110,7 +119,7 @@ public: ...@@ -110,7 +119,7 @@ public:
* Copy constructor * Copy constructor
* @param ta the table attribute * @param ta the table attribute
*/ */
AttributeHandler(const AttributeHandler<T, ORBIT, MAP>& ta) ; AttributeHandler(const AttributeHandler<T, ORB, MAP>& ta) ;
/** /**
* Transmute Constructor * Transmute Constructor
...@@ -124,14 +133,14 @@ public: ...@@ -124,14 +133,14 @@ public:
* affectation operator * affectation operator
* @param ta the table attribute to affect to this * @param ta the table attribute to affect to this
*/ */
AttributeHandler<T, ORBIT, MAP>& operator=(const AttributeHandler<T, ORBIT, MAP>& ta) ; AttributeHandler<T, ORB, MAP>& operator=(const AttributeHandler<T, ORB, MAP>& ta) ;
/** /**
* transmuted affectation operator * transmuted affectation operator
* @param ta the table attribute to affect to this * @param ta the table attribute to affect to this
*/ */
template <unsigned int ORBIT2> template <unsigned int ORBIT2>
AttributeHandler<T, ORBIT, MAP>& operator=(const AttributeHandler<T, ORBIT2, MAP>& ta) ; AttributeHandler<T, ORB, MAP>& operator=(const AttributeHandler<T, ORBIT2, MAP>& ta) ;
/** /**
* Destructor (empty & virtual) * Destructor (empty & virtual)
...@@ -190,12 +199,12 @@ public: ...@@ -190,12 +199,12 @@ public:
/** /**
* [] operator with cell parameter * [] operator with cell parameter
*/ */
T& operator[](Cell<ORBIT> c) ; T& operator[](Cell<ORB> c) ;
/** /**
* const [] operator with cell parameter * const [] operator with cell parameter
*/ */
const T& operator[](Cell<ORBIT> c) const ; const T& operator[](Cell<ORB> c) const ;
/** /**
* at operator (same as [] but with index parameter) * at operator (same as [] but with index parameter)
...@@ -241,75 +250,39 @@ public: ...@@ -241,75 +250,39 @@ public:
void next(unsigned int& iter) const; void next(unsigned int& iter) const;
} ; } ;
/** /**
* shortcut class for Dart Attribute (Handler) * c++11 shortcut for Dart Attribute (Handler)
*/ */
template <typename T, typename MAP> template <typename T, typename MAP>
class DartAttribute : public AttributeHandler<T, DART, MAP> using DartAttribute = AttributeHandler<T, DART, MAP>;
{
public:
DartAttribute() : AttributeHandler<T, DART, MAP>() {}
DartAttribute(const AttributeHandler<T, DART, MAP>& ah) : AttributeHandler<T, DART, MAP>(ah) {}
DartAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, DART, MAP>(m,amv) {}
DartAttribute<T, MAP>& operator=(const AttributeHandler<T, DART, MAP>& ah) { this->AttributeHandler<T, DART, MAP>::operator=(ah); return *this; }
};
/** /**
* shortcut class for Vertex Attribute (Handler) * c++11 shortcut for Vertex Attribute (Handler)
*/ */
template <typename T, typename MAP> template <typename T, typename MAP>
class VertexAttribute : public AttributeHandler<T, VERTEX, MAP> using VertexAttribute = AttributeHandler<T, VERTEX, MAP>;
{
public:
VertexAttribute() : AttributeHandler<T, VERTEX, MAP>() {}
VertexAttribute(const AttributeHandler<T, VERTEX, MAP>& ah) : AttributeHandler<T, VERTEX, MAP>(ah) {}
VertexAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, VERTEX, MAP>(m,amv) {}
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T, VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, EDGE, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, FACE, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, VOLUME, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
};
/** /**
* shortcut class for Edge Attribute (Handler) * c++11 shortcut for Edge Attribute (Handler)
*/ */
template <typename T, typename MAP> template <typename T, typename MAP>
class EdgeAttribute : public AttributeHandler<T, EDGE, MAP> using EdgeAttribute = AttributeHandler<T, EDGE, MAP>;
{
public:
EdgeAttribute() : AttributeHandler<T, EDGE, MAP>() {}
EdgeAttribute(const AttributeHandler<T, EDGE, MAP>& ah) : AttributeHandler<T, EDGE, MAP>(ah) {}
EdgeAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, EDGE, MAP>(m,amv) {}
EdgeAttribute<T, MAP>& operator=(const AttributeHandler<T, EDGE, MAP>& ah) { this->AttributeHandler<T, EDGE, MAP>::operator=(ah); return *this; }
};
/** /**
* shortcut class for Face Attribute (Handler) * c++11 shortcut for Face Attribute (Handler)
*/ */
template <typename T, typename MAP> template <typename T, typename MAP>
class FaceAttribute : public AttributeHandler<T, FACE, MAP> using FaceAttribute = AttributeHandler<T, FACE, MAP>;
{
public:
FaceAttribute() : AttributeHandler<T, FACE, MAP>() {}
FaceAttribute(const AttributeHandler<T, FACE, MAP>& ah) : AttributeHandler<T, FACE, MAP>(ah) {}
FaceAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, FACE, MAP>(m,amv) {}
FaceAttribute<T, MAP>& operator=(const AttributeHandler<T, FACE, MAP>& ah) { this->AttributeHandler<T, FACE, MAP>::operator=(ah); return *this; }
FaceAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T,FACE, MAP>::operator=(ah); return *this; }
};
/** /**
* shortcut class for Volume Attribute (Handler) * c++11 shortcut for Volume Attribute (Handler)
*/ */
template <typename T, typename MAP> template <typename T, typename MAP>
class VolumeAttribute : public AttributeHandler<T, VOLUME, MAP> using VolumeAttribute = AttributeHandler<T, VOLUME, MAP>;
{
public:
VolumeAttribute() : AttributeHandler<T, VOLUME, MAP>() {}
VolumeAttribute(const AttributeHandler<T, VOLUME, MAP>& ah) : AttributeHandler<T, VOLUME, MAP>(ah) {}
VolumeAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, VOLUME, MAP>(m,amv) {}
VolumeAttribute<T, MAP>& operator=(const AttributeHandler<T, VOLUME, MAP>& ah) { this->AttributeHandler<T, VOLUME, MAP>::operator=(ah); return *this; }
VolumeAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T, VOLUME, MAP>::operator=(ah); return *this; }
};
// turn_to<b>(A*</b> obj) changes class of the object // turn_to<b>(A*</b> obj) changes class of the object
......
</
...@@ -29,15 +29,15 @@ ...@@ -29,15 +29,15 @@
namespace CGoGN namespace CGoGN
{ {
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::registerInMap() inline void AttributeHandler<T, ORB, MAP>::registerInMap()
{ {
std::lock_guard<std::mutex> lockAH(m_map->attributeHandlersMutex); std::lock_guard<std::mutex> lockAH(m_map->attributeHandlersMutex);
m_map->attributeHandlers.insert(std::pair<AttributeMultiVectorGen*, AttributeHandlerGen*>(m_attrib, this)) ; m_map->attributeHandlers.insert(std::pair<AttributeMultiVectorGen*, AttributeHandlerGen*>(m_attrib, this)) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::unregisterFromMap() inline void AttributeHandler<T, ORB, MAP>::unregisterFromMap()
{ {
typedef std::multimap<AttributeMultiVectorGen*, AttributeHandlerGen*>::iterator IT ; typedef std::multimap<AttributeMultiVectorGen*, AttributeHandlerGen*>::iterator IT ;
...@@ -56,22 +56,22 @@ inline void AttributeHandler<T, ORBIT, MAP>::unregisterFromMap() ...@@ -56,22 +56,22 @@ inline void AttributeHandler<T, ORBIT, MAP>::unregisterFromMap()
// ================================================================= // =================================================================
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler() : AttributeHandler<T, ORB, MAP>::AttributeHandler() :
AttributeHandlerGen(false), AttributeHandlerGen(false),
m_map(NULL), m_map(NULL),
m_attrib(NULL) m_attrib(NULL)
{} {}
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, ORB, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T>* amv) :
AttributeHandlerGen(false), AttributeHandlerGen(false),
m_map(m), m_map(m),
m_attrib(amv) m_attrib(amv)
{ {
if(m != NULL && amv != NULL && amv->getIndex() != AttributeContainer::UNKNOWN) if(m != NULL && amv != NULL && amv->getIndex() != AttributeContainer::UNKNOWN)
{ {
assert(ORBIT == amv->getOrbit() || !"AttributeHandler: orbit incompatibility") ; assert(ORB == amv->getOrbit() || !"AttributeHandler: orbit incompatibility") ;
valid = true ; valid = true ;
registerInMap() ; registerInMap() ;
} }
...@@ -79,8 +79,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T ...@@ -79,8 +79,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T
valid = false ; valid = false ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT, MAP>& ta) : AttributeHandler<T, ORB, MAP>::AttributeHandler(const AttributeHandler<T, ORB, MAP>& ta) :
AttributeHandlerGen(ta.valid), AttributeHandlerGen(ta.valid),
m_map(ta.m_map), m_map(ta.m_map),
m_attrib(ta.m_attrib) m_attrib(ta.m_attrib)
...@@ -89,9 +89,9 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI ...@@ -89,9 +89,9 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI
registerInMap() ; registerInMap() ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
template <unsigned int ORBIT2> template <unsigned int ORBIT2>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT2, MAP>& h) : AttributeHandler<T, ORB, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT2, MAP>& h) :
AttributeHandlerGen(h.valid), AttributeHandlerGen(h.valid),
m_map(h.m_map), m_map(h.m_map),
m_attrib(h.m_attrib) m_attrib(h.m_attrib)
...@@ -105,8 +105,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI ...@@ -105,8 +105,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI
valid = false; valid = false;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operator=(const AttributeHandler<T, ORBIT, MAP>& ta) inline AttributeHandler<T, ORB, MAP>& AttributeHandler<T, ORB, MAP>::operator=(const AttributeHandler<T, ORB, MAP>& ta)
{ {
if(valid) if(valid)
unregisterFromMap() ; unregisterFromMap() ;
...@@ -118,9 +118,9 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato ...@@ -118,9 +118,9 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato
return *this ; return *this ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
template <unsigned int ORBIT2> template <unsigned int ORBIT2>
inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operator=(const AttributeHandler<T, ORBIT2, MAP>& ta) inline AttributeHandler<T, ORB, MAP>& AttributeHandler<T, ORB, MAP>::operator=(const AttributeHandler<T, ORBIT2, MAP>& ta)
{ {
if(valid) if(valid)
unregisterFromMap() ; unregisterFromMap() ;
...@@ -132,64 +132,64 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato ...@@ -132,64 +132,64 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato
return *this ; return *this ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORBIT, MAP>::~AttributeHandler() AttributeHandler<T, ORB, MAP>::~AttributeHandler()
{ {
if(valid) if(valid)
unregisterFromMap() ; unregisterFromMap() ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline AttributeMultiVector<T>* AttributeHandler<T, ORBIT, MAP>::getDataVector() const inline AttributeMultiVector<T>* AttributeHandler<T, ORB, MAP>::getDataVector() const
{ {
return m_attrib ; return m_attrib ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline AttributeMultiVectorGen* AttributeHandler<T, ORBIT, MAP>::getDataVectorGen() const inline AttributeMultiVectorGen* AttributeHandler<T, ORB, MAP>::getDataVectorGen() const
{ {
return m_attrib ; return m_attrib ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline int AttributeHandler<T, ORBIT, MAP>::getSizeOfType() const inline int AttributeHandler<T, ORB, MAP>::getSizeOfType() const
{ {
return sizeof(T) ; return sizeof(T) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::getOrbit() const inline unsigned int AttributeHandler<T, ORB, MAP>::getOrbit() const
{ {
return ORBIT ; return ORB ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::getIndex() const inline unsigned int AttributeHandler<T, ORB, MAP>::getIndex() const
{ {
return m_attrib->getIndex() ; return m_attrib->getIndex() ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline const std::string& AttributeHandler<T, ORBIT, MAP>::name() const inline const std::string& AttributeHandler<T, ORB, MAP>::name() const
{ {
return m_attrib->getName() ; return m_attrib->getName() ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline const std::string& AttributeHandler<T, ORBIT, MAP>::typeName() const inline const std::string& AttributeHandler<T, ORB, MAP>::typeName() const
{ {
return m_attrib->getTypeName(); return m_attrib->getTypeName();
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::nbElements() const inline unsigned int AttributeHandler<T, ORB, MAP>::nbElements() const
{ {
return m_map->template getAttributeContainer<ORBIT>().size() ; return m_map->template getAttributeContainer<ORB>().size() ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c) inline T& AttributeHandler<T, ORB, MAP>::operator[](Cell<ORB> c)
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(c) ; unsigned int a = m_map->getEmbedding(c) ;
...@@ -200,71 +200,71 @@ inline T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c) ...@@ -200,71 +200,71 @@ inline T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c)
return m_attrib->operator[](a) ; return m_attrib->operator[](a) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline const T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c) const inline const T& AttributeHandler<T, ORB, MAP>::operator[](Cell<ORB> c) const
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(c) ; unsigned int a = m_map->getEmbedding(c) ;
return m_attrib->operator[](a) ; return m_attrib->operator[](a) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline T& AttributeHandler<T, ORBIT, MAP>::operator[](unsigned int a) inline T& AttributeHandler<T, ORB, MAP>::operator[](unsigned int a)
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
return m_attrib->operator[](a) ; return m_attrib->operator[](a) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline const T& AttributeHandler<T, ORBIT, MAP>::operator[](unsigned int a) const inline const T& AttributeHandler<T, ORB, MAP>::operator[](unsigned int a) const
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
return m_attrib->operator[](a) ; return m_attrib->operator[](a) ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::insert(const T& elt) inline unsigned int AttributeHandler<T, ORB, MAP>::insert(const T& elt)
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->template getAttributeContainer<ORBIT>().insertLine() ; unsigned int idx = m_map->template getAttributeContainer<ORB>().insertLine() ;
m_attrib->operator[](idx) = elt ; m_attrib->operator[](idx) = elt ;
return idx ; return idx ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::newElt() inline unsigned int AttributeHandler<T, ORB, MAP>::newElt()
{ {
assert(valid || !"Invalid AttributeHandler") ; assert(valid || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->template getAttributeContainer<ORBIT>().insertLine() ; unsigned int idx = m_map->template getAttributeContainer<ORB>().insertLine() ;
return idx ; return idx ;
} }
template <typename T, unsigned int ORBIT, typename MAP> template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::setAllValues(const T& v) inline void AttributeHandler<T, ORB, MAP>::setAllValues(const T& v)
{ {
for(unsigned int i = begin(); i != end(); next(i)) for(unsigned int i = begin(); i != end(); next(i))