rename string_for_value_type to type_identifier

This commit is contained in:
Max Lyon
2021-03-15 16:15:24 +01:00
parent 20baccda4c
commit 2a4fd0b887
7 changed files with 14 additions and 14 deletions

View File

@@ -111,7 +111,7 @@ template < typename T > struct binary
static size_t size_of(const value_type&) { return UnknownSize; } static size_t size_of(const value_type&) { return UnknownSize; }
/// A string that identifies the type of T. /// 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 /// Store a value of T and return the number of bytes written
static static

View File

@@ -96,7 +96,7 @@ namespace IO {
static const bool is_streamable = true; \ static const bool is_streamable = true; \
static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(const value_type&) { return sizeof(value_type); } \
static size_t size_of(void) { 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, \ static size_t store( std::ostream& _os, const value_type& _val, \
bool _swap=false) { \ bool _swap=false) { \
value_type tmp = _val; \ value_type tmp = _val; \
@@ -155,7 +155,7 @@ SIMPLE_BINARY(MeshHandle);
static const bool is_streamable = true; \ static const bool is_streamable = true; \
static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(const value_type&) { return sizeof(value_type); } \
static size_t size_of(void) { 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, \ static size_t store( std::ostream& _os, const value_type& _val, \
bool _swap=false) { \ bool _swap=false) { \
value_type tmp = _val; \ value_type tmp = _val; \
@@ -186,7 +186,7 @@ SIMPLE_BINARY(unsigned long);
static const bool is_streamable = true; \ static const bool is_streamable = true; \
static size_t size_of(void) { return sizeof(value_type); } \ static size_t size_of(void) { return sizeof(value_type); } \
static size_t size_of(const value_type&) { return size_of(); } \ 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, \ static size_t store( std::ostream& _os, const value_type& _val, \
bool _swap=false) { \ bool _swap=false) { \
value_type tmp = _val; \ 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() { return UnknownSize; }
static size_t size_of(const value_type &_v) static size_t size_of(const value_type &_v)
{ return sizeof(length_t) + _v.size(); } { 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 static
size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) size_t store(std::ostream& _os, const value_type& _v, bool _swap=false)
{ {
@@ -279,7 +279,7 @@ template <> struct binary<OpenMesh::Attributes::StatusInfo>
static size_t size_of() { return sizeof(status_t); } static size_t size_of() { return sizeof(status_t); }
static size_t size_of(const value_type&) { return size_of(); } 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) static size_t n_bytes(size_t _n_elem)
{ return _n_elem*sizeof(status_t); } { 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<T>::string_for_value_type() + ">"; } static std::string type_identifier(void) { return "std::vector<" + binary<T>::type_identifier() + ">"; }
static static
size_t store(std::ostream& _os, const value_type& _v, bool _swap=false, bool _store_size = true) { size_t store(std::ostream& _os, const value_type& _v, bool _swap=false, bool _store_size = true) {
size_t bytes=0; size_t bytes=0;

View File

@@ -14,7 +14,7 @@ template <> struct binary< std::vector<bool> >
size += binary<unsigned int>::size_of(); size += binary<unsigned int>::size_of();
return size; return size;
} }
static std::string string_for_value_type(void) { return "std::vector<bool>"; } static std::string type_identifier(void) { return "std::vector<bool>"; }
static static
size_t store( std::ostream& _ostr, const value_type& _v, bool _swap, bool _store_size = true) size_t store( std::ostream& _ostr, const value_type& _v, bool _swap, bool _store_size = true)
{ {

View File

@@ -214,7 +214,7 @@ public: // data access interface
std::string get_storage_name() const override std::string get_storage_name() const override
{ {
return OpenMesh::IO::binary<T>::string_for_value_type(); return OpenMesh::IO::binary<T>::type_identifier();
} }
private: private:
@@ -382,7 +382,7 @@ public:
std::string get_storage_name() const override std::string get_storage_name() const override
{ {
return OpenMesh::IO::binary<bool>::string_for_value_type(); return OpenMesh::IO::binary<bool>::type_identifier();
} }

View File

@@ -155,7 +155,7 @@ class PropertyCreatorT<ClassName> : public PropertyCreatorImpl<PropertyCreatorT<
{ \ { \
public: \ public: \
using type = ClassName; \ using type = ClassName; \
std::string type_string() override { return OpenMesh::IO::binary<type>::string_for_value_type(); } \ std::string type_string() override { return OpenMesh::IO::binary<type>::type_identifier(); } \
\ \
PropertyCreatorT() \ PropertyCreatorT() \
{ \ { \

View File

@@ -38,7 +38,7 @@ namespace IO
{ {
return size_of(); return size_of();
} }
static std::string string_for_value_type(void) static std::string type_identifier(void)
{ {
return "RegisteredDataType"; return "RegisteredDataType";
} }

View File

@@ -79,7 +79,7 @@ namespace OpenMesh {
return size_of(); 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) static size_t store(std::ostream& _os, const value_type& _v, bool _swap=false)
{ {
size_t bytes; size_t bytes;
@@ -126,7 +126,7 @@ namespace OpenMesh {
return bytes; return bytes;
} }
static std::string string_for_value_type(void) { return "MyMap"; } static std::string type_identifier(void) { return "MyMap"; }
static static
size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) size_t store(std::ostream& _os, const value_type& _v, bool _swap=false)
{ {