WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Utility.h File Reference

Contains global utility functions. More...

#include <stdint.h>
#include <string>
#include "llvm/StringRef.h"

Go to the source code of this file.

Macros

#define wpi_assert(condition)   wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__)
 
#define wpi_assertWithMessage(condition, message)
 
#define wpi_assertEqual(a, b)   wpi_assertEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
 
#define wpi_assertEqualWithMessage(a, b, message)   wpi_assertEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, __FUNCTION__)
 
#define wpi_assertNotEqual(a, b)   wpi_assertNotEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
 
#define wpi_assertNotEqualWithMessage(a, b, message)
 

Functions

bool wpi_assert_impl (bool conditionValue, llvm::StringRef conditionText, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName)
 Assert implementation. More...
 
bool wpi_assertEqual_impl (int valueA, int valueB, llvm::StringRef valueAString, llvm::StringRef valueBString, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName)
 Assert equal implementation. More...
 
bool wpi_assertNotEqual_impl (int valueA, int valueB, llvm::StringRef valueAString, llvm::StringRef valueBString, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName)
 Assert not equal implementation. More...
 
void wpi_suspendOnAssertEnabled (bool enabled)
 
int frc::GetFPGAVersion ()
 Return the FPGA Version number. More...
 
int64_t frc::GetFPGARevision ()
 Return the FPGA Revision number. More...
 
uint64_t frc::GetFPGATime ()
 Read the microsecond-resolution timer on the FPGA. More...
 
bool frc::GetUserButton ()
 Get the state of the "USER" button on the roboRIO. More...
 
std::string frc::GetStackTrace (int offset)
 Get a stack trace, ignoring the first "offset" symbols. More...
 

Detailed Description

Contains global utility functions.

Macro Definition Documentation

#define wpi_assertNotEqualWithMessage (   a,
  b,
  message 
)
Value:
wpi_assertNotEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, \
__FUNCTION__)
bool wpi_assertNotEqual_impl(int valueA, int valueB, llvm::StringRef valueAString, llvm::StringRef valueBString, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName)
Assert not equal implementation.
Definition: Utility.cpp:120
#define wpi_assertWithMessage (   condition,
  message 
)
Value:
wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, \
__FUNCTION__)
bool wpi_assert_impl(bool conditionValue, llvm::StringRef conditionText, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName)
Assert implementation.
Definition: Utility.cpp:31

Function Documentation

bool wpi_assert_impl ( bool  conditionValue,
llvm::StringRef  conditionText,
llvm::StringRef  message,
llvm::StringRef  fileName,
int  lineNumber,
llvm::StringRef  funcName 
)

Assert implementation.

This allows breakpoints to be set on an assert. The users don't call this, but instead use the wpi_assert macros in Utility.h.

bool wpi_assertEqual_impl ( int  valueA,
int  valueB,
llvm::StringRef  valueAString,
llvm::StringRef  valueBString,
llvm::StringRef  message,
llvm::StringRef  fileName,
int  lineNumber,
llvm::StringRef  funcName 
)

Assert equal implementation.

This determines whether the two given integers are equal. If not, the value of each is printed along with an optional message string. The users don't call this, but instead use the wpi_assertEqual macros in Utility.h.

bool wpi_assertNotEqual_impl ( int  valueA,
int  valueB,
llvm::StringRef  valueAString,
llvm::StringRef  valueBString,
llvm::StringRef  message,
llvm::StringRef  fileName,
int  lineNumber,
llvm::StringRef  funcName 
)

Assert not equal implementation.

This determines whether the two given integers are equal. If so, the value of each is printed along with an optional message string. The users don't call this, but instead use the wpi_assertNotEqual macros in Utility.h.