[#BloombergLP-balst-StackTrace] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::StackTrace :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<balst_stacktrace.h>` [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=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. | xref:BloombergLP/balst/StackTrace/allocator.adoc[`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. | xref:BloombergLP/balst/StackTrace/append.adoc[`append`] | Append to this sequence the specified `value`. | xref:BloombergLP/balst/StackTrace/length.adoc[`length`] | Return the number of stack‐trace frames contained in this object. | xref:BloombergLP/balst/StackTrace/operator_subs-0f.adoc[`operator[]`] | Subscript operators | xref:BloombergLP/balst/StackTrace/print.adoc[`print`] | 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. | xref:BloombergLP/balst/StackTrace/removeAll.adoc[`removeAll`] | Remove all stack‐trace frames from this object. After this operation, the `length()` method will return 0. | xref:BloombergLP/balst/StackTrace/resize.adoc[`resize`] | 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`. | xref:BloombergLP/balst/StackTrace/swap.adoc[`swap`] | 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`. | xref:BloombergLP/balst/StackTrace/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<StackTrace, IsBitwiseMoveable>`] | Nested trait declaration for `bslma::UsesBslmaAllocator`. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/balst/operator_eq-0b.adoc[BloombergLP::balst::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. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balst/operator_not_eq-08d.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise. Two `StackTrace` objects do not have the same value if they do not have the same length, or any of their corresponding stack‐trace frames do not have the same value. | xref:BloombergLP/balst/swap-033.adoc[`swap`] | Exchange the values of the specified `a` and `b` objects. This function provides the no‐throw exception‐safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#