corelinux::Assertion Class Reference

Assertion is-a Exception created when an assertion fails. More...

#include <Assertion.hpp>

Inheritance diagram for corelinux::Assertion:

corelinux::Exception

List of all members.

Public Types

enum  Type {
  REQUIRE, ENSURE, CHECK, ASSERT,
  NEVERGETHERE
}
 Assertion Types enum. More...

Public Member Functions

 Assertion (Type aType, CharPtr aReason, CharPtr aFile, LineNum aLine)
 Assertion Constructor.
 Assertion (AssertionCref rExcept)
 Assertion copy constructor.
virtual ~Assertion (void)
 Virtual Destructor.
AssertionRef operator= (AssertionCref)
 Assignment operator overload.
bool operator== (AssertionCref)
 Comparisson operator overload.
Assertion::Type getType (void) const
 Accessor.


Detailed Description

Assertion is-a Exception created when an assertion fails.

It contains type information so that clients may filter the types of assertion violations that they catch. There are several types of assertion macros defined. Refer to the comments at the top of Assertion.hpp for details.


Member Enumeration Documentation

Assertion Types enum.

Enumerator:
ENSURE  REQUIRE pre-condition state.
CHECK  ENSURE post-condition state.
ASSERT  CHECK invariant state.
NEVERGETHERE  ASSERT invariant state.

NEVERGETHERE logic state


Constructor & Destructor Documentation

corelinux::Assertion::Assertion ( Assertion::Type  aType,
CharPtr  aReason,
CharPtr  aFile,
LineNum  aLine 
)

Assertion Constructor.

Parameters:
Type Specifies the state condition for the assertion
Reason Text describing the assertion
File The source module the assertion was thrown from
Line The throw point line in the source module

corelinux::Assertion::Assertion ( AssertionCref  rExcept  ) 

Assertion copy constructor.

Parameters:
Assertion const reference


Member Function Documentation

AssertionRef corelinux::Assertion::operator= ( AssertionCref  aAssertion  ) 

Assignment operator overload.

Parameters:
Assertion const reference
Returns:
Assertion reference to self

References getType(), and corelinux::Exception::operator=().

bool corelinux::Assertion::operator== ( AssertionCref   ) 

Comparisson operator overload.

Parameters:
Assertion const reference
Returns:
true if equal, false otherwise

Assertion::Type corelinux::Assertion::getType ( void   )  const

Accessor.

Returns:
The Type which caused the assertion

Referenced by operator=().


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

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium