/home/elb/work/cs590n/mace/mace/lib/massert.h File Reference


Detailed Description

Defines Mace assertion statements to use instead of assert or cassert.

Definition in file massert.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ASSERT_EXIT_MECHANISM   ::abort();
 ASSERT_EXIT_MECHANISM tells how an ASSERT or ABORT should terminate execution. Two available options are abort and segfault.
#define ABORT(x)
 Terminates execution, printing error message y to stdout, stderr, and Log::err().
#define ASSERT(x)
 Tests property x and terminates execution if it is false.
#define ASSERTMSG(x, y)
 Tests property x and terminates execution with message y if it is false.


Define Documentation

#define ABORT (  ) 

#define ASSERT (  ) 

Value:

{ \
     if(x) {}\
     else {\
       printf(OUTPUT_FORMAT("Assert Failed", x));\
       fprintf(stderr, OUTPUT_FORMAT("Assert Failed", x));\
       ASSERT_EXIT_MECHANISM \
     }\
   }
Tests property x and terminates execution if it is false.

Prints error message to stdout, stderr, and Log::err(). Uses ASSERT_EXIT_MECHANISM to exit.

Parameters:
x property to be tested.

Definition at line 129 of file massert.h.

Referenced by mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::add(), mace::LRUCache< uint, std::string >::add(), mace::LRUCache< uint, std::string >::clearDirty(), mace::Stopwatch::confirm(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::deserialize(), mace::sparse_array< T, size >::deserialize(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::get(), mace::hash_map< uint32_t, Log::MaceTraceStream *, mace::SoftState >::get(), mace::LRUCache< uint, std::string >::get(), BufferedBlockManager::getBlock(), mace::LRUCache< uint, std::string >::getDirty(), Util::getHostname(), mace::LRUCache< uint, std::string >::getLastDirtyKey(), SockUtil::getSockAddr(), StrUtilNamespace::getTypeFromTemplate(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::greatestScore(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::leastScore(), ScopedLock::lock(), mace::hash_map< uint32_t, Log::MaceTraceStream *, mace::SoftState >::lower_bound(), mace::LRUCache< uint, std::string >::LRUCache(), mace::Stopwatch::mark(), mace::ConstMapIterator< M >::next(), mace::MapIterator< M >::next(), mace::operator+(), RandomUtil::random(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::random(), mace::LRUCache< uint, std::string >::remove(), mace::MapIterator< M >::remove(), mace::Stopwatch::start(), mace::Stopwatch::stop(), ScopedLock::unlock(), StatisticalFilter::valueToPercentile(), Log::writeBinaryLog(), and Log::writeTextLog().

#define ASSERTMSG ( x,
 ) 

Value:

{ \
     if(x) {}\
     else {\
       printf(OUTPUT_FORMAT("Assert Failed", #y ": " #x));\
       fprintf(stderr, OUTPUT_FORMAT("Assert Failed", #y ": " #x));\
       ASSERT_EXIT_MECHANISM \
     }\
   }
Tests property x and terminates execution with message y if it is false.

Prints error message y to stdout, stderr, and Log::err(). Uses ASSERT_EXIT_MECHANISM to exit.

Parameters:
x property to be tested.
y message to be printed.

Definition at line 141 of file massert.h.

Referenced by SockUtil::init().


Generated on Sat Oct 4 21:30:07 2008 for Mace Library by  doxygen 1.5.5