From 762d9bb079b201a4fc72c67853909a8d5a3f4f15 Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Wed, 21 Dec 2022 14:54:16 +0000 Subject: Change from typedef to using in fsa C++ code. --- fsa/src/libfsa/automaton-alternate.h | 42 +++++++++++++-------------- fsa/src/vespa/fsa/automaton.h | 16 +++++----- fsa/src/vespa/fsa/fsa.h | 8 ++--- fsa/src/vespa/fsa/permuter.h | 10 +++---- fsa/src/vespa/fsa/segmenter.h | 6 ++-- fsa/src/vespa/fsa/unicode.h | 4 +-- fsa/src/vespa/fsa/vectorizer.h | 8 ++--- fsa/src/vespa/fsamanagers/conceptnetmanager.h | 6 ++-- fsa/src/vespa/fsamanagers/fsamanager.h | 6 ++-- fsa/src/vespa/fsamanagers/metadatamanager.h | 6 ++-- fsa/src/vespa/fsamanagers/singleton.h | 4 +-- 11 files changed, 58 insertions(+), 58 deletions(-) (limited to 'fsa/src') diff --git a/fsa/src/libfsa/automaton-alternate.h b/fsa/src/libfsa/automaton-alternate.h index f84ac4b7612..db17306376b 100644 --- a/fsa/src/libfsa/automaton-alternate.h +++ b/fsa/src/libfsa/automaton-alternate.h @@ -424,17 +424,17 @@ private: size_t _size; // used # of objects in current chunk static const size_t _CAPACITY = 16 * 1024 * 1024; // capacity of chunk in bytes public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef const _Tp* const_pointer; - typedef _Tp& reference; - typedef const _Tp& const_reference; - typedef _Tp value_type; + using size_type = size_t; + using difference_type = ptrdiff_t; + using pointer = _Tp*; + using const_pointer = const _Tp*; + using reference = _Tp&; + using const_reference = const _Tp&; + using value_type = _Tp; template struct rebind - { typedef MMapArenaAllocator<_Tp1> other; }; + { using other = MMapArenaAllocator<_Tp1>; }; MMapArenaAllocator() throw(): _chunks(), _size(0) { } @@ -520,60 +520,60 @@ private: /** * @brief Register of states, maps a transition list to a state object */ - typedef std::map< const TransitionList*,State*,TListPtrLess,MMapArenaAllocator< std::pair< const TransitionList*, State* > > > Register; + using Register = std::map< const TransitionList*,State*,TListPtrLess,MMapArenaAllocator< std::pair< const TransitionList*, State* > > >; /** * @brief State register iterator. */ - typedef std::map< const TransitionList*,State*,TListPtrLess,MMapArenaAllocator< std::pair< const TransitionList*, State* > > >::iterator RegisterIterator; + using RegisterIterator = std::map< const TransitionList*,State*,TListPtrLess,MMapArenaAllocator< std::pair< const TransitionList*, State* > > >::iterator; /** * @brief Register of states, maps a blob to a special state. */ - typedef std::map< Blob,State* > BlobRegister; + using BlobRegister = std::map< Blob,State* >; /** * @brief Blob register iterator. */ - typedef std::map< Blob,State* >::iterator BlobRegisterIterator; + using BlobRegisterIterator = std::map< Blob,State* >::iterator; /** * @brief Array of state pointers. */ - typedef std::vector< State* > StateArray; + using StateArray = std::vector< State* >; /** * @brief State* array iterator. */ - typedef std::vector< State* >::iterator StateArrayIterator; + using StateArrayIterator = std::vector< State* >::iterator; /** * @brief Array of state/cell pairs. */ - typedef std::vector< StateCellArrayItem > StateCellArray; + using StateCellArray = std::vector< StateCellArrayItem >; /** * @brief StateCell array iterator. */ - typedef std::vector< StateCellArrayItem >::iterator StateCellArrayIterator; + using StateCellArrayIterator = std::vector< StateCellArrayItem >::iterator; /** * @brief Packing map, maps a state pointer to a state ID. */ - typedef std::map< const void*, unsigned int > PackMap; + using PackMap = std::map< const void*, unsigned int >; /** * @brief Packing map iterator. */ - typedef std::map< const void*, unsigned int >::iterator PackMapIterator; + using PackMapIterator = std::map< const void*, unsigned int >::iterator; /** * @brief symbol_t list. */ - typedef std::list SymList; + using SymList = std::list; /** * @brief symbol_t list iterator. */ - typedef std::list::iterator SymListIterator; + using SymListIterator = std::list::iterator; /** * @brief symbol_t list const_iterator. */ - typedef std::list::const_iterator SymListConstIterator; + using SymListConstIterator = std::list::const_iterator; // }}} // {{{ Automaton::PackedAutomaton diff --git a/fsa/src/vespa/fsa/automaton.h b/fsa/src/vespa/fsa/automaton.h index 2c3f38d8a57..d59e3b8fbf2 100644 --- a/fsa/src/vespa/fsa/automaton.h +++ b/fsa/src/vespa/fsa/automaton.h @@ -508,38 +508,38 @@ private: /** * @brief Register of states, maps a transition list to a state object */ - typedef std::map< TListPtr,State* > Register; + using Register = std::map< TListPtr,State* >; /** * @brief State register iterator. */ - typedef std::map< TListPtr,State* >::iterator RegisterIterator; + using RegisterIterator = std::map< TListPtr,State* >::iterator; /** * @brief Register of states, maps a blob to a special state. */ - typedef std::map< Blob,State* > BlobRegister; + using BlobRegister = std::map< Blob,State* >; /** * @brief Blob register iterator. */ - typedef std::map< Blob,State* >::iterator BlobRegisterIterator; + using BlobRegisterIterator = std::map< Blob,State* >::iterator; /** * @brief Packing map, maps a state pointer to a state ID. */ - typedef std::map< const void*, unsigned int > PackMap; + using PackMap = std::map< const void*, unsigned int >; /** * @brief Packing map iterator. */ - typedef std::map< const void*, unsigned int >::iterator PackMapIterator; + using PackMapIterator = std::map< const void*, unsigned int >::iterator; /** * @brief symbol_t list. */ - typedef std::list SymList; + using SymList = std::list ; /** * @brief symbol_t list iterator. */ - typedef std::list::iterator SymListIterator; + using SymListIterator = std::list::iterator; // }}} // {{{ Automaton::PackedAutomaton diff --git a/fsa/src/vespa/fsa/fsa.h b/fsa/src/vespa/fsa/fsa.h index b6e5789e043..49c660755b0 100644 --- a/fsa/src/vespa/fsa/fsa.h +++ b/fsa/src/vespa/fsa/fsa.h @@ -23,22 +23,22 @@ namespace fsa { /** * @brief Symbol type used by the automaton. sizeof() should be 1. */ -typedef uint8_t symbol_t; +using symbol_t = uint8_t; /** * @brief State type used by the automaton. */ -typedef uint32_t state_t; +using state_t = uint32_t; /** * @brief Hash type used by the automaton. */ -typedef uint32_t hash_t; +using hash_t = uint32_t; /** * @brief Data type used by the automaton. sizeof() should be 1. */ -typedef uint8_t data_t; +using data_t = uint8_t; // }}} diff --git a/fsa/src/vespa/fsa/permuter.h b/fsa/src/vespa/fsa/permuter.h index f8b6933e478..279c3ade418 100644 --- a/fsa/src/vespa/fsa/permuter.h +++ b/fsa/src/vespa/fsa/permuter.h @@ -27,11 +27,11 @@ private: static const unsigned int MAX_UNIT_LENGTH = 6; - typedef std::vector PermTab; - typedef std::vector::iterator PermTabIterator; - typedef std::map PermMap; - typedef std::map::iterator PermMapIterator; - typedef std::map::const_iterator PermMapConstIterator; + using PermTab = std::vector; + using PermTabIterator = std::vector::iterator; + using PermMap = std::map; + using PermMapIterator = std::map::iterator; + using PermMapConstIterator = std::map::const_iterator; PermTab _permtab; PermMap _permmap; diff --git a/fsa/src/vespa/fsa/segmenter.h b/fsa/src/vespa/fsa/segmenter.h index b64956618cc..7502a887f65 100644 --- a/fsa/src/vespa/fsa/segmenter.h +++ b/fsa/src/vespa/fsa/segmenter.h @@ -102,11 +102,11 @@ public: // {{{ typedef Segmenter::Segmentation /** %Segmentation type */ - typedef std::list Segmentation; + using Segmentation = std::list; /** Iterator for %segmentation type */ - typedef std::list::iterator SegmentationIterator; + using SegmentationIterator = std::list::iterator; /** Const iterator for %segmentation type */ - typedef std::list::const_iterator SegmentationConstIterator; + using SegmentationConstIterator = std::list::const_iterator; // }}} diff --git a/fsa/src/vespa/fsa/unicode.h b/fsa/src/vespa/fsa/unicode.h index 4290505bf2c..2328a19e003 100644 --- a/fsa/src/vespa/fsa/unicode.h +++ b/fsa/src/vespa/fsa/unicode.h @@ -8,9 +8,9 @@ namespace fsa { /** utf8_t is the type of the multi-byte UTF-8 character components */ -typedef uint8_t utf8_t; +using utf8_t = uint8_t; /** ucs4_t is the type of the 4-byte UCS4 characters */ -typedef uint32_t ucs4_t; +using ucs4_t = uint32_t; /** diff --git a/fsa/src/vespa/fsa/vectorizer.h b/fsa/src/vespa/fsa/vectorizer.h index 7e61c4f6d88..2fe75eb7a87 100644 --- a/fsa/src/vespa/fsa/vectorizer.h +++ b/fsa/src/vespa/fsa/vectorizer.h @@ -39,8 +39,8 @@ public: */ class VectorItem { public: - typedef std::pair Hit; - typedef std::vector Hits; + using Hit = std::pair; + using Hits = std::vector; private: std::string _term; /**< Term/phrase. */ double _weight; /**< Term weight. */ @@ -334,7 +334,7 @@ public: /** * @brief Term vector type. */ - typedef std::vector TermVector; + using TermVector = std::vector; private: @@ -355,7 +355,7 @@ private: public: - typedef std::map > ItemMap; + using ItemMap = std::map >; // {{{ Vectorizer::RawVector::iterator diff --git a/fsa/src/vespa/fsamanagers/conceptnetmanager.h b/fsa/src/vespa/fsamanagers/conceptnetmanager.h index eddc160bb50..69ee413a569 100644 --- a/fsa/src/vespa/fsamanagers/conceptnetmanager.h +++ b/fsa/src/vespa/fsamanagers/conceptnetmanager.h @@ -44,11 +44,11 @@ private: ConceptNetManager& operator=(const ConceptNetManager&); /** %ConceptNet library type */ - typedef std::map Library; + using Library = std::map; /** %ConceptNet library iterator type */ - typedef std::map::iterator LibraryIterator; + using LibraryIterator = std::map::iterator; /** %ConceptNet library const iterator type */ - typedef std::map::const_iterator LibraryConstIterator; + using LibraryConstIterator = std::map::const_iterator; Library _library; /**< Library of concept networks. */ mutable RWLock _lock; /**< Read-write lock for library synchronization. */ diff --git a/fsa/src/vespa/fsamanagers/fsamanager.h b/fsa/src/vespa/fsamanagers/fsamanager.h index f2c663e6351..d1cf4b4a1fa 100644 --- a/fsa/src/vespa/fsamanagers/fsamanager.h +++ b/fsa/src/vespa/fsamanagers/fsamanager.h @@ -47,11 +47,11 @@ private: FSAManager& operator=(const FSAManager&); /** %FSA library type */ - typedef std::map Library; + using Library = std::map; /** %FSA library iterator type */ - typedef std::map::iterator LibraryIterator; + using LibraryIterator = std::map::iterator; /** %FSA library const iterator type */ - typedef std::map::const_iterator LibraryConstIterator; + using LibraryConstIterator = std::map::const_iterator; Library _library; /**< Library of automata. */ mutable RWLock _lock; /**< Read-write lock for library synchronization. */ diff --git a/fsa/src/vespa/fsamanagers/metadatamanager.h b/fsa/src/vespa/fsamanagers/metadatamanager.h index 606d4687af0..07f02a781f3 100644 --- a/fsa/src/vespa/fsamanagers/metadatamanager.h +++ b/fsa/src/vespa/fsamanagers/metadatamanager.h @@ -44,11 +44,11 @@ private: MetaDataManager& operator=(const MetaDataManager&); /** %MetaData library type */ - typedef std::map Library; + using Library = std::map; /** %MetaData library iterator type */ - typedef std::map::iterator LibraryIterator; + using LibraryIterator = std::map::iterator; /** %MetaData library const iterator type */ - typedef std::map::const_iterator LibraryConstIterator; + using LibraryConstIterator = std::map::const_iterator; Library _library; /**< Library of MetaData objects. */ mutable RWLock _lock; /**< Read-write lock for library synchronization. */ diff --git a/fsa/src/vespa/fsamanagers/singleton.h b/fsa/src/vespa/fsamanagers/singleton.h index 9496dada119..5a31a17f4c8 100644 --- a/fsa/src/vespa/fsamanagers/singleton.h +++ b/fsa/src/vespa/fsamanagers/singleton.h @@ -44,8 +44,8 @@ private: void destroy(); - typedef std::list FunctionList; - typedef std::list::iterator FunctionListIterator; + using FunctionList = std::list; + using FunctionListIterator = std::list::iterator; /** List of Singleton destroy functions */ FunctionList _functionList; -- cgit v1.2.3