Jive reference manual
Classes | Functions | Variables
General utility classes and functions

A collection of handy classes and functions. More...

Classes

class  jem::Nil
 Represents a null pointer. More...
 
class  jem::BoolType< TruthValue >
 Provides support for writing meta-programs. More...
 
class  jem::CompileTimeCheck< Value >
 Checks a boolean condition at compile-time. More...
 

Functions

void jem::abort (const char *where, const char *what)
 Prints a message and aborts the current program. More...
 
template<class T >
const T & jem::min (const T &lhs, const T &rhs)
 Returns the minimum of two values. More...
 
template<class T >
const T & jem::max (const T &lhs, const T &rhs)
 Returns the maximum of two values. More...
 
template<class T >
void jem::swap (T &lhs, T &rhs)
 Interchanges two objects. More...
 

Variables

const Nil jem::NIL
 A pre-defined instance of the class Nil. More...
 

Detailed Description

This header file provides a collection of simple classes and functions that can be used for various purposes. Note that some of these functions (like min and max) are also provided by the standard C++ library. They are defined here too so that you do not have to include the rather large header files of the standard library.

Function Documentation

void jem::abort ( const char *  where,
const char *  what 
)

Prints a message to stderr and aborts the program by calling abort(). The message is composed of the two parameters where and what.

Parameters
where- a null-terminated character array that identifies the section of code that calls this function.
what- a null-terminated character array that describes why the program is being aborted.
template<class T >
const T& jem::min ( const T &  lhs,
const T &  rhs 
)

Returns the minimum of the two values lhs and rhs.

Parameters
lhs- an object of type T.
rhs- another object of type T.
Returns
(lhs < rhs) ? lhs : rhs
Precondition
The type T implements the < operator.
template<class T >
const T& jem::max ( const T &  lhs,
const T &  rhs 
)

Returns the maximum of the two values lhs and rhs.

Parameters
lhs- an object of type T.
rhs- another object of type T.
Returns
(rhs < lhs) ? lhs : rhs
Precondition
The type T implements the < operator.
template<class T >
void jem::swap ( T &  lhs,
T &  rhs 
)

The function swap interchanges its two arguments: lhs becomes rhs, and the other way around.

Parameters
lhs- an object of type T.
rhs- another object of type T.
Precondition
The type T has a default contructor and an assignment operator.

Variable Documentation

const Nil jem::NIL

A pre-defined instance of the class Nil.

Examples:
Database.cpp, DataParser.cpp, and Event.cpp.