|
BDE 4.39.x Production Release
|
#include <ball_recordattributes.h>
This class provides a container for a fixed set of attributes appropriate for logging. For each attribute in this class (e.g., category), there is an accessor for obtaining the attribute's value (the category accessor) and a manipulator for changing the attribute's value (the setCategory manipulator).
Additionally, this class supports a complete set of value semantic operations, including copy construction, assignment and equality comparison, and ostream printing. A precise operational definition of when two instances have the same value can be found in the description of operator== for the class. This class is exception neutral with no guarantee of rollback: If an exception is thrown during the invocation of a method on a pre-existing instance, the object is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases.
Friends | |
| bool | operator== (const RecordAttributes &, const RecordAttributes &) |
|
explicit |
Create a record attributes object with all attributes having default values. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
| ball::RecordAttributes::RecordAttributes | ( | const bdlt::Datetime & | timestamp, |
| int | processID, | ||
| bsls::Types::Uint64 | threadID, | ||
| const bsl::string_view & | fileName, | ||
| int | lineNumber, | ||
| const bsl::string_view & | category, | ||
| int | severity, | ||
| const bsl::string_view & | message, | ||
| bslma::Allocator * | basicAllocator = 0 |
||
| ) |
Create a record attributes object having the specified timestamp, processID, threadID, kernelThreadId, fileName, lineNumber, category, severity and message values, respectively. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
| ball::RecordAttributes::RecordAttributes | ( | const bdlt::Datetime & | timestamp, |
| int | processID, | ||
| bsls::Types::Uint64 | threadID, | ||
| bsls::Types::Uint64 | kernelThreadID, | ||
| const bsl::string_view & | fileName, | ||
| int | lineNumber, | ||
| const bsl::string_view & | category, | ||
| int | severity, | ||
| const bsl::string_view & | message, | ||
| bslma::Allocator * | basicAllocator = 0 |
||
| ) |
| ball::RecordAttributes::RecordAttributes | ( | const RecordAttributes & | original, |
| bslma::Allocator * | basicAllocator = 0 |
||
| ) |
Create a record attributes object having the value of the specified original record attributes object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
|
default |
Destroy this object.
| ball::RecordAttributes::BSLMF_NESTED_TRAIT_DECLARATION | ( | RecordAttributes | , |
| bslma::UsesBslmaAllocator | |||
| ) |
|
inline |
Return the category attribute of this record attributes object.
|
inline |
Set the message attribute of this record attributes object to the empty string. Resets the objects returned by the messageStreamBuf and messageStream methods.
|
inline |
Return the filename attribute of this record attributes object.
|
inline |
Return the kernelThreadID attribute of this record attributes object.
|
inline |
Return the line number attribute of this record attributes object.
| const char * ball::RecordAttributes::message | ( | ) | const |
Return the message attribute of this record attributes object.
messageRef for an alternative to this method. Warning: This method is not const thread-safe, and cannot be safely called concurrently. It may modify the stream buffer returned by messageStreamBuf.| bslstl::StringRef ball::RecordAttributes::messageRef | ( | ) | const |
Return a string reference providing non-modifiable access to the message attribute of this record attributes object.
|
inline |
Return a reference to the modifiable stream associated with the message attribute of this record attributes object.
|
inline |
Return a reference to the non-modifiable stream associated with the message attribute of this record attributes object.
|
inline |
Return a reference to the modifiable stream buffer associated with the message attribute of this record attributes object.
|
inline |
Return a reference to the non-modifiable stream buffer associated with the message attribute of this record attributes object.
| RecordAttributes & ball::RecordAttributes::operator= | ( | const RecordAttributes & | rhs | ) |
Assign to this record attributes object the value of the specified rhs record attributes object. Resets the objects returned by the messageStreamBuf and messageStream methods.
| bsl::ostream & ball::RecordAttributes::print | ( | bsl::ostream & | stream, |
| int | level = 0, |
||
| int | spacesPerLevel = 4 |
||
| ) | const |
Format this object to the specified output stream at the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress line breaks and format the entire output on one line. If stream is initially invalid, this operation has no effect.
|
inline |
Return the processID attribute of this record attributes object.
|
inline |
Set the category attribute of this record attributes object to the specified category.
|
inline |
Set the filename attribute of this record attributes object to the specified fileName.
|
inline |
Set the kernelThreadID attribute of this record attributes object to the specified kernelThreadID.
|
inline |
Set the line number attribute of this record attributes object to the specified lineNumber.
| void ball::RecordAttributes::setMessage | ( | const bsl::string_view & | message | ) |
Set the message attribute of this record attributes object to the specified message. Resets the objects returned by the messageStreamBuf and messageStream methods.
|
inline |
Set the processID attribute of this record attributes object to the specified processID.
|
inline |
Set the severity attribute of this record attributes object to the specified severity.
|
inline |
Set the threadID attribute of this record attributes object to the specified threadID.
|
inline |
Set the timestamp attribute of this record attributes object to the specified timestamp.
|
inline |
Return the severity attribute of this record attributes object.
|
inline |
Return the threadID attribute of this record attributes object.
|
inline |
Return the timestamp attribute of this record attributes object.
|
friend |
Return true if the specified lhs and rhs record attributes objects have the same value, and false otherwise. Two record attributes objects have the same value if each respective pair of attributes have the same value.