// // gapbind14 // Copyright (C) 2021-2022 James D. Mitchell // // This program is free software: 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. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. //
// TODO: // * Allow return Fail instead of ErrorQuit in GAPBIND14_TRY // * Allow custom printing // * Support enums // * Support operators // * tests for gapbind14/demo // * update gapbind14/README.md // * gapbind: iwyu in all files // * gapbind: const/noexcept in all files
#include <cstddef> // for size_t #include <iterator> // for distance, iterator_traits #include <memory> // for shared_ptr #include <sstream> // for ostringstream #include <stdexcept> // for runtime_error #include <string> // for string #include <type_traits> // for enable_if_t #include <typeinfo> // for typeid #include <unordered_map> // for unordered_map #include <utility> // for make_pair #include <vector> // for vector
#include"gap_include.hpp"// for Obj etc #include"tame_free_fn.hpp"// for tame free functions #include"tame_mem_fn.hpp"// for tame member functions #include"to_gap.hpp"// for to_gap
//////////////////////////////////////////////////////////////////////// // Typdefs for GAP ////////////////////////////////////////////////////////////////////////
// Get the gapbind14 subtype of the object o.
gapbind14_subtype obj_subtype(Obj o);
template <typename T>
T* obj_cpp_ptr(Obj o) { // Couldn't add static_assert that IsGapBind14Type<T>::value is true // because sometimes we call this function when T is a base class of a // class where IsGapBind14Type<T>::value is true.
require_gapbind14_obj(o); // Also cannot check that subtype of o corresponds to T for the same // reason as above T might be a base class of a GapBind14Type. returnreinterpret_cast<T*>(ADDR_OBJ(o)[1]);
}
charconst* copy_c_str(std::string const& str);
charconst* params_c_str(size_t nr);
//////////////////////////////////////////////////////////////////////// // SubtypeBase class - for polymorphism ////////////////////////////////////////////////////////////////////////
class SubtypeBase { private:
std::string _name;
gapbind14_subtype _subtype;
//////////////////////////////////////////////////////////////////////// // Subtype class ////////////////////////////////////////////////////////////////////////
template <typename T> class Subtype : public SubtypeBase { public: using class_type = T;
//////////////////////////////////////////////////////////////////////// // Module class ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// // to_cpp/gap - for gapbind14 gap objects ////////////////////////////////////////////////////////////////////////
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.