CMS 3D CMS Logo

HookList.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_HOOK_LIST_H
00002 # define CLASSLIB_HOOK_LIST_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/utils/Hook.h"
00007 # include <list>
00008 
00009 namespace lat {
00010 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00011 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00012 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00013 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00014 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00015 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00016 
00017 class HookList : public std::list< Hook<bool> >
00018 {
00019 public:
00020     bool        call (void);
00021 };
00022 
00023 template <class T1>
00024 class HookList1 : public std::list< Hook1<bool,T1> >
00025 {
00026 public:
00027     bool        call (const T1 &arg_1);
00028 };
00029 
00030 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00031 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00032 
00033 inline bool HookList::call (void)
00034 {
00035     bool        stopped = false;
00036     iterator    first;
00037     for (first = begin (); first != end () && ! stopped; ++first)
00038         stopped = (*first) ();
00039 
00040     return stopped;
00041 }
00042 
00044 
00045 template <class T1>
00046 inline bool HookList1<T1>::call (const T1 &arg1)
00047 {
00048     typedef typename std::list< Hook1<bool,T1> >::iterator iterator;
00049 
00050     bool        stopped = false;
00051     iterator    first;
00052     for (first = this->begin (); first != this->end () && ! stopped; ++first)
00053         stopped = (*first) (arg1);
00054 
00055     return stopped;
00056 }
00057 
00058 } // namespace lat
00059 #endif // CLASSLIB_HOOK_LIST_H

Generated on Tue Jun 9 17:38:54 2009 for CMSSW by  doxygen 1.5.4