From 2a4fd0b887cb7ccfeddd3f8fb38de2447b3e9872 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Mon, 15 Mar 2021 16:15:24 +0100 Subject: [PATCH] rename string_for_value_type to type_identifier --- src/OpenMesh/Core/IO/SR_binary.hh | 2 +- src/OpenMesh/Core/IO/SR_binary_spec.hh | 12 ++++++------ src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl | 2 +- src/OpenMesh/Core/Utils/Property.hh | 4 ++-- src/OpenMesh/Core/Utils/PropertyCreator.hh | 2 +- src/Unittests/unittests_read_write_OM.cc | 2 +- src/Unittests/unittests_tutorials.cc | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/OpenMesh/Core/IO/SR_binary.hh b/src/OpenMesh/Core/IO/SR_binary.hh index 269fa091..2d17b317 100644 --- a/src/OpenMesh/Core/IO/SR_binary.hh +++ b/src/OpenMesh/Core/IO/SR_binary.hh @@ -111,7 +111,7 @@ template < typename T > struct binary static size_t size_of(const value_type&) { return UnknownSize; } /// A string that identifies the type of T. - static std::string string_for_value_type (void) { return "UnknownType"; } + static std::string type_identifier (void) { return "UnknownType"; } /// Store a value of T and return the number of bytes written static diff --git a/src/OpenMesh/Core/IO/SR_binary_spec.hh b/src/OpenMesh/Core/IO/SR_binary_spec.hh index 0a49d4f2..9cc2b49e 100644 --- a/src/OpenMesh/Core/IO/SR_binary_spec.hh +++ b/src/OpenMesh/Core/IO/SR_binary_spec.hh @@ -96,7 +96,7 @@ namespace IO { static const bool is_streamable = true; \ static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(void) { return sizeof(value_type); } \ - static std::string string_for_value_type(void) { return #T; } \ + static std::string type_identifier(void) { return #T; } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ @@ -155,7 +155,7 @@ SIMPLE_BINARY(MeshHandle); static const bool is_streamable = true; \ static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(void) { return sizeof(value_type); } \ - static std::string string_for_value_type(void) { return #T; } \ + static std::string type_identifier(void) { return #T; } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ @@ -186,7 +186,7 @@ SIMPLE_BINARY(unsigned long); static const bool is_streamable = true; \ static size_t size_of(void) { return sizeof(value_type); } \ static size_t size_of(const value_type&) { return size_of(); } \ - static std::string string_for_value_type(void) { return #T; } \ + static std::string type_identifier(void) { return #T; } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ @@ -238,7 +238,7 @@ template <> struct binary< std::string > { static size_t size_of() { return UnknownSize; } static size_t size_of(const value_type &_v) { return sizeof(length_t) + _v.size(); } - static std::string string_for_value_type(void) { return "std::string"; } + static std::string type_identifier(void) { return "std::string"; } static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) { @@ -279,7 +279,7 @@ template <> struct binary static size_t size_of() { return sizeof(status_t); } static size_t size_of(const value_type&) { return size_of(); } - static std::string string_for_value_type(void) { return "StatusInfo";} + static std::string type_identifier(void) { return "StatusInfo";} static size_t n_bytes(size_t _n_elem) { return _n_elem*sizeof(status_t); } @@ -353,7 +353,7 @@ struct binary< std::vector< T > > { } } - static std::string string_for_value_type(void) { return "std::vector<" + binary::string_for_value_type() + ">"; } + static std::string type_identifier(void) { return "std::vector<" + binary::type_identifier() + ">"; } static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false, bool _store_size = true) { size_t bytes=0; diff --git a/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl b/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl index 37c60dcc..6a8c8ceb 100644 --- a/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl +++ b/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl @@ -14,7 +14,7 @@ template <> struct binary< std::vector > size += binary::size_of(); return size; } - static std::string string_for_value_type(void) { return "std::vector"; } + static std::string type_identifier(void) { return "std::vector"; } static size_t store( std::ostream& _ostr, const value_type& _v, bool _swap, bool _store_size = true) { diff --git a/src/OpenMesh/Core/Utils/Property.hh b/src/OpenMesh/Core/Utils/Property.hh index b01760ee..1a7b474a 100644 --- a/src/OpenMesh/Core/Utils/Property.hh +++ b/src/OpenMesh/Core/Utils/Property.hh @@ -214,7 +214,7 @@ public: // data access interface std::string get_storage_name() const override { - return OpenMesh::IO::binary::string_for_value_type(); + return OpenMesh::IO::binary::type_identifier(); } private: @@ -382,7 +382,7 @@ public: std::string get_storage_name() const override { - return OpenMesh::IO::binary::string_for_value_type(); + return OpenMesh::IO::binary::type_identifier(); } diff --git a/src/OpenMesh/Core/Utils/PropertyCreator.hh b/src/OpenMesh/Core/Utils/PropertyCreator.hh index 012f1f20..69f4e11d 100644 --- a/src/OpenMesh/Core/Utils/PropertyCreator.hh +++ b/src/OpenMesh/Core/Utils/PropertyCreator.hh @@ -155,7 +155,7 @@ class PropertyCreatorT : public PropertyCreatorImpl::string_for_value_type(); } \ + std::string type_string() override { return OpenMesh::IO::binary::type_identifier(); } \ \ PropertyCreatorT() \ { \ diff --git a/src/Unittests/unittests_read_write_OM.cc b/src/Unittests/unittests_read_write_OM.cc index 53bae204..ea0db27e 100644 --- a/src/Unittests/unittests_read_write_OM.cc +++ b/src/Unittests/unittests_read_write_OM.cc @@ -38,7 +38,7 @@ namespace IO { return size_of(); } - static std::string string_for_value_type(void) + static std::string type_identifier(void) { return "RegisteredDataType"; } diff --git a/src/Unittests/unittests_tutorials.cc b/src/Unittests/unittests_tutorials.cc index f06730d8..af5546aa 100644 --- a/src/Unittests/unittests_tutorials.cc +++ b/src/Unittests/unittests_tutorials.cc @@ -79,7 +79,7 @@ namespace OpenMesh { return size_of(); } - static std::string string_for_value_type(void) { return "MyData"; } + static std::string type_identifier(void) { return "MyData"; } static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) { size_t bytes; @@ -126,7 +126,7 @@ namespace OpenMesh { return bytes; } - static std::string string_for_value_type(void) { return "MyMap"; } + static std::string type_identifier(void) { return "MyMap"; } static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) {