PStack  2.0
Stack trace printer for MSVC and GCC binaries
image_symbol_iterator.hpp
Go to the documentation of this file.
1 // ===-- include/psystem/image_symbol_iterator.hpp -------- -*- C++ -*- --=== //
2 // Copyright (c) 2015 Matt Bisson. All rights reserved.
3 
18 #pragma once
19 #ifndef PSYSTEM_IMAGE_SYMBOL_ITERATOR_HPP
20 #define PSYSTEM_IMAGE_SYMBOL_ITERATOR_HPP
21 
22 #include "psystem_ns.hpp"
23 
24 #include <iterator>
25 
26 namespace psystem {
27 
48  : public std::iterator<std::random_access_iterator_tag, IMAGE_SYMBOL const>
49 {
53 public:
67  explicit image_symbol_iterator(psystem::address_t const in_ptr) noexcept;
68 
75 
81 
89 
93 public:
95  // Basic equality:
97 
106  bool operator==(image_symbol_iterator const& other) const noexcept;
107 
117  bool operator!=(image_symbol_iterator const& other) const noexcept;
118 
120  // "Magnitude" Comparison:
122 
130  bool operator<(image_symbol_iterator const& o) const noexcept;
131 
139  bool operator<=(image_symbol_iterator const& o) const noexcept;
140 
148  bool operator>(image_symbol_iterator const& o) const noexcept;
149 
158  bool operator>=(image_symbol_iterator const& o) const noexcept;
159 
161  // Data Access
163 
171  reference operator*() const noexcept;
172 
177  pointer operator->() const noexcept;
178 
188 
192 public:
194  // Data Access
196 
207  reference operator[](size_t const count) const noexcept;
208 
210  // Increment
212 
222 
231 
238  image_symbol_iterator& operator+=(size_t const count) noexcept;
239 
241  // Decrement
243 
253 
262 
269  image_symbol_iterator& operator-=(size_t const count) noexcept;
270 
279  image_symbol_iterator operator-(size_t const count) const noexcept;
280 
290  difference_type operator-(image_symbol_iterator const& it) const noexcept;
291 
295 private:
297  IMAGE_SYMBOL const *m_current_symbol;
298 };
299 
303 
313  image_symbol_iterator const& it, size_t const count) noexcept;
314 
325  size_t const count, image_symbol_iterator const& it) noexcept;
326 
327 } // namespace psystem
328 
329 namespace std {
330 
341 inline void
342 swap(
345 {
346  it1.swap(it2);
347 }
348 
349 }
350 
351 #endif // PSYSTEM_IMAGE_SYMBOL_ITERATOR_HPP
~image_symbol_iterator() noexcept
Destroy this iterator instance.
Definition: image_symbol_iterator.cpp:33
pointer operator->() const noexcept
Access to member data in the underlying container data.
Definition: image_symbol_iterator.cpp:102
reference operator[](size_t const count) const noexcept
Access underlying container data by index.
Definition: image_symbol_iterator.cpp:118
image_symbol_iterator & operator+=(size_t const count) noexcept
Compound addition.
Definition: image_symbol_iterator.cpp:139
Definition: shared_handle.hpp:782
#define noexcept
Replace keyword with something useful.
Definition: platform.hpp:71
bool operator<=(image_symbol_iterator const &o) const noexcept
Determines if this is less-than or equal-to another instance.
Definition: image_symbol_iterator.cpp:78
std::uintptr_t address_t
Container type for a memory address.
Definition: platform.hpp:221
reference operator*() const noexcept
Access the underlying container data as a reference type.
Definition: image_symbol_iterator.cpp:96
bool operator<(image_symbol_iterator const &o) const noexcept
Determines if this is less-than another instance.
Definition: image_symbol_iterator.cpp:71
image_symbol_iterator & operator--() noexcept
Prefix decrement.
Definition: image_symbol_iterator.cpp:154
image_symbol_iterator & operator++() noexcept
Prefix increment.
Definition: image_symbol_iterator.cpp:132
Iterator type for COFF-format debugging symbols.
Definition: image_symbol_iterator.hpp:47
image_symbol_iterator(psystem::address_t const in_ptr) noexcept
Construct an iterator based on a backing store.
Definition: image_symbol_iterator.cpp:22
The basic header file for the PSystem namespce.
image_symbol_iterator & operator=(image_symbol_iterator const &o) noexcept
Assign a new state to this instance.
Definition: image_symbol_iterator.cpp:38
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
bool operator>(image_symbol_iterator const &o) const noexcept
Determines if this is greater-than another instance.
Definition: image_symbol_iterator.cpp:84
IMAGE_SYMBOL const * m_current_symbol
The COFF debugging symbol currently examined by this instance.
Definition: image_symbol_iterator.hpp:297
bool operator>=(image_symbol_iterator const &o) const noexcept
Determines if this is greater-than another or equal-to instance.
Definition: image_symbol_iterator.cpp:90
image_symbol_iterator operator+(image_symbol_iterator const &it, size_t const count) noexcept
Create a new iterator placed after it in the container.
Definition: image_symbol_iterator.cpp:186
void swap(image_symbol_iterator &o) noexcept
Swap the contents of another iterator with this instance.
Definition: image_symbol_iterator.cpp:108
bool operator!=(image_symbol_iterator const &other) const noexcept
Determine the inequality of two instances.
Definition: image_symbol_iterator.cpp:63
image_symbol_iterator operator-(size_t const count) const noexcept
Create a new iterator placed prior to this instance in the container.
Definition: image_symbol_iterator.cpp:168
image_symbol_iterator & operator-=(size_t const count) noexcept
Compound subtraction.
Definition: image_symbol_iterator.cpp:161
bool operator==(image_symbol_iterator const &other) const noexcept
Determine the equality of two instances.
Definition: image_symbol_iterator.cpp:49