diff options
| author | Neil <nyamatongwe@gmail.com> | 2017-05-12 11:01:03 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2017-05-12 11:01:03 +1000 | 
| commit | 103e0f9913655a803e46f37e17574c1441c795d4 (patch) | |
| tree | cb3ccca0a95cca32034a3e6f074fe19d9fefd080 /src/ExternalLexer.h | |
| parent | cde97c428ac6949fefe3ce5720557e247f212926 (diff) | |
| download | scintilla-mirror-103e0f9913655a803e46f37e17574c1441c795d4.tar.gz | |
Replace intrusive linked lists with vector and unique_ptr to simplify code.
Remove LexerMinder as not needed.
Diffstat (limited to 'src/ExternalLexer.h')
| -rw-r--r-- | src/ExternalLexer.h | 28 | 
1 files changed, 7 insertions, 21 deletions
| diff --git a/src/ExternalLexer.h b/src/ExternalLexer.h index a85213e31..7804c19f0 100644 --- a/src/ExternalLexer.h +++ b/src/ExternalLexer.h @@ -38,26 +38,15 @@ public:  	virtual void SetExternal(GetLexerFactoryFunction fFactory, int index);  }; -/// LexerMinder points to an ExternalLexerModule - so we don't leak them. -class LexerMinder { -public: -	ExternalLexerModule *self; -	LexerMinder *next; -}; - -/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders. +/// LexerLibrary exists for every External Lexer DLL, contains ExternalLexerModules.  class LexerLibrary { -	DynamicLibrary	*lib; -	LexerMinder		*first; -	LexerMinder		*last; - +	std::unique_ptr<DynamicLibrary> lib; +	std::vector<std::unique_ptr<ExternalLexerModule>> modules;  public: -	explicit LexerLibrary(const char *ModuleName); +	explicit LexerLibrary(const char *moduleName_);  	~LexerLibrary(); -	void Release(); -	LexerLibrary	*next; -	std::string			m_sModuleName; +	std::string moduleName;  };  /// LexerManager manages external lexers, contains LexerLibrarys. @@ -73,11 +62,8 @@ public:  private:  	LexerManager(); -	static LexerManager *theInstance; - -	void LoadLexerLibrary(const char *module); -	LexerLibrary *first; -	LexerLibrary *last; +	static std::unique_ptr<LexerManager> theInstance; +	std::vector<std::unique_ptr<LexerLibrary>> libraries;  };  class LMMinder { | 
