summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers')
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_list.hpp71
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_vector.hpp108
2 files changed, 179 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_list.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_list.hpp
new file mode 100644
index 0000000..5995849
--- /dev/null
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_list.hpp
@@ -0,0 +1,71 @@
+// ptr_list.hpp
+// Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef BOOST_LEXER_PTR_LIST_HPP
+#define BOOST_LEXER_PTR_LIST_HPP
+
+#include <list>
+
+namespace boost
+{
+namespace lexer
+{
+namespace detail
+{
+template<typename Type>
+class ptr_list
+{
+public:
+ typedef std::list<Type *> list;
+
+ ptr_list ()
+ {
+ }
+
+ ~ptr_list ()
+ {
+ clear ();
+ }
+
+ list *operator -> ()
+ {
+ return &_list;
+ }
+
+ const list *operator -> () const
+ {
+ return &_list;
+ }
+
+ list &operator * ()
+ {
+ return _list;
+ }
+
+ const list &operator * () const
+ {
+ return _list;
+ }
+
+ void clear ()
+ {
+ while (!_list.empty ())
+ {
+ delete _list.front ();
+ _list.pop_front ();
+ }
+ }
+
+private:
+ list _list;
+
+ ptr_list (const ptr_list &); // No copy construction.
+ ptr_list &operator = (const ptr_list &); // No assignment.
+};
+}
+}
+}
+
+#endif
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_vector.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_vector.hpp
new file mode 100644
index 0000000..98411e6
--- /dev/null
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/containers/ptr_vector.hpp
@@ -0,0 +1,108 @@
+// ptr_vector.hpp
+// Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef BOOST_LEXER_PTR_VECTOR_HPP
+#define BOOST_LEXER_PTR_VECTOR_HPP
+
+#include "../size_t.hpp"
+#include <vector>
+
+namespace boost
+{
+namespace lexer
+{
+namespace detail
+{
+template<typename Type>
+class ptr_vector
+{
+public:
+ typedef std::vector<Type *> vector;
+
+ ptr_vector ()
+ {
+ }
+
+ ~ptr_vector ()
+ {
+ clear ();
+ }
+
+ vector *operator -> ()
+ {
+ return &_vector;
+ }
+
+ const vector *operator -> () const
+ {
+ return &_vector;
+ }
+
+ vector &operator * ()
+ {
+ return _vector;
+ }
+
+ const vector &operator * () const
+ {
+ return _vector;
+ }
+
+ Type * &operator [] (const std::size_t index_)
+ {
+ return _vector[index_];
+ }
+
+ Type * const &operator [] (const std::size_t index_) const
+ {
+ return _vector[index_];
+ }
+
+ bool operator == (const ptr_vector &rhs_) const
+ {
+ bool equal_ = _vector.size () == rhs_._vector.size ();
+
+ if (equal_)
+ {
+ typename vector::const_iterator lhs_iter_ = _vector.begin ();
+ typename vector::const_iterator end_ = _vector.end ();
+ typename vector::const_iterator rhs_iter_ = rhs_._vector.begin ();
+
+ for (; equal_ && lhs_iter_ != end_; ++lhs_iter_, ++rhs_iter_)
+ {
+ equal_ = **lhs_iter_ == **rhs_iter_;
+ }
+ }
+
+ return equal_;
+ }
+
+ void clear ()
+ {
+ if (!_vector.empty ())
+ {
+ Type **iter_ = &_vector.front ();
+ Type **end_ = iter_ + _vector.size ();
+
+ for (; iter_ != end_; ++iter_)
+ {
+ delete *iter_;
+ }
+ }
+
+ _vector.clear ();
+ }
+
+private:
+ vector _vector;
+
+ ptr_vector (const ptr_vector &); // No copy construction.
+ ptr_vector &operator = (const ptr_vector &); // No assignment.
+};
+}
+}
+}
+
+#endif