LLVM OpenMP 22.0.0git
omptest::OmptEventAsserter Struct Reference

Class that asserts with set semantics, i.e., unordered. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/openmp/tools/omptest/include/OmptAsserter.h"

Inheritance diagram for omptest::OmptEventAsserter:
[legend]

Public Member Functions

 OmptEventAsserter ()
void insert (omptest::OmptAssertEvent &&AE) override
 Add the event to the set of events that the asserter should check for.
virtual void notifyImpl (omptest::OmptAssertEvent &&AE) override
 Implements the asserter's logic.
size_t getRemainingEventCount () override
 Get the number of currently remaining events, with: ObserveState::Always.
omptest::AssertState checkState () override
 Determine and return the asserter's state.
Public Member Functions inherited from omptest::OmptAsserter
 OmptAsserter ()
virtual ~OmptAsserter ()=default
void notify (omptest::OmptAssertEvent &&AE) override
 Called from the CallbackHandler with a corresponding AssertEvent to which callback was handled.
int getNotificationCount ()
 Get the total number of received, effective notifications.
int getSuccessfulAssertionCount ()
 Get the total number of successful assertion checks.
AssertMode getOperationMode ()
 Get the asserter's current operationmode: e.g.: Strict or Relaxed.
omptest::AssertState getState ()
 Return the asserter's current state.
std::shared_ptr< OmptEventGroupInterfacegetEventGroups () const
 Accessor for the event group interface.
std::shared_ptr< logging::LoggergetLog () const
 Accessor for the event group interface.
bool verifyEventGroups (const omptest::OmptAssertEvent &ExpectedEvent, const omptest::OmptAssertEvent &ObservedEvent)
 Check the observed events' group association.
void setOperationMode (AssertMode Mode)
 Set the asserter's mode of operation w.r.t. assertion.
Public Member Functions inherited from omptest::OmptListener
virtual ~OmptListener ()=default
void setActive (bool Enabled)
 Control whether this asserter should be considered 'active'.
bool isActive ()
 Check if this asserter is considered 'active'.
bool isSuppressedEventType (omptest::internal::EventTy EvTy)
 Check if the given event type is from the set of suppressed event types.
void permitEvent (omptest::internal::EventTy EvTy)
 Remove the given event type to the set of suppressed events.
void suppressEvent (omptest::internal::EventTy EvTy)
 Add the given event type to the set of suppressed events.

Public Attributes

size_t NumEvents {0}
std::vector< omptest::OmptAssertEventEvents {}
 For now use vector (but do set semantics)

Additional Inherited Members

Protected Attributes inherited from omptest::OmptAsserter
omptest::AssertState State {omptest::AssertState::Pass}
 The asserter's current state.
std::mutex AssertMutex
 Mutex to avoid data races w.r.t. event notifications and/or insertions.
std::shared_ptr< OmptEventGroupInterfaceEventGroups {nullptr}
 Pointer to the OmptEventGroupInterface.
std::shared_ptr< logging::LoggerLog {nullptr}
 Pointer to the logging instance.
AssertMode OperationMode {AssertMode::Strict}
 Operation mode during assertion / notification.
int NumNotifications {0}
 The total number of effective notifications.
int NumSuccessfulAsserts {0}
 The number of successful assertion checks.

Detailed Description

Class that asserts with set semantics, i.e., unordered.

Definition at line 217 of file OmptAsserter.h.

Constructor & Destructor Documentation

◆ OmptEventAsserter()

omptest::OmptEventAsserter::OmptEventAsserter ( )
inline

Definition at line 218 of file OmptAsserter.h.

References Events, NumEvents, and omptest::OmptAsserter::OmptAsserter().

Member Function Documentation

◆ checkState()

AssertState OmptEventAsserter::checkState ( )
overridevirtual

Determine and return the asserter's state.

Reimplemented from omptest::OmptAsserter.

Definition at line 418 of file OmptAsserter.cpp.

References omptest::Always, Events, omptest::Fail, getRemainingEventCount(), omptest::OmptAsserter::Log, and omptest::OmptAsserter::State.

◆ getRemainingEventCount()

size_t OmptEventAsserter::getRemainingEventCount ( )
overridevirtual

Get the number of currently remaining events, with: ObserveState::Always.

Implements omptest::OmptAsserter.

Definition at line 411 of file OmptAsserter.cpp.

References Events.

Referenced by checkState(), and notifyImpl().

◆ insert()

void OmptEventAsserter::insert ( omptest::OmptAssertEvent && AE)
overridevirtual

Add the event to the set of events that the asserter should check for.

Reimplemented from omptest::OmptAsserter.

Definition at line 353 of file OmptAsserter.cpp.

References omptest::OmptAsserter::AssertMutex, and Events.

◆ notifyImpl()

Member Data Documentation

◆ Events

std::vector<omptest::OmptAssertEvent> omptest::OmptEventAsserter::Events {}

For now use vector (but do set semantics)

Definition at line 234 of file OmptAsserter.h.

Referenced by checkState(), getRemainingEventCount(), insert(), notifyImpl(), and OmptEventAsserter().

◆ NumEvents

size_t omptest::OmptEventAsserter::NumEvents {0}

Definition at line 230 of file OmptAsserter.h.

Referenced by notifyImpl(), and OmptEventAsserter().


The documentation for this struct was generated from the following files: