libH/Util.hpp File Reference

Util class header file. More...

#include "Debug.hpp"
#include <cstdlib>
#include <iostream>

Include dependency graph for Util.hpp:

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

Go to the source code of this file.

Namespaces

namespace  H

Classes

class  H::Util
 Main Util class. More...

Defines

#define foreach   BOOST_FOREACH
 rename BOOST_FOREACH to foreach for nice readability
#define apply_func(object, functor, functee)   for_all(object, boost::bind(functor, functee, _1))
 Apply a function to a set or collection of items.
#define apply_func_args(object, functor, functee,...)   for_all(object, boost::bind(functor, functee, _1, ## __VA_ARGS__))
 Apply a function to a set or collection of items with arguments.
#define apply_static_func_args(object, functor,...)   for_all(object, boost::bind(functor, _1, ## __VA_ARGS__))
 Apply a static function to a set or collection of items with arguments.
#define sort_all(object)   sort(object.begin(), object.end())
 Sort all elements.

Functions

template<class Object, class Functor>
Functor H::for_all (Object &object, Functor functor)
 Apply function f to all elements in Object o.
void H::dbg_print_item (std::string &object)
 Functor that prints an item using the H:cdbg class.
void H::print_item (std::string &object)
 Functor that prints an item.


Detailed Description

Util class header file.

Definition in file Util.hpp.


Define Documentation

#define apply_func ( object,
functor,
functee   )     for_all(object, boost::bind(functor, functee, _1))

Apply a function to a set or collection of items.

Parameters:
object The object to apply functor to
functor The function object that modifies each object
functee The object that the functor belongs to
Returns:
result of for_all()
This is a short cut for H::for_all

Definition at line 79 of file Util.hpp.

Referenced by H::FileEventWatcher::watchForFileEvents().

#define apply_func_args ( object,
functor,
functee,
...   )     for_all(object, boost::bind(functor, functee, _1, ## __VA_ARGS__))

Apply a function to a set or collection of items with arguments.

Parameters:
object The object to apply functor to
functor The function object that modifies each object
functee The object that the functor belongs to
... User argument N to pass to Functor
Returns:
result of for_all()
This is a short cut for H::for_all

Definition at line 93 of file Util.hpp.

#define apply_static_func_args ( object,
functor,
...   )     for_all(object, boost::bind(functor, _1, ## __VA_ARGS__))

Apply a static function to a set or collection of items with arguments.

Parameters:
object The object to apply functor to
functor The function object that modifies each object
... User argument N to pass to Functor
Returns:
result of for_all()
This is a short cut for H::for_all

Definition at line 106 of file Util.hpp.

Referenced by Gizmod::GizmoEventStandard::buildEventsVectorFromBuffer(), Gizmod::GizmoEventPowermate::buildEventsVectorFromBuffer(), and Gizmod::GizmoEventATIX10::buildEventsVectorFromBuffer().

#define sort_all ( object   )     sort(object.begin(), object.end())

Sort all elements.

Parameters:
object The object to sort

Definition at line 114 of file Util.hpp.


Generated on Wed Nov 7 10:06:29 2007 for gizmod by  doxygen 1.5.3