Predator  [unstable] git snapshot
Macros | Functions
util.hh File Reference
#include <algorithm>
#include <cstring>

Go to the source code of this file.

Macros

#define STREQ(s1, s2)   (0 == strcmp(s1, s2))
#define FIXW(w)   std::fixed << std::setfill('0') << std::setw(w)
#define RETURN_IF_COMPARED(a, b, member)

Functions

template<typename T >
void swapValues (T &a, T &b)
template<typename T >
void sortValues (T &a, T &b)
template<typename TCont >
bool hasItem (const TCont &cont, const typename TCont::value_type &key)
template<typename TCont >
bool hasKey (const TCont &cont, const typename TCont::key_type &key)
template<typename TCont >
bool hasKey (const TCont *cont, const typename TCont::key_type &key)
template<typename TCont >
bool insertOnce (TCont &cont, const typename TCont::key_type &key)
template<class TStack , class TFirst , class TSecond >
void push (TStack &dst, const TFirst &first, const TSecond &second)
template<class TStack , class TFirst , class TSecond >
void push (TStack *dst, const TFirst &first, const TSecond &second)

Macro Definition Documentation

#define FIXW (   w)    std::fixed << std::setfill('0') << std::setw(w)

Definition at line 30 of file util.hh.

#define RETURN_IF_COMPARED (   a,
  b,
  member 
)
Value:
do { \
if (a.member < b.member) \
return true; \
if (b.member < a.member) \
return false; \
} while (0)

Definition at line 32 of file util.hh.

Referenced by operator<(), AdtOp::operator<(), and FixedPoint::operator<().

#define STREQ (   s1,
  s2 
)    (0 == strcmp(s1, s2))

Definition at line 27 of file util.hh.

Function Documentation

bool hasItem ( const TCont &  cont,
const typename TCont::value_type &  key 
)

Definition at line 56 of file util.hh.

bool hasKey ( const TCont &  cont,
const typename TCont::key_type &  key 
)
bool hasKey ( const TCont *  cont,
const typename TCont::key_type &  key 
)

Definition at line 68 of file util.hh.

References hasKey().

bool insertOnce ( TCont &  cont,
const typename TCont::key_type &  key 
)

Definition at line 74 of file util.hh.

Referenced by traverseProgramVarsGeneric().

void push ( TStack &  dst,
const TFirst &  first,
const TSecond &  second 
)

Definition at line 80 of file util.hh.

Referenced by push().

void push ( TStack *  dst,
const TFirst &  first,
const TSecond &  second 
)

Definition at line 86 of file util.hh.

References push().

void sortValues ( T &  a,
T &  b 
)
void swapValues ( T &  a,
T &  b 
)

Definition at line 40 of file util.hh.

Referenced by sortValues().