// Copyright (c) 2006 INRIA Sophia-Antipolis (France). // Copyright (c) 2011 GeometryFactory Sarl (France) // All rights reserved. // // This file is part of CGAL (www.cgal.org). // You can redistribute it and/or modify it under the terms of the GNU // General Public License as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0+ // // Author(s) : Laurent RINEAU #ifndef CGAL_MESH_3_IO_SIGNATURE_H #define CGAL_MESH_3_IO_SIGNATURE_H #include #define CGAL_MESH_3_IO_H // the old include macro, tested by other files #include #include #include #include #include #include #include #include #include #include #ifdef CGAL_PERIODIC_3_MESH_3_CONFIG_H #include #include #endif #include #include #include namespace CGAL { // SFINAE test template class has_io_signature { private: template struct helper; template static char check(helper<&V::io_signature> *); template static char (&check(...))[2]; public: enum { value = (sizeof(check(0)) == sizeof(char)) }; }; template struct Get_io_signature_aux { std::string operator() () const { return T::io_signature(); } }; // end struct template Get_io_signature_aux template struct Get_io_signature_aux { std::string operator()() const { std::cerr << "Type without signature: " << typeid(T).name() << std::endl; return std::string(); } }; // end template partial specialization Get_io_signature_aux template struct Get_io_signature : public Get_io_signature_aux< T, (has_io_signature::value || has_io_signature::value || has_io_signature::value ) // signature for // static mem func > { }; template <> struct Get_io_signature { std::string operator()() { return "i"; } }; template <> struct Get_io_signature { std::string operator()() { return "ui"; } }; template <> struct Get_io_signature { std::string operator()() { return "d"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("boost::variant<") + Get_io_signature()() + "," + Get_io_signature()() + ">"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("std::pair<") + Get_io_signature()() + "," + Get_io_signature()() + ">"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("std::pair<") + Get_io_signature()() + "," + Get_io_signature()() + ">"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("boost::variant<") + Get_io_signature()() + "," + Get_io_signature()() + "," + Get_io_signature()() + ">"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("boost::variant<") + Get_io_signature()() + "," + Get_io_signature()() + "," + Get_io_signature()() + "," + Get_io_signature()() + ">"; } }; template struct Get_io_signature > { std::string operator()() { return "Point_3"; } }; template struct Get_io_signature > { std::string operator()() { return std::string("Weighted_point<") + Get_io_signature >()() + ">"; } }; #ifdef CGAL_TRIANGULATION_3_H template struct Get_io_signature > > { typedef Triangulation_data_structure_3 Tds; std::string operator()() { return std::string("Triangulation_3(") + Get_io_signature()() + ",Vb(" + Get_io_signature()() + "),Cb(" + Get_io_signature()() + "))"; } }; #endif #ifdef CGAL_DELAUNAY_TRIANGULATION_3_H template struct Get_io_signature > { std::string operator()() { return Get_io_signature >()(); } }; #endif #ifdef CGAL_REGULAR_TRIANGULATION_3_H template struct Get_io_signature > { std::string operator()() { return Get_io_signature >()(); } }; #endif #ifdef CGAL_PERIODIC_3_TRIANGULATION_3_H template struct Get_io_signature > { std::string operator()() { return std::string("Periodic_3_triangulation_3(") + Get_io_signature()() + ",Vb(" + Get_io_signature()() + "),Cb(" + Get_io_signature()() + "))"; } }; #endif #ifdef CGAL_PERIODIC_3_REGULAR_TRIANGULATION_3_H template struct Get_io_signature > { std::string operator()() { return Get_io_signature >()(); } }; #endif #ifdef CGAL_TRIANGULATION_VERTEX_BASE_3_H template struct Get_io_signature > { std::string operator()() { return "Tvb_3"; } }; #endif #ifdef CGAL_REGULAR_TRIANGULATION_VERTEX_BASE_3_H template struct Get_io_signature > { // identical to Triangulation_vertex_base_3 std::string operator()() { return "Tvb_3"; } }; #endif #ifdef CGAL_TRIANGULATION_VERTEX_BASE_WITH_INFO_3_H template struct Get_io_signature > { std::string operator()() { return Get_io_signature()(); } }; #endif #ifdef CGAL_TRIANGULATION_CELL_BASE_3_H template struct Get_io_signature > { std::string operator()() { return "Tcb_3"; } }; #endif #ifdef CGAL_TRIANGULATION_CELL_BASE_WITH_INFO_3_H template struct Get_io_signature > { std::string operator()() { return Get_io_signature()(); } }; #endif #ifdef CGAL_REGULAR_TRIANGULATION_CELL_BASE_3_H template struct Get_io_signature > { std::string operator()() { return "RTcb_3"; } }; #endif #ifdef CGAL_REGULAR_TRIANGULATION_CELL_BASE_WITH_CIRCUMCENTER_3_H template struct Get_io_signature > { std::string operator()() { return "RTWWCcb_3"; } }; #endif } // end namespace CGAL #endif // CGAL_MESH_3_IO_SIGNATURE_H