summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-12-21 14:54:16 +0000
committerGeir Storli <geirst@yahooinc.com>2022-12-21 15:49:53 +0000
commit762d9bb079b201a4fc72c67853909a8d5a3f4f15 (patch)
treef45b3bb331cb49307c2490a0494046a60c2086fc
parent8b9abab0f0f01a14612810b5bc48eb291d9988a1 (diff)
Change from typedef to using in fsa C++ code.
-rw-r--r--fsa/src/libfsa/automaton-alternate.h42
-rw-r--r--fsa/src/vespa/fsa/automaton.h16
-rw-r--r--fsa/src/vespa/fsa/fsa.h8
-rw-r--r--fsa/src/vespa/fsa/permuter.h10
-rw-r--r--fsa/src/vespa/fsa/segmenter.h6
-rw-r--r--fsa/src/vespa/fsa/unicode.h4
-rw-r--r--fsa/src/vespa/fsa/vectorizer.h8
-rw-r--r--fsa/src/vespa/fsamanagers/conceptnetmanager.h6
-rw-r--r--fsa/src/vespa/fsamanagers/fsamanager.h6
-rw-r--r--fsa/src/vespa/fsamanagers/metadatamanager.h6
-rw-r--r--fsa/src/vespa/fsamanagers/singleton.h4
11 files changed, 58 insertions, 58 deletions
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<typename _Tp1>
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<symbol_t> SymList;
+ using SymList = std::list<symbol_t>;
/**
* @brief symbol_t list iterator.
*/
- typedef std::list<symbol_t>::iterator SymListIterator;
+ using SymListIterator = std::list<symbol_t>::iterator;
/**
* @brief symbol_t list const_iterator.
*/
- typedef std::list<symbol_t>::const_iterator SymListConstIterator;
+ using SymListConstIterator = std::list<symbol_t>::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<symbol_t> SymList;
+ using SymList = std::list<symbol_t> ;
/**
* @brief symbol_t list iterator.
*/
- typedef std::list<symbol_t>::iterator SymListIterator;
+ using SymListIterator = std::list<symbol_t>::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<std::string> PermTab;
- typedef std::vector<std::string>::iterator PermTabIterator;
- typedef std::map<std::string,unsigned int> PermMap;
- typedef std::map<std::string,unsigned int>::iterator PermMapIterator;
- typedef std::map<std::string,unsigned int>::const_iterator PermMapConstIterator;
+ using PermTab = std::vector<std::string>;
+ using PermTabIterator = std::vector<std::string>::iterator;
+ using PermMap = std::map<std::string,unsigned int>;
+ using PermMapIterator = std::map<std::string,unsigned int>::iterator;
+ using PermMapConstIterator = std::map<std::string,unsigned int>::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<int> Segmentation;
+ using Segmentation = std::list<int>;
/** Iterator for %segmentation type */
- typedef std::list<int>::iterator SegmentationIterator;
+ using SegmentationIterator = std::list<int>::iterator;
/** Const iterator for %segmentation type */
- typedef std::list<int>::const_iterator SegmentationConstIterator;
+ using SegmentationConstIterator = std::list<int>::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<unsigned int /*position*/, int /*length*/> Hit;
- typedef std::vector<Hit> Hits;
+ using Hit = std::pair<unsigned int /*position*/, int /*length*/>;
+ using Hits = std::vector<Hit>;
private:
std::string _term; /**< Term/phrase. */
double _weight; /**< Term weight. */
@@ -334,7 +334,7 @@ public:
/**
* @brief Term vector type.
*/
- typedef std::vector<VectorItem> TermVector;
+ using TermVector = std::vector<VectorItem>;
private:
@@ -355,7 +355,7 @@ private:
public:
- typedef std::map<std::string, std::pair<TfIdf, VectorItem::Hits> > ItemMap;
+ using ItemMap = std::map<std::string, std::pair<TfIdf, VectorItem::Hits> >;
// {{{ 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<std::string,ConceptNet::Handle*> Library;
+ using Library = std::map<std::string,ConceptNet::Handle*>;
/** %ConceptNet library iterator type */
- typedef std::map<std::string,ConceptNet::Handle*>::iterator LibraryIterator;
+ using LibraryIterator = std::map<std::string,ConceptNet::Handle*>::iterator;
/** %ConceptNet library const iterator type */
- typedef std::map<std::string,ConceptNet::Handle*>::const_iterator LibraryConstIterator;
+ using LibraryConstIterator = std::map<std::string,ConceptNet::Handle*>::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<std::string,FSA::Handle*> Library;
+ using Library = std::map<std::string,FSA::Handle*>;
/** %FSA library iterator type */
- typedef std::map<std::string,FSA::Handle*>::iterator LibraryIterator;
+ using LibraryIterator = std::map<std::string,FSA::Handle*>::iterator;
/** %FSA library const iterator type */
- typedef std::map<std::string,FSA::Handle*>::const_iterator LibraryConstIterator;
+ using LibraryConstIterator = std::map<std::string,FSA::Handle*>::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<std::string,MetaData::Handle*> Library;
+ using Library = std::map<std::string,MetaData::Handle*>;
/** %MetaData library iterator type */
- typedef std::map<std::string,MetaData::Handle*>::iterator LibraryIterator;
+ using LibraryIterator = std::map<std::string,MetaData::Handle*>::iterator;
/** %MetaData library const iterator type */
- typedef std::map<std::string,MetaData::Handle*>::const_iterator LibraryConstIterator;
+ using LibraryConstIterator = std::map<std::string,MetaData::Handle*>::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<void(*)()> FunctionList;
- typedef std::list<void(*)()>::iterator FunctionListIterator;
+ using FunctionList = std::list<void(*)()>;
+ using FunctionListIterator = std::list<void(*)()>::iterator;
/** List of Singleton destroy functions */
FunctionList _functionList;