Selaa lähdekoodia

* removed STL container array from XMLSerializer to compile on g++ 4.2

Former-commit-id: 301095a7daf2fa597e2becf4c401dc7840b96f20
schuellc 12 vuotta sitten
vanhempi
commit
d4ede550ff
4 muutettua tiedostoa jossa 172 lisäystä ja 163 poistoa
  1. 16 7
      Makefile.conf
  2. 1 1
      include/igl/xml/Makefile
  3. 17 17
      include/igl/xml/XMLSerializer.cpp
  4. 138 138
      include/igl/xml/XMLSerializer.h

+ 16 - 7
Makefile.conf

@@ -78,19 +78,28 @@ ifeq ($(IGL_USERNAME),chrsch)
   ifeq ($(UNAME), Linux)
     DEFAULT_PREFIX=/usr
     IGL_WITH_XML=1
-	IGL_WITH_TETGEN=0
+    IGL_WITH_TETGEN=0
     IGL_WITH_MATLAB=0
-	IGL_WITH_PNG=0
-	IGL_WITH_MOSEK=0
-	#MOSEKPLATFORM=linux64x86
+    IGL_WITH_PNG=0
+    IGL_WITH_MOSEK=0
+    #MOSEKPLATFORM=linux64x86
     OPENGL_LIB=-lGL -lGLU
     GLUT_LIB=-lglut
     ANTTWEAKBAR_LIB=-lAntTweakBar
     OPENMP=-fopenmp
-	AFLAGS = -Wfatal-errors
+    AFLAGS = -Wfatal-errors
   else
-	IGL_WITH_MATLAB=0
-	AFLAGS = -m64
+    IGL_WITH_XML=1
+    IGL_WITH_TETGEN=0
+    IGL_WITH_MATLAB=0
+    IGL_WITH_PNG=0
+    IGL_WITH_MOSEK=0
+    OPENGL_INC=-I$(DEFAULT_PREFIX)/include
+    OPENGL_LIB=-lGL -lGLU
+    #GLUT_LIB=-lglut
+    ANTTWEAKBAR_LIB=-lAntTweakBar
+    OPENMP=-fopenmp
+    AFLAGS = -m64
   endif
 endif
 

+ 1 - 1
include/igl/xml/Makefile

@@ -37,7 +37,7 @@ INC+=$(TINYXML2_INC) $(ANTTWEAKBAR_INC)
 ANTTWEAKBAR_INC=-I../../../external/AntTweakBar/include
 INC+=$(ANTTWEAKBAR_INC)
 
-CFLAGS+=-std=c++11
+#CFLAGS+=-std=c++11
 
 obj: 
 	mkdir -p obj

+ 17 - 17
include/igl/xml/XMLSerializer.cpp

@@ -263,12 +263,12 @@ void igl::XMLSerializableObject::Init(T*& obj)
   object->Init();  
 }
 
-template<typename T, int S>
+/*template<typename T, int S>
 void igl::XMLSerializableObject::Init(std::array<T,S>& obj)
 {
   for(unsigned int i=0;i<obj.size();i++)
     Init(obj[i]);  
-}
+}*/
 
 template<typename T0, typename T1>
 void igl::XMLSerializableObject::Init(std::pair<T0,T1>& obj)
@@ -484,7 +484,7 @@ bool igl::XMLSerializableObject::Deserialize(T*& obj, tinyxml2::XMLDocument* doc
   return true;
 }
 
-template<typename T, size_t S>
+/*template<typename T, size_t S>
 bool igl::XMLSerializableObject::Serialize(std::array<T,S>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name)
 {
   tinyxml2::XMLElement* ar = doc->NewElement(name.c_str());
@@ -541,7 +541,7 @@ bool igl::XMLSerializableObject::Deserialize(std::array<T,S>*& obj, tinyxml2::XM
 {
   obj = new std::array<T,S>();
   return Deserialize(*obj,doc,element,name);
-}
+}*/
 
 template<typename T0, typename T1>
 bool igl::XMLSerializableObject::Serialize(std::pair<T0,T1>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name)
@@ -817,7 +817,7 @@ bool igl::XMLSerializableObject::Deserialize(Eigen::SparseMatrix<T>& obj, tinyxm
     std::stringstream mats;
     mats.str(matTemp);
 
-    std::vector<Eigen::Triplet<T>> triplets;
+    std::vector<Eigen::Triplet<T> > triplets;
     int r=0;
     std::string val;
 
@@ -1384,11 +1384,11 @@ bool igl::XMLSerializer::Add(double& obj, const std::string& name)
   return add(obj,name);
 }
 
-template<typename T, size_t S>
+/*template<typename T, size_t S>
 bool igl::XMLSerializer::Add(std::array<T,S>& obj, const std::string& name)
 {
   return add(obj,name);
-}
+}*/
 
 template<typename T0, typename T1>
 bool igl::XMLSerializer::Add(std::pair<T0,T1>& obj, const std::string& name)
@@ -1567,7 +1567,7 @@ bool igl::XMLSerializerTest::Test()
   float testFloat0 = 0.00001f;
   double testDouble0 = 0.01000000005;
 
-  std::array<float,2> testArray0 = {{0.001f,1.001f}};
+  //std::array<float,2> testArray0 = {{0.001f,1.001f}};
 
   std::pair<int,bool> testPair0;
   testPair0.first = 5;
@@ -1582,7 +1582,7 @@ bool igl::XMLSerializerTest::Test()
   testDenseMatrix0 = Eigen::Matrix3i::Identity();
 
   Eigen::SparseMatrix<double> testSparseMatrix0(3,3);
-  std::vector<Eigen::Triplet<double>> triplets;
+  std::vector<Eigen::Triplet<double> > triplets;
   triplets.push_back(Eigen::Triplet<double>(0,0,1));
   triplets.push_back(Eigen::Triplet<double>(1,1,2));
   triplets.push_back(Eigen::Triplet<double>(2,2,3));
@@ -1608,7 +1608,7 @@ bool igl::XMLSerializerTest::Test()
   float testFloat1 = -0.00001f;
   double testDouble1 = -0.000000000001;
 
-  std::array<float,2> testArray1 = {{-0.001f,-1.001f}};
+  //std::array<float,2> testArray1 = {{-0.001f,-1.001f}};
 
   std::pair<int,bool> testPair1;
   testPair1.first = -5;
@@ -1670,7 +1670,7 @@ bool igl::XMLSerializerTest::Test()
   testResult &= igl::XMLSerializer::SaveObject(testInt0,"testInt","test0","test.xml",false);
   testResult &= igl::XMLSerializer::SaveObject(testFloat0,"testFloat","test0","test.xml",false);
   testResult &= igl::XMLSerializer::SaveObject(testDouble0,"testDouble","test0","test.xml",false);
-  testResult &= igl::XMLSerializer::SaveObject(testArray0,"testArray","test1","test.xml",false);
+  //testResult &= igl::XMLSerializer::SaveObject(testArray0,"testArray","test1","test.xml",false);
   testResult &= igl::XMLSerializer::SaveObject(testPair0,"testPair","test1","test.xml",false);
   testResult &= igl::XMLSerializer::SaveObject(testVector0,"testVector","test1","test.xml",false);
   testResult &= igl::XMLSerializer::SaveObject(testDenseMatrix0,"testDense","test1","test.xml",false);
@@ -1687,7 +1687,7 @@ bool igl::XMLSerializerTest::Test()
   testResult &= igl::XMLSerializer::LoadObject(testInt1,"testInt","test0","test.xml");
   testResult &= igl::XMLSerializer::LoadObject(testFloat1,"testFloat","test0","test.xml");
   testResult &= igl::XMLSerializer::LoadObject(testDouble1,"testDouble","test0","test.xml");
-  testResult &= igl::XMLSerializer::LoadObject(testArray1,"testArray","test1","test.xml");
+  //testResult &= igl::XMLSerializer::LoadObject(testArray1,"testArray","test1","test.xml");
   testResult &= igl::XMLSerializer::LoadObject(testPair1,"testPair","test1","test.xml");
   testResult &= igl::XMLSerializer::LoadObject(testVector1,"testVector","test1","test.xml");
   testResult &= igl::XMLSerializer::LoadObject(testDenseMatrix1,"testDense","test1","test.xml");
@@ -1704,8 +1704,8 @@ bool igl::XMLSerializerTest::Test()
   testResult &= testInt0 == testInt1;
   testResult &= testFloat0 == testFloat1;
   testResult &= testDouble0 == testDouble1;
-  for(unsigned int i=0;i<testArray0.size();i++)
-    testResult &= testArray0[i] == testArray1[i];
+  /*for(unsigned int i=0;i<testArray0.size();i++)
+    testResult &= testArray0[i] == testArray1[i];*/
   testResult &= testPair0.first == testPair1.first;
   testResult &= testPair0.second == testPair1.second;
   testResult &= testVector0.size() == testVector1.size();
@@ -1748,7 +1748,7 @@ bool igl::XMLSerializerTest::Test()
 
   s->SetCurrentGroup("test1");
 
-  testResult &= s->Add(testArray0,"testArray");
+  //testResult &= s->Add(testArray0,"testArray");
   testResult &= s->Add(testPair0,"testPair");
   testResult &= s->Add(testVector0,"testVector");
   testResult &= s->Add(testDenseMatrix0,"testDenseMatrix");
@@ -1796,8 +1796,8 @@ bool igl::XMLSerializerTest::Test()
   testResult &= testInt0 == testInt1;
   testResult &= testFloat0 == testFloat1;
   testResult &= testDouble0 == testDouble1;
-  for(unsigned int i=0;i<testArray0.size();i++)
-    testResult &= testArray0[i] == testArray1[i];
+  /*for(unsigned int i=0;i<testArray0.size();i++)
+    testResult &= testArray0[i] == testArray1[i];*/
   testResult &= testPair0.first == testPair1.first;
   testResult &= testPair0.second == testPair1.second;
   testResult &= testVector0.size() == testVector1.size();

+ 138 - 138
include/igl/xml/XMLSerializer.h

@@ -19,7 +19,7 @@ You can find examples how to use it in the test case class XMLSerializerTest.
 #define XML_SERIALIZER_H
 
 #include <iostream>
-#include <array>
+//#include <array>
 #include <vector>
 #include <map>
 
@@ -31,8 +31,8 @@ You can find examples how to use it in the test case class XMLSerializerTest.
 namespace igl
 {
 
-  void EncodeXMLElementName(std::string& name);
-  //void DecodeXMLElementName(std::string& name);
+  void EncodeXMLElementName(std::string& name);
+  //void DecodeXMLElementName(std::string& name);
   void ReplaceSubString(std::string& str, const std::string& search, const std::string& replace);
 
   // Forward declaration
@@ -99,65 +99,65 @@ namespace igl
      * class XMLSerializableObject
      * internal usage
      */
-  class XMLSerializableObject : public XMLSerializable
-  {
-  public:
-  
-    XMLSerializableObject(const std::string& name, const std::string& group);
-    virtual ~XMLSerializableObject();
-
-    // set attribute conversion functions
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, char& dest);  
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, char*& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, std::string& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, bool& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, unsigned int& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, int& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, float& dest);
-    void SetAttribute(tinyxml2::XMLElement* element, const char* name, double& dest);
-
-    // get attribute conversion functions
-    void GetAttribute(const char* src, char& dest);
-    void GetAttribute(const char* src, char*& dest);
-    void GetAttribute(const char* src, std::string& dest);
-    void GetAttribute(const char* src, bool& dest);
-    void GetAttribute(const char* src, unsigned int& dest);
-    void GetAttribute(const char* src, int& dest);
-    void GetAttribute(const char* src, float& dest);
-    void GetAttribute(const char* src, double& dest);
-
-    // Initialization
-
-    // Basic data types
+  class XMLSerializableObject : public XMLSerializable
+  {
+  public:
+  
+    XMLSerializableObject(const std::string& name, const std::string& group);
+    virtual ~XMLSerializableObject();
+
+    // set attribute conversion functions
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, char& dest);  
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, char*& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, std::string& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, bool& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, unsigned int& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, int& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, float& dest);
+    void SetAttribute(tinyxml2::XMLElement* element, const char* name, double& dest);
+
+    // get attribute conversion functions
+    void GetAttribute(const char* src, char& dest);
+    void GetAttribute(const char* src, char*& dest);
+    void GetAttribute(const char* src, std::string& dest);
+    void GetAttribute(const char* src, bool& dest);
+    void GetAttribute(const char* src, unsigned int& dest);
+    void GetAttribute(const char* src, int& dest);
+    void GetAttribute(const char* src, float& dest);
+    void GetAttribute(const char* src, double& dest);
+
+    // Initialization
+
+    // Basic data types
     void Init(char& val);
     void Init(char*& val);
-    void Init(std::string& val);
+    void Init(std::string& val);
     void Init(bool& val);
     void Init(unsigned int& val);
     void Init(int& val);
     void Init(float& val);
     void Init(double& val);
-
-    // XMLSerializable*
-    template<typename T>
-    void Init(T& obj);
-    template<typename T>
-    void Init(T*& obj);
-
-    // STL containers
-    template<typename T, int S>
-    void Init(std::array<T,S>& obj);
-    template<typename T0, typename T1>
-    void Init(std::pair<T0,T1>& obj);
-    template<typename T>
-    void Init(std::vector<T>& obj);
-    
-    // Eigen types
-    template<typename T, int R, int C>
-    void Init(Eigen::Matrix<T,R,C>& obj);
-    template<typename T>
-    void Init(Eigen::SparseMatrix<T>& obj);
-
+
+    // XMLSerializable*
+    template<typename T>
+    void Init(T& obj);
+    template<typename T>
+    void Init(T*& obj);
+
+    // STL containers
+    /*template<typename T, int S>
+    void Init(std::array<T,S>& obj);*/
+    template<typename T0, typename T1>
+    void Init(std::pair<T0,T1>& obj);
+    template<typename T>
+    void Init(std::vector<T>& obj);
+    
+    // Eigen types
+    template<typename T, int R, int C>
+    void Init(Eigen::Matrix<T,R,C>& obj);
+    template<typename T>
+    void Init(Eigen::SparseMatrix<T>& obj);
+
     // Serialization
 
     // Basic data types
@@ -174,44 +174,44 @@ namespace igl
     bool Serialize(float& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
     bool Serialize(float*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
     bool Serialize(double& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    bool Serialize(double*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    
-    // XMLSerializable*
-    template<typename T>
-    bool Serialize(T& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Serialize(T*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-
-    // STL containers
-    template<typename T, size_t S>
-    bool Serialize(std::array<T,S>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T, size_t S>
-    bool Serialize(std::array<T,S>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-   
-    template<typename T0, typename T1>
-    bool Serialize(std::pair<T0,T1>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T0, typename T1>
-    bool Serialize(std::pair<T0,T1>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    
-    template<typename T>
-    bool Serialize(std::vector<T>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Serialize(std::vector<T>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    
-    // Eigen types
-    template<typename T, int R, int C>
-    bool Serialize(Eigen::Matrix<T,R,C>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T, int R, int C>
-    bool Serialize(Eigen::Matrix<T,R,C>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    
-    template<typename T>
-    bool Serialize(Eigen::SparseMatrix<T>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Serialize(Eigen::SparseMatrix<T>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-
-    // Serialization
-
-    // Basic data types
+    bool Serialize(double*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    
+    // XMLSerializable*
+    template<typename T>
+    bool Serialize(T& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Serialize(T*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+
+    // STL containers
+    /*template<typename T, size_t S>
+    bool Serialize(std::array<T,S>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T, size_t S>
+    bool Serialize(std::array<T,S>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);*/
+   
+    template<typename T0, typename T1>
+    bool Serialize(std::pair<T0,T1>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T0, typename T1>
+    bool Serialize(std::pair<T0,T1>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    
+    template<typename T>
+    bool Serialize(std::vector<T>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Serialize(std::vector<T>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    
+    // Eigen types
+    template<typename T, int R, int C>
+    bool Serialize(Eigen::Matrix<T,R,C>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T, int R, int C>
+    bool Serialize(Eigen::Matrix<T,R,C>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    
+    template<typename T>
+    bool Serialize(Eigen::SparseMatrix<T>& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Serialize(Eigen::SparseMatrix<T>*& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+
+    // Serialization
+
+    // Basic data types
     bool Deserialize(char& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
     bool Deserialize(char*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
     bool Deserialize(std::string& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
@@ -226,46 +226,46 @@ namespace igl
     bool Deserialize(float*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
     bool Deserialize(double& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
     bool Deserialize(double*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-
-    // XMLSerializable*
-    template<typename T>
-    bool Deserialize(T& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Deserialize(T*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-
-    // STL containers
-    template<typename T, size_t S>
-    bool Deserialize(std::array<T,S>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T, size_t S>
-    bool Deserialize(std::array<T,S>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    
-    template<typename T0, typename T1>
-    bool Deserialize(std::pair<T0,T1>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T0, typename T1>
-    bool Deserialize(std::pair<T0,T1>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-
-    template<typename T>
-    bool Deserialize(std::vector<T>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Deserialize(std::vector<T>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    
-    // Eigen types
-    template<typename T, int R, int C>
-    bool Deserialize(Eigen::Matrix<T,R,C>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T, int R, int C>
-    bool Deserialize(Eigen::Matrix<T,R,C>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    
-    template<typename T>
-    bool Deserialize(Eigen::SparseMatrix<T>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool Deserialize(Eigen::SparseMatrix<T>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
-
-  private:
-
-    template<typename T>
-    bool setElementAttribute(T& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
-    template<typename T>
-    bool getElementAttribute(T& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+
+    // XMLSerializable*
+    template<typename T>
+    bool Deserialize(T& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Deserialize(T*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+
+    // STL containers
+    /*template<typename T, size_t S>
+    bool Deserialize(std::array<T,S>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T, size_t S>
+    bool Deserialize(std::array<T,S>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);*/
+    
+    template<typename T0, typename T1>
+    bool Deserialize(std::pair<T0,T1>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T0, typename T1>
+    bool Deserialize(std::pair<T0,T1>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+
+    template<typename T>
+    bool Deserialize(std::vector<T>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Deserialize(std::vector<T>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    
+    // Eigen types
+    template<typename T, int R, int C>
+    bool Deserialize(Eigen::Matrix<T,R,C>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T, int R, int C>
+    bool Deserialize(Eigen::Matrix<T,R,C>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    
+    template<typename T>
+    bool Deserialize(Eigen::SparseMatrix<T>& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool Deserialize(Eigen::SparseMatrix<T>*& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
+
+  private:
+
+    template<typename T>
+    bool setElementAttribute(T& obj, tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* element, const std::string& name);
+    template<typename T>
+    bool getElementAttribute(T& obj, tinyxml2::XMLDocument* doc, const tinyxml2::XMLElement* element, const std::string& name);
   };
 
   /**
@@ -281,7 +281,7 @@ namespace igl
     T DefaultValue;
 
     XMLSerializableInstance(T& obj, const std::string& name, const std::string group);
-    XMLSerializableInstance(T& obj, const std::string& name, const std::string group, T defaultValue);
+    XMLSerializableInstance(T& obj, const std::string& name, const std::string group, T defaultValue);
     ~XMLSerializableInstance();
 
     // XMLSerializable interface implementation
@@ -409,8 +409,8 @@ namespace igl
     bool Add(T& object, const std::string& name, T defaultValue);
 
     // STL containers
-    template<typename T, size_t S>
-    bool Add(std::array<T,S>& obj, const std::string& name);
+    /*template<typename T, size_t S>
+    bool Add(std::array<T,S>& obj, const std::string& name);*/
     template<typename T0, typename T1>
     bool Add(std::pair<T0,T1>& obj, const std::string& name);
     template<typename T>
@@ -455,8 +455,8 @@ namespace igl
   };
 }
 
-#ifdef IGL_HEADER_ONLY
-#include "XMLSerializer.cpp"
+#ifdef IGL_HEADER_ONLY
+#include "XMLSerializer.cpp"
 #endif
 
 #endif