[#BloombergLP-balst-StackTrace]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::StackTrace
:relfileprefix: ../../
:mrdocs:

This value&hyphen;semantic class describes a function&hyphen;call stack, represented as a sequence of randomly accessible `StackTraceFrame` objects, each of which represents one function call on the stack&period; Note that if no allocator is supplied at construction, an owned `bdlma&colon;&colon;HeapBypassAllocator` object is used to supply memory&period;

== Synopsis

Declared in `&lt;balst&lowbar;stacktrace&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class StackTrace;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balst/StackTrace/2constructor-0c.adoc[`StackTrace`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/balst/StackTrace/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/balst/StackTrace/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period; Note that if no allocator was supplied at construction the owned heap&hyphen;bypass allocator is used&period;
| xref:BloombergLP/balst/StackTrace/append.adoc[`append`] 
| Append to this sequence the specified `value`&period;
| xref:BloombergLP/balst/StackTrace/length.adoc[`length`] 
| Return the number of stack&hyphen;trace frames contained in this object&period;
| xref:BloombergLP/balst/StackTrace/operator_subs-0f.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:BloombergLP/balst/StackTrace/print.adoc[`print`] 
| Write the value of this object to the specified output `stream` in a human&hyphen;readable format, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; 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&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that the format is not fully specified, and can change without notice&period;
| xref:BloombergLP/balst/StackTrace/removeAll.adoc[`removeAll`] 
| Remove all stack&hyphen;trace frames from this object&period; After this operation, the `length()` method will return 0&period;
| xref:BloombergLP/balst/StackTrace/resize.adoc[`resize`] 
| Add default constructed stack&hyphen;trace frames to, or remove stack&hyphen;trace frames from, the end of this stack&hyphen;trace object such that, after the operation, `length() &equals;&equals; newLength`&period; Stack trace frames whose indices are in the range `0 &lt;&equals; index &lt; min(length, newLength)` will be unchanged&period; The behavior is undefined unless `0 &lt;&equals; newLength`&period;
| xref:BloombergLP/balst/StackTrace/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with the value of the specified `other` object&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee&period; The behavior is undefined unless this object was created with the same allocator as `other`&period;
| xref:BloombergLP/balst/StackTrace/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;StackTrace, IsBitwiseMoveable&gt;`] 
| Nested trait declaration for `bslma&colon;&colon;UsesBslmaAllocator`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/balst/operator_eq-0b.adoc[BloombergLP::balst::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `StackTrace` objects have the same value if they have the save length, and each of their corresponding stack&hyphen;trace frames have the same value&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balst/operator_not_eq-08d.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period; Two `StackTrace` objects do not have the same value if they do not have the same length, or any of their corresponding stack&hyphen;trace frames do not have the same value&period;
| xref:BloombergLP/balst/swap-033.adoc[`swap`]
| Exchange the values of the specified `a` and `b` objects&period; This function provides the no&hyphen;throw exception&hyphen;safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
