VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
noArgumentCallbackList.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 #pragma once
11 
12 #include "vrfutil/vrfutilDefines.h"
13 #include <list>
14 #include "vrfutil/vrfutilDefines.h"
15 
25 template <typename T_CallbackArg>
27 {
28 public:
30  typedef void (*DtCallbackFunctionType)(T_CallbackArg, void*);
31 
33  DtCallbackList(const DtCallbackList& orig);
36 
40  void addCallback(DtCallbackFunctionType fcn, void* usrData);
43  void removeCallback(DtCallbackFunctionType fcn, void* usrData);
44 
47  void invokeCallbacks(T_CallbackArg arg);
48 
50  void removeAll();
51 
53  int size();
54 
55 protected:
56  typedef std::pair<DtCallbackFunctionType, void*> DtCallbackInfoType;
57  typedef std::list<DtCallbackInfoType> DtCallbackListType;
58 
61  bool contains(const DtCallbackListType& callbackList,
62  DtCallbackFunctionType fcn, void* usrData) const;
63 
64 protected:
73 };
74 
81 {
82 public:
84  typedef void (*DtCallbackFunctionType)(void*);
85 
89  DtNoArgumentCallbackList& operator=(const DtNoArgumentCallbackList& orig);
90 
94  void addCallback(DtCallbackFunctionType fcn, void* usrData);
97  void removeCallback(DtCallbackFunctionType fcn, void* usrData);
98 
101  void invokeCallbacks();
102 
104  void removeAll();
105 
106 protected:
107  typedef std::pair<DtCallbackFunctionType, void*> DtCallbackInfoType;
108  typedef std::list<DtCallbackInfoType> DtCallbackListType;
109 
112  bool contains(const DtCallbackListType& callbackList,
113  DtCallbackFunctionType fcn, void* usrData) const;
114 
115 protected:
124 };
125 
126 #define callbackList_inl_
127 #include "vrfutil/noArgumentCallbackList.inl"
128 #undef callbackList_inl_
129 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)