Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Functions | Variables

SgSystem.cpp File Reference

See SgSystem.h. More...

#include "SgSystem.h"
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include "SgTime.h"

Go to the source code of this file.

Functions

void SgHandleAssertion (const char *expr, const char *file, int line)
 System-specific action when an SG_ASSERT fails.
void SgSetUserAbort (bool aborted)
 Sets the global user abort flag.
bool SgUserAbort ()
 Poll for user abort.

Variables

static bool s_assertContinue = (std::getenv("SMARTGAME_ASSERT_CONTINUE") != 0)
 Set the shell variable SMARTGAME_ASSERT_CONTINUE to drop into the debugger instead of aborting the program whenever an SG_ASSERT fails.

Detailed Description

See SgSystem.h.

Definition in file SgSystem.cpp.


Function Documentation

void SgHandleAssertion ( const char *  expr,
const char *  file,
int  line 
)

System-specific action when an SG_ASSERT fails.

Set a breakpoint on the next line to drop into the debugger

Definition at line 57 of file SgSystem.cpp.

References cerr, SgAssertionHandler::Run(), and s_assertContinue.

void SgSetUserAbort ( bool  aborted  ) 

Sets the global user abort flag.

This flag should be set to false at the beginning of each user event, e.g. each GUI event or GTP command. Lengthy functions should poll the user abort flag with SgUserAbort and abort, if necessary; they should not reset the flag themselves. It can also be called from a different thread (the abort flag is declared volatile).

Definition at line 71 of file SgSystem.cpp.

bool SgUserAbort (  ) 

Poll for user abort.

See also:
SgSetUserAbort.

Definition at line 76 of file SgSystem.cpp.

Referenced by SgSearch::AbortSearch(), SgUctSearch::CheckAbortSearch(), SgUctTree::CopySubtree(), and SgUctSearch::SearchOnePly().


Variable Documentation

bool s_assertContinue = (std::getenv("SMARTGAME_ASSERT_CONTINUE") != 0) [static]

Set the shell variable SMARTGAME_ASSERT_CONTINUE to drop into the debugger instead of aborting the program whenever an SG_ASSERT fails.

Definition at line 55 of file SgSystem.cpp.

Referenced by SgHandleAssertion().


Sun Mar 13 2011 Doxygen 1.7.1