functions.h File Reference

#include "definitions.h"
Include dependency graph for functions.h:

Go to the source code of this file.

Namespaces

namespace  basis
 

The guards collection helps in testing preconditions and reporting errors.


Functions

template<class type >
type basis::maximum (type a, type b)
 minimum returns the lesser of two values.
template<class type >
type basis::minimum (type a, type b)
 maximum returns the greater of two values.
template<class type >
type basis::absolute_value (type a)
 Returns a if a is non-negative, and returns -a otherwise.
template<class type >
bool basis::positive (const type &a)
 positive returns true if "a" is greater than zero, or false otherwise.
template<class type >
bool basis::non_positive (const type a)
 non_positive returns true if "a" is less than or equal to zero.
template<class type >
bool basis::negative (const type &a)
 negative returns true if "a" is less than zero.
template<class type >
bool basis::non_negative (const type &a)
 non_negative returns true if "a" is greater than or equal to zero.
template<class T1 , class T2 >
bool basis::operator!= (const T1 &x, const T2 &y)
template<class T1 , class T2 >
bool basis::operator> (const T1 &x, const T2 &y)
template<class T1 , class T2 >
bool basis::operator<= (const T1 &x, const T2 &y)
template<class T1 , class T2 >
bool basis::operator>= (const T1 &x, const T2 &y)
template<class target_type , class source_type >
target_type * basis::cast_or_throw (source_type &to_cast, const target_type &ignored)
 dynamically converts a type to a target type, or throws an exception if it cannot.
template<class target_type , class source_type >
const target_type * basis::cast_or_throw (const source_type &to_cast, const target_type &ignored)
 const version of the cast_or_throw template.
template<class type >
bool basis::range_check (const type &c, const type &low, const type &high)
 Returns true if "c" is between "low" and "high" inclusive.
template<class type >
type basis::square (const type &a)
 Returns the square of the object (which is a * a).
template<class type >
void basis::flip_increasing (type &a, type &b)
 Makes sure that two values are in increasing order (a < b).
template<class type >
void basis::flip_decreasing (type &a, type &b)
 Makes sure that two values are in decreasing order (a > b).
template<class type >
void basis::swap_values (type &a, type &b)
 Exchanges the values held by "a" & "b".
template<class type >
type basis::sign (type a)
 Returns the numerical sign of a number "a".
template<class contents >
void basis::WHACK (contents *&ptr)
 deletion with clearing of the pointer.
template<class type >
type & basis::bogonic ()
 Returns an object that is defined statically.
template<class type >
type basis::number_of_packets (type message_size, type packet_size)
 Reports number of packets needed given a total size and the packet size.
template<class type >
type basis::last_packet_size (type message_size, type packet_size)
 Tells how many bytes are used within last packet.

Detailed Description

Provides a set of useful mini-functions.

Definition in file functions.h.

Generated on Sat Jan 28 04:23:18 2012 for hoople2 project by  doxygen 1.6.3