Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

corelinux::Assertion Class Reference

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

#include <Assertion.hpp>

Inheritance diagram for corelinux::Assertion

Inheritance graph
[legend]
Collaboration diagram for corelinux::Assertion:

Collaboration graph
[legend]
List of all members.

Public Types

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


Public Methods

 Assertion ( Type aType, CharPtr aReason, CharPtr aFile, LineNum aLine )
 Assertion Constructor. More...

 Assertion ( AssertionCref rExcept )
 Assertion copy constructor. More...

virtual ~Assertion ( void )
 Virtual Destructor.

AssertionRef operator= ( AssertionCref )
 Assignment operator overload. More...

bool operator== ( AssertionCref )
 Comparisson operator overload. More...

Assertion::Type getType ( void ) const
 Accessor. More...


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

enum corelinux::Assertion::Type
 

Assertion Types enum.

Enumeration values:
ENSURE   REQUIRE pre-condition state.
CHECK   ENSURE post-condition state.
ASSERT   CHECK invariant state.
NEVERGETHERE   NEVERGETHERE logic state.


Constructor & Destructor Documentation

corelinux::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 rAssertion )
 

Assertion copy constructor.

Parameters:
Assertion   const reference


Member Function Documentation

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

Accessor.

Returns:
The Type which caused the assertion

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

Assignment operator overload.

Parameters:
Assertion   const reference
Returns:
Assertion reference to self

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

Comparisson operator overload.

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


The documentation for this class was generated from the following files:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium