From 607b25e16b06deef5617d5b51cb5cb7d27703cb5 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Thu, 6 Sep 2012 11:58:16 -0700 Subject: [PATCH] Lowering the visibility of some typdefs --- cpp/ycm/IdentifierCompleter.cpp | 9 ++++++-- cpp/ycm/IdentifierCompleter.h | 40 +++++++++++++++------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/cpp/ycm/IdentifierCompleter.cpp b/cpp/ycm/IdentifierCompleter.cpp index 6328cf67..18c3aec6 100644 --- a/cpp/ycm/IdentifierCompleter.cpp +++ b/cpp/ycm/IdentifierCompleter.cpp @@ -39,13 +39,17 @@ using boost::thread; namespace YouCompleteMe { +typedef boost::function< std::vector< std::string >() > + FunctionReturnsStringVector; + + extern const unsigned int MAX_ASYNC_THREADS = 4; extern const unsigned int MIN_ASYNC_THREADS = 2; namespace { -void QueryThreadMain( LatestQueryTask &latest_query_task ) +void QueryThreadMain( IdentifierCompleter::LatestQueryTask &latest_query_task ) { while ( true ) { @@ -62,7 +66,8 @@ void QueryThreadMain( LatestQueryTask &latest_query_task ) } void BufferIdentifiersThreadMain( - BufferIdentifiersTaskStack &buffer_identifiers_task_stack ) + IdentifierCompleter::BufferIdentifiersTaskStack + &buffer_identifiers_task_stack ) { while ( true ) { diff --git a/cpp/ycm/IdentifierCompleter.h b/cpp/ycm/IdentifierCompleter.h index dd41b41d..fd080d85 100644 --- a/cpp/ycm/IdentifierCompleter.h +++ b/cpp/ycm/IdentifierCompleter.h @@ -38,28 +38,6 @@ class CandidateRepository; typedef boost::shared_ptr< std::vector< std::string > > AsyncResults; -// TODO: cpp? -typedef boost::function< std::vector< std::string >() > - FunctionReturnsStringVector; - - -// TODO: move to private -// filepath -> *( *candidate ) -typedef boost::unordered_map< std::string, - boost::shared_ptr< std::list< const Candidate* > > > - FilepathToCandidates; - -// filetype -> *( filepath -> *( *candidate ) ) -typedef boost::unordered_map< std::string, - boost::shared_ptr< FilepathToCandidates > > FiletypeMap; - -typedef boost::shared_ptr< - boost::packaged_task< AsyncResults > > QueryTask; - -typedef ConcurrentLatestValue< QueryTask > LatestQueryTask; - -typedef ConcurrentStack< VoidTask > BufferIdentifiersTaskStack; - class IdentifierCompleter : boost::noncopyable { @@ -103,6 +81,13 @@ public: const std::string &query, const std::string &filetype ) const; + typedef boost::shared_ptr< + boost::packaged_task< AsyncResults > > QueryTask; + + typedef ConcurrentLatestValue< QueryTask > LatestQueryTask; + + typedef ConcurrentStack< VoidTask > BufferIdentifiersTaskStack; + private: void ResultsForQueryAndType( const std::string &query, @@ -119,6 +104,17 @@ private: void InitThreads(); + // filepath -> *( *candidate ) + typedef boost::unordered_map< std::string, + boost::shared_ptr< std::list< const Candidate* > > > + FilepathToCandidates; + + // filetype -> *( filepath -> *( *candidate ) ) + typedef boost::unordered_map< std::string, + boost::shared_ptr< FilepathToCandidates > > FiletypeMap; + + + ///////////////////////////// // PRIVATE MEMBER VARIABLES /////////////////////////////