AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::lumberjack::TextEqualityCombiner Class Reference

Combines Message classes if their Message::text are equal. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/lumberjack/TextEqualityCombiner.hpp>

Inheritance diagram for axom::lumberjack::TextEqualityCombiner:

Public Member Functions

 TextEqualityCombiner ()
 
const std::string id () override
 Returns the unique string identifier for this combiner. Used by Lumberjack to differentiate between other combiners. More...
 
bool shouldMessagesBeCombined (const Message &leftMessage, const Message &rightMessage) override
 Function used by Lumberjack to indicate whether two messages should be combined. More...
 
void combine (Message &combined, const Message &combinee, const int ranksLimit) override
 Combines the combinee into the combined Message. More...
 
virtual bool isMessageCandidateForCombiner (const Message &)
 Function used by Lumberjack to indicate whether a Message class should be considered for this combiner. Default is true in the base class. More...
 

Detailed Description

Combines Message classes if their Message::text are equal.

This class instance is automatically added to Lumberjack's Lumberjack for you. If you want it removed call Lumberjack::removeCombiner with the string "TextEqualityCombiner" as it's parameter.

Warning
Using the TextEqualityCombiner with Message::tag has undefined behavior.
See also
Combiner Lumberjack

Constructor & Destructor Documentation

◆ TextEqualityCombiner()

axom::lumberjack::TextEqualityCombiner::TextEqualityCombiner ( )
inline

Member Function Documentation

◆ id()

const std::string axom::lumberjack::TextEqualityCombiner::id ( )
inlineoverridevirtual

Returns the unique string identifier for this combiner. Used by Lumberjack to differentiate between other combiners.

Implements axom::lumberjack::Combiner.

◆ shouldMessagesBeCombined()

bool axom::lumberjack::TextEqualityCombiner::shouldMessagesBeCombined ( const Message leftMessage,
const Message rightMessage 
)
inlineoverridevirtual

Function used by Lumberjack to indicate whether two messages should be combined.

They are not actually combined by this function. Message classes are triggered for combination if both Message::text are equal.

Parameters
[in]leftMessageOne of the Messages to be compared.
[in]rightMessageOne of the Messages to be compared.

Implements axom::lumberjack::Combiner.

References axom::lumberjack::Message::text().

◆ combine()

void axom::lumberjack::TextEqualityCombiner::combine ( Message combined,
const Message combinee,
const int  ranksLimit 
)
inlineoverridevirtual

Combines the combinee into the combined Message.

The only things truly combined in this Combiner are the ranks from combinee to combined and the creation time, since text is already equal. The creation time of the first message (lowest creation time) will be saved to the combined message.

Parameters
[in,out]combinedthe Message that will be modified.
[in]combineethe Message that is combined into the other.
[in]ranksLimitThe limit on how many individual ranks are tracked in the combined Message. Message::rankCount is always incremented.
Precondition
shouldMessagesBeCombined(combined, combinee) must be true

Implements axom::lumberjack::Combiner.

References axom::lumberjack::Message::addRanks(), axom::lumberjack::Message::count(), axom::lumberjack::Message::creationTime(), and axom::lumberjack::Message::ranks().

◆ isMessageCandidateForCombiner()

virtual bool axom::lumberjack::Combiner::isMessageCandidateForCombiner ( const Message )
inlinevirtualinherited

Function used by Lumberjack to indicate whether a Message class should be considered for this combiner. Default is true in the base class.

Parameters
[in]TheMessage to be considered. Unused in the base class but likely used in derived classes.

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