Permalink
Browse files

use tree.hh for file monitoring tree

  • Loading branch information...
1 parent 19b3a49 commit 165a43fae4562f6f7477db5341564de3fcdedac3 @jjallaire jjallaire committed Jan 23, 2013
Showing with 3,617 additions and 5,022 deletions.
  1. +685 −28 NOTICE
  2. +2 −686 SOURCE.in
  3. +0 −4 src/cpp/core/include/core/FileInfo.hpp
  4. +2,788 −4 src/cpp/core/include/core/collection/Tree.hpp
  5. +0 −137 src/cpp/core/include/core/collection/tcl/Tree.h
  6. +0 −76 src/cpp/core/include/core/collection/tcl/Tree.inl
  7. +0 −189 src/cpp/core/include/core/collection/tcl/associative_tree.h
  8. +0 −285 src/cpp/core/include/core/collection/tcl/associative_tree.inl
  9. +0 −101 src/cpp/core/include/core/collection/tcl/basic_tree.h
  10. +0 −93 src/cpp/core/include/core/collection/tcl/basic_tree.inl
  11. +0 −225 src/cpp/core/include/core/collection/tcl/child_iterator.h
  12. +0 −221 src/cpp/core/include/core/collection/tcl/child_node_iterator.h
  13. +0 −293 src/cpp/core/include/core/collection/tcl/descendant_iterator.h
  14. +0 −219 src/cpp/core/include/core/collection/tcl/descendant_iterator.inl
  15. +0 −284 src/cpp/core/include/core/collection/tcl/descendant_node_iterator.h
  16. +0 −218 src/cpp/core/include/core/collection/tcl/descendant_node_iterator.inl
  17. +0 −137 src/cpp/core/include/core/collection/tcl/multitree.h
  18. +0 −76 src/cpp/core/include/core/collection/tcl/multitree.inl
  19. +0 −106 src/cpp/core/include/core/collection/tcl/ordered_iterator.h
  20. +0 −83 src/cpp/core/include/core/collection/tcl/reverse_iterator.h
  21. +0 −77 src/cpp/core/include/core/collection/tcl/reverse_node_iterator.h
  22. +0 −303 src/cpp/core/include/core/collection/tcl/sequential_tree.h
  23. +0 −333 src/cpp/core/include/core/collection/tcl/sequential_tree.inl
  24. +0 −190 src/cpp/core/include/core/collection/tcl/unique_tree.h
  25. +0 −478 src/cpp/core/include/core/collection/tcl/unique_tree.inl
  26. +1 −1 src/cpp/core/include/core/system/FileMonitor.hpp
  27. +4 −5 src/cpp/core/include/core/system/FileScanner.hpp
  28. +10 −12 src/cpp/core/system/PosixFileScanner.cpp
  29. +9 −9 src/cpp/core/system/Win32FileScanner.cpp
  30. +62 −65 src/cpp/core/system/file_monitor/FileMonitor.cpp
  31. +13 −18 src/cpp/core/system/file_monitor/FileMonitorImpl.hpp
  32. +11 −14 src/cpp/core/system/file_monitor/LinuxFileMonitor.cpp
  33. +2 −6 src/cpp/core/system/file_monitor/MacFileMonitor.cpp
  34. +12 −15 src/cpp/core/system/file_monitor/Win32FileMonitor.cpp
  35. +8 −10 src/cpp/session/SessionModuleContext.cpp
  36. +3 −3 src/cpp/session/include/session/projects/SessionProjects.hpp
  37. +2 −5 src/cpp/session/modules/SessionCodeSearch.cpp
  38. +3 −11 src/cpp/session/modules/SessionFilesListingMonitor.cpp
  39. +1 −1 src/cpp/session/modules/SessionFilesListingMonitor.hpp
  40. +1 −1 src/cpp/session/projects/SessionProjectContext.cpp
View
713 NOTICE

Large diffs are not rendered by default.

Oops, something went wrong.
View
688 SOURCE.in

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -122,10 +122,6 @@ inline bool fileInfoPathLessThan(const FileInfo& a, const FileInfo& b)
return fileInfoPathCompare(a, b) < 0;
}
-inline bool operator<(const FileInfo& a, const FileInfo& b)
-{
- return fileInfoPathLessThan(a, b);
-}
inline bool fileInfoHasPath(const FileInfo& fileInfo, const std::string& path)
{

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,137 +0,0 @@
-/*******************************************************************************
-Tree Container Library: Generic container library to store data in tree-like structures.
-Copyright (c) 2006 Mitchel Haas
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the author be held liable for any damages arising from
-the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented;
-you must not claim that you wrote the original software.
-If you use this software in a product, an acknowledgment in the product
-documentation would be appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such,
-and must not be misrepresented as being the original software.
-
-3. The above copyright notice and this permission notice may not be removed
-or altered from any source distribution.
-
-For complete documentation on this library, see http://www.datasoftsolutions.net
-Email questions, comments or suggestions to mhaas@datasoftsolutions.net
-*******************************************************************************/
-#pragma once
-#include "associative_tree.h"
-#include <set>
-
-namespace tcl
-{
-// forward declaration for deref comparison functor
- template<typename stored_type, typename node_compare_type > class tree;
-
- // deref comparison functor, derive from binary function per Scott Meyer
- template<typename stored_type, typename node_compare_type >
- struct tree_deref_less : public std::binary_function<const tree<stored_type, node_compare_type>*, const tree<stored_type, node_compare_type>*, bool>
- {
- bool operator () (const tree<stored_type, node_compare_type>* lhs, const tree<stored_type, node_compare_type>* rhs) const
- {
- // call < on actual object
- return node_compare_type()(*lhs->get(), *rhs->get());
- }
- };
-}
-
-
-
-
-// node object type. forwards most operations to base_tree_type,
-// instanciates base_tree_type with type of container (set of unique_tree ptrs) to use for node and key comparisons
-template<typename stored_type, typename node_compare_type = std::less<stored_type> >
-class tcl::tree : public tcl::associative_tree<stored_type, tcl::tree<stored_type, node_compare_type>, std::set<tcl::tree<stored_type, node_compare_type>*, tcl::tree_deref_less<stored_type, node_compare_type> > >
-{
-public:
- // typedefs
- typedef tree<stored_type, node_compare_type> tree_type;
- typedef tree_deref_less<stored_type, node_compare_type> key_compare;
- typedef tree_deref_less<stored_type, node_compare_type> value_compare;
- typedef std::set<tree_type*, key_compare> container_type;
- typedef basic_tree<stored_type, tree_type, container_type> basic_tree_type;
- typedef associative_tree<stored_type, tree_type, container_type> associative_tree_type;
-
- // constructors/destructor
- explicit tree( const stored_type& value = stored_type() ) : associative_tree_type(value) {}
- template<typename iterator_type> tree(iterator_type it_beg, iterator_type it_end, const stored_type& value = stored_type()) : associative_tree_type(value) { while (it_beg != it_end) {
- insert(*it_beg); ++it_beg;
- }}
- tree( const tree_type& rhs ); // copy constructor
- ~tree() { associative_tree_type::clear();}
-
- // assignment operator
- tree_type& operator = (const tree_type& rhs);
-
- // public interface
-public:
- typename associative_tree_type::iterator insert(const stored_type& value) { return associative_tree_type::insert(value, this);}
- typename associative_tree_type::iterator insert(const typename associative_tree_type::const_iterator pos, const stored_type& value) { return associative_tree_type::insert(pos, value, this);}
- typename associative_tree_type::iterator insert(const tree_type& tree_obj ) { return associative_tree_type::insert(tree_obj, this);}
- typename associative_tree_type::iterator insert(const typename associative_tree_type::const_iterator pos, const tree_type& tree_obj) { return associative_tree_type::insert(pos, tree_obj, this);}
-#if !defined(_MSC_VER) || _MSC_VER >= 1300 // insert range not available for VC6
- template<typename iterator_type> void insert(iterator_type it_beg, iterator_type it_end) { while (it_beg != it_end) insert(*it_beg++);}
-#endif
- void swap(tree_type& rhs);
-
- // descendant element iterator accessors
- typedef typename associative_tree_type::post_order_iterator post_order_iterator_type;
- typedef typename associative_tree_type::const_post_order_iterator const_post_order_iterator_type;
- typedef typename associative_tree_type::pre_order_iterator pre_order_iterator_type;
- typedef typename associative_tree_type::const_pre_order_iterator const_pre_order_iterator_type;
- typedef typename associative_tree_type::level_order_iterator level_order_iterator_type;
- typedef typename associative_tree_type::const_level_order_iterator const_level_order_iterator_type;
-
- pre_order_iterator_type pre_order_begin() { return pre_order_iterator_type(this, true);}
- pre_order_iterator_type pre_order_end() { return pre_order_iterator_type(this, false);}
- const_pre_order_iterator_type pre_order_begin() const { return const_pre_order_iterator_type(this, true);}
- const_pre_order_iterator_type pre_order_end() const { return const_pre_order_iterator_type(this, false);}
- post_order_iterator_type post_order_begin() { return post_order_iterator_type(this, true);}
- post_order_iterator_type post_order_end() { return post_order_iterator_type(this, false);}
- const_post_order_iterator_type post_order_begin() const { return const_post_order_iterator_type(this, true);}
- const_post_order_iterator_type post_order_end() const { return const_post_order_iterator_type(this, false);}
- level_order_iterator_type level_order_begin() { return level_order_iterator_type(this, true);}
- level_order_iterator_type level_order_end() { return level_order_iterator_type(this, false);}
- const_level_order_iterator_type level_order_begin() const { return const_level_order_iterator_type(this, true);}
- const_level_order_iterator_type level_order_end() const { return const_level_order_iterator_type(this, false);}
-
- // descendant node iterator accessors
- typedef typename associative_tree_type::pre_order_node_iterator pre_order_node_iterator_type;
- typedef typename associative_tree_type::const_pre_order_node_iterator const_pre_order_node_iterator_type;
- typedef typename associative_tree_type::post_order_node_iterator post_order_node_iterator_type;
- typedef typename associative_tree_type::const_post_order_node_iterator const_post_order_node_iterator_type;
- typedef typename associative_tree_type::level_order_node_iterator level_order_node_iterator_type;
- typedef typename associative_tree_type::const_level_order_node_iterator const_level_order_node_iterator_type;
-
- pre_order_node_iterator_type pre_order_node_begin() { return pre_order_node_iterator_type(this, true);}
- pre_order_node_iterator_type pre_order_node_end() { return pre_order_node_iterator_type(this, false);}
- const_pre_order_node_iterator_type pre_order_node_begin() const { return const_pre_order_node_iterator_type(this, true);}
- const_pre_order_node_iterator_type pre_order_node_end() const { return const_pre_order_node_iterator_type(this, false);}
- post_order_node_iterator_type post_order_node_begin() { return post_order_node_iterator_type(this, true);}
- post_order_node_iterator_type post_order_node_end() { return post_order_node_iterator_type(this, false);}
- const_post_order_node_iterator_type post_order_node_begin() const { return const_post_order_node_iterator_type(this, true);}
- const_post_order_node_iterator_type post_order_node_end() const { return const_post_order_node_iterator_type(this, false);}
- level_order_node_iterator_type level_order_node_begin() { return level_order_node_iterator_type(this, true);}
- level_order_node_iterator_type level_order_node_end() { return level_order_node_iterator_type(this, false);}
- const_level_order_node_iterator_type level_order_node_begin() const { return const_level_order_node_iterator_type(this, true);}
- const_level_order_node_iterator_type level_order_node_end() const { return const_level_order_node_iterator_type(this, false);}
-
- // friends
- #if defined(_MSC_VER) && _MSC_VER < 1300
- friend class basic_tree<stored_type, tree_type, container_type>;
- #else
- template<typename T, typename U, typename V> friend class basic_tree;
- #endif
-};
-
-#include "tree.inl"
@@ -1,76 +0,0 @@
-/*******************************************************************************
-Tree Container Library: Generic container library to store data in tree-like structures.
-Copyright (c) 2006 Mitchel Haas
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the author be held liable for any damages arising from
-the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented;
-you must not claim that you wrote the original software.
-If you use this software in a product, an acknowledgment in the product
-documentation would be appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such,
-and must not be misrepresented as being the original software.
-
-3. The above copyright notice and this permission notice may not be removed
-or altered from any source distribution.
-
-For complete documentation on this library, see http://www.datasoftsolutions.net
-Email questions, comments or suggestions to mhaas@datasoftsolutions.net
-*******************************************************************************/
-
-// copy constructor
-template<typename stored_type, typename node_compare_type>
-tcl::tree<stored_type, node_compare_type>::tree( const tree_type& rhs ) : associative_tree_type(rhs)
-{
- typename associative_tree_type::const_iterator it = rhs.begin();
- const typename associative_tree_type::const_iterator it_end = rhs.end();
- for (; it != it_end; ++it) // do a deep copy by inserting children (and descendants)
- {
- associative_tree_type::insert(*it.node(), this);
- }
-}
-
-// assignment operator
-template<typename stored_type, typename node_compare_type>
-tcl::tree<stored_type, node_compare_type>&
-tcl::tree<stored_type, node_compare_type>::operator = (const tree_type& rhs)
-{
- if (!associative_tree_type::is_root()) // can assign only to root node
- return *this;
-
- if (this == &rhs) // check for self assignment
- return *this;
-
- associative_tree_type::clear();
- basic_tree_type::operator =(rhs); // call base class operation
-
- typename associative_tree_type::const_iterator it = rhs.begin();
- const typename associative_tree_type::const_iterator it_end = rhs.end();
- for (; it != it_end; ++it) // insert children and descendants
- {
- associative_tree_type::insert(*it.node(), this);
- }
- return *this;
-}
-
-// swap
-template<typename stored_type, typename node_compare_type>
-void tcl::tree<stored_type, node_compare_type>::swap(tree_type& rhs)
-{
- tree_type temp(*this);
-
- associative_tree_type::clear();
- *this = rhs;
-
- rhs.clear();
- rhs = temp;
-}
-
-
Oops, something went wrong.

0 comments on commit 165a43f

Please sign in to comment.