// 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). // // $URL: https://github.com/CGAL/cgal/blob/v5.1/Mesh_3/include/CGAL/Mesh_3/io_signature.h $ // $Id: io_signature.h 4dda7b6 2020-05-27T15:53:05+02:00 Sébastien Loriot // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // 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 "c"; } }; template <> struct Get_io_signature { std::string operator()() { return "uc"; } }; template <> struct Get_io_signature { std::string operator()() { return "sc"; } }; template <> struct Get_io_signature { std::string operator()() { return "s"; } }; template <> struct Get_io_signature { std::string operator()() { return "us"; } }; 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