Rhino C++ API  8.5
Public Member Functions | Static Public Attributes | List of all members
ONX_ErrorCounter Class Reference

#include <opennurbs_extensions.h>

Public Member Functions

 ONX_ErrorCounter ()=default
 
 ONX_ErrorCounter (const ONX_ErrorCounter &)=default
 
 ~ONX_ErrorCounter ()=default
 
unsigned int AddLibraryErrors ()
 
unsigned int AddLibraryErrorsAndWarnings ()
 
unsigned int AddLibraryWarnings ()
 
void ClearLibraryErrors ()
 
void ClearLibraryErrorsAndWarnings ()
 
void ClearLibraryWarnings ()
 
void Dump (ON_TextLog &text_log) const
 
unsigned int ErrorCount () const
 
unsigned int FailureCount () const
 
unsigned int IncrementErrorCount ()
 
unsigned int IncrementFailureCount ()
 
unsigned int IncrementWarningCount ()
 
const ONX_ErrorCounter operator+ (const ONX_ErrorCounter &rhs)
 
const ONX_ErrorCounter operator+= (const ONX_ErrorCounter &rhs)
 
ONX_ErrorCounteroperator= (const ONX_ErrorCounter &)=default
 
unsigned int TotalCount () const
 
unsigned int WarningCount () const
 

Static Public Attributes

static const ONX_ErrorCounter Zero
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. Description: The ONX_ErrorCounter is useful for counting errors that occur in a section of code.

Constructor & Destructor Documentation

◆ ONX_ErrorCounter() [1/2]

ONX_ErrorCounter::ONX_ErrorCounter ( )
default

◆ ~ONX_ErrorCounter()

ONX_ErrorCounter::~ONX_ErrorCounter ( )
default

◆ ONX_ErrorCounter() [2/2]

ONX_ErrorCounter::ONX_ErrorCounter ( const ONX_ErrorCounter )
default

Member Function Documentation

◆ AddLibraryErrors()

unsigned int ONX_ErrorCounter::AddLibraryErrors ( )

Description: Adds the number of calls to ON_ERROR since the last call to ClearLibraryErrors(), AddLibraryErrors(), ClearLibraryErrorsAndWarnings, or AddLibraryErrorsAndWarnings(). Returns: The number of errors added.

◆ AddLibraryErrorsAndWarnings()

unsigned int ONX_ErrorCounter::AddLibraryErrorsAndWarnings ( )

Description: Calls AddLibraryErrors() and AddLibraryWarnings(). Returns: The number of errors and warnings added.

◆ AddLibraryWarnings()

unsigned int ONX_ErrorCounter::AddLibraryWarnings ( )

Description: Adds the number of calls to ON_WARNING since the last call to ClearLibraryWarnings(), AddLibraryWarnings(), ClearLibraryErrorsAndWarnings(), or AddLibraryErrorsAndWarnings(). Returns: The number of warnings added.

◆ ClearLibraryErrors()

void ONX_ErrorCounter::ClearLibraryErrors ( )

Description: Saves the current value of ON_GetErrorCount() so future calls to ON_ERROR can be counted.

◆ ClearLibraryErrorsAndWarnings()

void ONX_ErrorCounter::ClearLibraryErrorsAndWarnings ( )

◆ ClearLibraryWarnings()

void ONX_ErrorCounter::ClearLibraryWarnings ( )

Description: Saves the current value of ON_GetWarningCount() so future calls to ON_WARNING can be counted.

◆ Dump()

void ONX_ErrorCounter::Dump ( ON_TextLog text_log) const

◆ ErrorCount()

unsigned int ONX_ErrorCounter::ErrorCount ( ) const

Returns: Number of errors.

◆ FailureCount()

unsigned int ONX_ErrorCounter::FailureCount ( ) const

Returns: Number of failures.

◆ IncrementErrorCount()

unsigned int ONX_ErrorCounter::IncrementErrorCount ( )

Description: Adds one to the error count. Returns: Number of errors including this one.

◆ IncrementFailureCount()

unsigned int ONX_ErrorCounter::IncrementFailureCount ( )

Description: Adds one to the failure count. Returns: Number of failures including this one.

◆ IncrementWarningCount()

unsigned int ONX_ErrorCounter::IncrementWarningCount ( )

Description: Adds one to the warning count. Returns: Number of warnings including this one.

◆ operator+()

const ONX_ErrorCounter ONX_ErrorCounter::operator+ ( const ONX_ErrorCounter rhs)

◆ operator+=()

const ONX_ErrorCounter ONX_ErrorCounter::operator+= ( const ONX_ErrorCounter rhs)

◆ operator=()

ONX_ErrorCounter& ONX_ErrorCounter::operator= ( const ONX_ErrorCounter )
default

◆ TotalCount()

unsigned int ONX_ErrorCounter::TotalCount ( ) const

Returns: Number of failures, errors, and warnings.

◆ WarningCount()

unsigned int ONX_ErrorCounter::WarningCount ( ) const

Returns: Number of warnings.

Member Data Documentation

◆ Zero

const ONX_ErrorCounter ONX_ErrorCounter::Zero
static