BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balst::StackTraceFrame Class Reference

#include <balst_stacktraceframe.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (StackTraceFrame, bslma::UsesBslmaAllocator)
 
 StackTraceFrame (bslma::Allocator *basicAllocator=0)
 
 StackTraceFrame (const void *address, const bsl::string_view &libraryFileName, int lineNumber, const bsl::string_view &mangledSymbolName, bsl::size_t offsetFromSymbol, const bsl::string_view &sourceFileName, const bsl::string_view &symbolName, bslma::Allocator *basicAllocator=0)
 
 StackTraceFrame (const StackTraceFrame &original, bslma::Allocator *basicAllocator=0)
 
 ~StackTraceFrame ()
 Destroy this object.
 
StackTraceFrameoperator= (const StackTraceFrame &rhs)
 
void setAddress (const void *value)
 
void setLibraryFileName (const bsl::string_view &value)
 
void setLineNumber (int value)
 
void setMangledSymbolName (const bsl::string_view &value)
 
void setOffsetFromSymbol (bsl::size_t value)
 
void setSourceFileName (const bsl::string_view &value)
 
void setSymbolName (const bsl::string_view &value)
 
void swap (StackTraceFrame &other)
 
const void * address () const
 
const bsl::stringlibraryFileName () const
 
int lineNumber () const
 
const bsl::stringmangledSymbolName () const
 
bsl::size_t offsetFromSymbol () const
 
const bsl::stringsourceFileName () const
 
const bsl::stringsymbolName () const
 
bool isAddressKnown () const
 
bool isLibraryFileNameKnown () const
 
bool isLineNumberKnown () const
 
bool isMangledSymbolNameKnown () const
 
bool isOffsetFromSymbolKnown () const
 
bool isSourceFileNameKnown () const
 
bool isSymbolNameKnown () const
 
bslma::Allocatorallocator () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Detailed Description

This simply constrained (value-semantic) attribute class describes a call frame created on the execution stack when a parent function calls a child function. Supplementary predicate methods indicate whether a given attribute value is considered "unknown". See the Attributes section for infromation on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

See balst_stacktraceframe

Constructor & Destructor Documentation

◆ StackTraceFrame() [1/3]

balst::StackTraceFrame::StackTraceFrame ( bslma::Allocator basicAllocator = 0)
inlineexplicit

Create a StackTraceFrame object having the (default) attribute values:

address == 0
offsetFromSymbol == (size_t)-1
int lineNumber() const
Definition balst_stacktraceframe.h:626
const bsl::string & mangledSymbolName() const
Definition balst_stacktraceframe.h:638
const bsl::string & libraryFileName() const
Definition balst_stacktraceframe.h:620
const bsl::string & symbolName() const
Definition balst_stacktraceframe.h:650
const bsl::string & sourceFileName() const
Definition balst_stacktraceframe.h:644
bsl::size_t offsetFromSymbol() const
Definition balst_stacktraceframe.h:632
const void * address() const
Definition balst_stacktraceframe.h:614

Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ StackTraceFrame() [2/3]

balst::StackTraceFrame::StackTraceFrame ( const void *  address,
const bsl::string_view libraryFileName,
int  lineNumber,
const bsl::string_view mangledSymbolName,
bsl::size_t  offsetFromSymbol,
const bsl::string_view sourceFileName,
const bsl::string_view symbolName,
bslma::Allocator basicAllocator = 0 
)
inline

Create a local time descriptor object having the specified address, libraryFileName, lineNumber, mangledSymbolName, offsetFromSymbol, sourceFileName, and symbolName attribute values. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless -1 <= lineNumber.

◆ StackTraceFrame() [3/3]

balst::StackTraceFrame::StackTraceFrame ( const StackTraceFrame original,
bslma::Allocator basicAllocator = 0 
)
inline

Create a StackTraceFrame object having the same value as the specified original object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~StackTraceFrame()

balst::StackTraceFrame::~StackTraceFrame ( )
inline

Member Function Documentation

◆ address()

const void * balst::StackTraceFrame::address ( ) const
inline

Return the value of address attribute of this object. Note that (void *)0 indicates that the address is "unknown".

◆ allocator()

bslma::Allocator * balst::StackTraceFrame::allocator ( ) const
inline

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the currently installed default allocator is used.

◆ BSLMF_NESTED_TRAIT_DECLARATION()

balst::StackTraceFrame::BSLMF_NESTED_TRAIT_DECLARATION ( StackTraceFrame  ,
bslma::UsesBslmaAllocator   
)

◆ isAddressKnown()

bool balst::StackTraceFrame::isAddressKnown ( ) const
inline

Return true if the setAddress attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isLibraryFileNameKnown()

bool balst::StackTraceFrame::isLibraryFileNameKnown ( ) const
inline

Return true if the libraryFileName attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isLineNumberKnown()

bool balst::StackTraceFrame::isLineNumberKnown ( ) const
inline

Return true if the lineNumber attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isMangledSymbolNameKnown()

bool balst::StackTraceFrame::isMangledSymbolNameKnown ( ) const
inline

Return true if the mangledSymbolName attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isOffsetFromSymbolKnown()

bool balst::StackTraceFrame::isOffsetFromSymbolKnown ( ) const
inline

Return true if the offsetFromSymbol attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isSourceFileNameKnown()

bool balst::StackTraceFrame::isSourceFileNameKnown ( ) const
inline

Return true if the sourceFileName attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ isSymbolNameKnown()

bool balst::StackTraceFrame::isSymbolNameKnown ( ) const
inline

Return true if the symbolName attribute of this object is not the "unknown" value for that attribute, and false otherwise.

◆ libraryFileName()

const bsl::string & balst::StackTraceFrame::libraryFileName ( ) const
inline

Return a reference providing non-modifiable access to the libraryFileName attribute of this object. Note the empty string indicates that the libraryFileName is "unknown".

◆ lineNumber()

int balst::StackTraceFrame::lineNumber ( ) const
inline

Return the value of the lineNumber attribute of this object. Note that -1 indicates that lineNumber is "unknown".

◆ mangledSymbolName()

const bsl::string & balst::StackTraceFrame::mangledSymbolName ( ) const
inline

Return a reference providing non-modifiable access to the mangledSymbolName attribute of this object. Note that the empty string indicates that mangledSymbolName is "unknown".

◆ offsetFromSymbol()

bsl::size_t balst::StackTraceFrame::offsetFromSymbol ( ) const
inline

Return the value of the offsetFromSymbol attribute of this object. Note that (bsl::size_t)-1 indicates that lineNumber is not known.

◆ operator=()

StackTraceFrame & balst::StackTraceFrame::operator= ( const StackTraceFrame rhs)
inline

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

◆ print()

bsl::ostream & balst::StackTraceFrame::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.

◆ setAddress()

void balst::StackTraceFrame::setAddress ( const void *  value)
inline

Set the address attribute of this object to the specified value. Note that the value (void *)0) indicates that address is "unknown".

◆ setLibraryFileName()

void balst::StackTraceFrame::setLibraryFileName ( const bsl::string_view value)
inline

Set the libraryFileName attribute of this object to the specified value. Note that the empty string indicates the libraryFileName is "unknown".

◆ setLineNumber()

void balst::StackTraceFrame::setLineNumber ( int  value)
inline

Set the lineNumber attribute of this object to the specified value. The behavior is undefined unless -1 <= value. Note that the value -1 indicates the lineNumber is "unknown".

◆ setMangledSymbolName()

void balst::StackTraceFrame::setMangledSymbolName ( const bsl::string_view value)
inline

Set the mangledSymbolName attribute of this object to the specified value. Note that the empty string indicates that the mangledSymbolName is "unknown".

◆ setOffsetFromSymbol()

void balst::StackTraceFrame::setOffsetFromSymbol ( bsl::size_t  value)
inline

Set the offsetFromSymbol attribute of this object to the specified value. Note that the value (bsl::size_t)-1 indicates that offsetFromSymbol is "unknown".

◆ setSourceFileName()

void balst::StackTraceFrame::setSourceFileName ( const bsl::string_view value)
inline

Set the sourceFileName attribute of this object to the specified value. Note that the empty string indicates that sourceFileName is "unknown".

◆ setSymbolName()

void balst::StackTraceFrame::setSymbolName ( const bsl::string_view value)
inline

Set the symbolName attribute of this object to the specified value. Note that the empty string indicates that symbolName is "unknown".

◆ sourceFileName()

const bsl::string & balst::StackTraceFrame::sourceFileName ( ) const
inline

Return a reference providing non-modifiable access to the sourceFileName attribute of this object. Note that the empty string indicates that sourceFileName is "unknown".

◆ swap()

void balst::StackTraceFrame::swap ( StackTraceFrame other)

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.

◆ symbolName()

const bsl::string & balst::StackTraceFrame::symbolName ( ) const
inline

Return a reference providing non-modifiable access to the symbolName attribute of this object. Note that the empty string indicates that symbolName is "unknown".


The documentation for this class was generated from the following file: