#include <balst_stacktrace.h>
This value-semantic class describes a function-call stack, represented as a sequence of randomly accessible StackTraceFrame
objects, each of which represents one function call on the stack. Note that if no allocator is supplied at construction, an owned bdlma::HeapBypassAllocator
object is used to supply memory.
See balst_stacktrace
◆ StackTrace() [1/2]
Create an empty StackTrace
object (having a length of 0). Optionally specify basicAllocator
used to supply memory. If basicAllocator
is 0, then an owned heap-bypass allocator object is used. Note that the heap-bypass allocator is used by default to avoid heap allocation in situations where the heap may have been corrupted.
◆ StackTrace() [2/2]
Create a StackTrace
object having the same value as the specified original
object. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, then an owned heap-bypass allocator object is used. Note that the heap-bypass allocator is used by default to avoid heap allocation in situations where the heap may have been corrupted.
◆ ~StackTrace()
balst::StackTrace::~StackTrace |
( |
| ) |
|
|
default |
◆ allocator()
Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the owned heap-bypass allocator is used.
◆ append()
◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]
◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]
◆ length()
int balst::StackTrace::length |
( |
| ) |
const |
|
inline |
◆ operator=()
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
◆ operator[]() [1/2]
Return a reference providing modifiable access to the stack-trace frame at the specified index
. The behavior is undefined unless 0 <= index < length()
.
◆ operator[]() [2/2]
Return a reference providing non-modifiable access to the stack-trace frame at the specified index
. The behavior is undefined unless 0 <= index < length()
.
◆ print()
bsl::ostream & balst::StackTrace::print |
( |
bsl::ostream & |
stream, |
|
|
int |
level = 0 , |
|
|
int |
spacesPerLevel = 4 |
|
) |
| const |
Write the value of this object to the specified output stream
in a human-readable format, and return a reference to stream
. Optionally specify an initial indentation level
, whose absolute value is incremented recursively for nested objects. If level
is specified, optionally specify spacesPerLevel
, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
). If stream
is not valid on entry, this operation has no effect. Note that the format is not fully specified, and can change without notice.
◆ removeAll()
void balst::StackTrace::removeAll |
( |
| ) |
|
|
inline |
Remove all stack-trace frames from this object. After this operation, the length()
method will return 0.
◆ resize()
void balst::StackTrace::resize |
( |
int |
newLength | ) |
|
|
inline |
Add default constructed stack-trace frames to, or remove stack-trace frames from, the end of this stack-trace object such that, after the operation, length() == newLength
. Stack trace frames whose indices are in the range 0 <= index < min(length, newLength)
will be unchanged. The behavior is undefined unless 0 <= newLength
.
◆ swap()
void balst::StackTrace::swap |
( |
StackTrace & |
other | ) |
|
|
inline |
Efficiently exchange the value of this object with the value of the specified other
object. This method provides the no-throw exception-safety guarantee. The behavior is undefined unless this object was created with the same allocator as other
.
◆ operator==
Return true
if the specified lhs
and rhs
objects have the same value, and false
otherwise. Two StackTrace
objects have the same value if they have the save length, and each of their corresponding stack-trace frames have the same value.
The documentation for this class was generated from the following file: