BloombergLP::balst::StackTrace

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>

class StackTrace;

Member Functions

NameDescription
StackTrace [constructor]Constructors
operator= Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.
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 Append to this sequence the specified value.
length Return the number of stack-trace frames contained in this object.
operator[] Subscript operators
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.
removeAll Remove all stack-trace frames from this object. After this operation, the length() method will return 0.
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.
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.
operator BloombergLP::bslmf::NestedTraitDeclaration<StackTrace, IsBitwiseMoveable> Nested trait declaration for bslma::UsesBslmaAllocator.

Friends

NameDescription
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

NameDescription
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.
swapExchange 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.