Index: ext/libicpf/src/callback.h
===================================================================
diff -u -r0e69c2afbbe421971214a48e18c00f24a051518f -r095962edd978eb2480c8af23dc3fcda632b6b96c
--- ext/libicpf/src/callback.h	(.../callback.h)	(revision 0e69c2afbbe421971214a48e18c00f24a051518f)
+++ ext/libicpf/src/callback.h	(.../callback.h)	(revision 095962edd978eb2480c8af23dc3fcda632b6b96c)
@@ -48,7 +48,7 @@
 	struct _CALLBACKDATA1
 	{
 		PFNCALLBACKPROC1 pfn;	///< Callback function that is to be called
-		A1 pParam;			///< The user parameter of a function to be called
+		A1 param;			///< The user parameter of a function to be called
 	};
 
 public:
@@ -69,7 +69,7 @@
 		try
 		{
 			for (std::list<_CALLBACKDATA1>::iterator it=m_lCalls.begin();it != m_lCalls.end();it++)
-				(*((*it).pfn))((*it).pParam, pData);
+				(*((*it).pfn))((*it).param, data);
 			m_lock.unlock();
 		}
 		catch(...)
@@ -81,13 +81,13 @@
 	
 	/** Connects a user callback function to this object.
 	* \param[in] pfn - user callback function address
-	* \param[in] pParam - user parameter to pass to the callback function when executing
+	* \param[in] appParam - user parameter to pass to the callback function when executing
 	*/
-	void connect(PFNCALLBACKPROC1 pfn, A1 tAppParam)
+	void connect(PFNCALLBACKPROC1 pfn, A1 appParam)
 	{
 		_CALLBACKDATA1 cd;
 		cd.pfn=pfn;
-		cd.pParam=pParam;
+		cd.param=appParam;
 
 		m_lock.lock();
 		m_lCalls.push_back(cd);
@@ -111,6 +111,15 @@
 		}
 		m_lock.unlock();
 	}
+
+	/** Clears the callback list. No function will be left.
+	 */
+	void clear()
+	{
+		m_lock.lock();
+		m_lCalls.clear();
+		m_lock.unlock();
+	}
 /**@}*/
 
 protected:
@@ -135,7 +144,7 @@
 	struct _CALLBACKDATA2
 	{
 		PFNCALLBACKPROC2 pfn;	///< Callback function that is to be called
-		A1 pParam;				///< The user parameter of a function to be called
+		A1 param;				///< The user parameter of a function to be called
 	};
 
 public:
@@ -148,16 +157,16 @@
 /** \name User interface */
 /**@{*/
 	/** Executes a callback list associated with this object.
-	* \param[in] pData - first parameter that will be passed to a user callback function
-	* \param[in] pData2 - second parameter that will be passed to a user callback function
+	* \param[in] data1 - first parameter that will be passed to a user callback function
+	* \param[in] data2 - second parameter that will be passed to a user callback function
 	*/
-	void exec(T1 pData, T2 pData2)
+	void exec(T1 data1, T2 data2)
 	{
 		m_lock.lock();
 		try
 		{
 			for (std::list<_CALLBACKDATA2>::iterator it=m_lCalls.begin();it != m_lCalls.end();it++)
-				(*((*it).pfn))((*it).pParam, pData, pData2);
+				(*((*it).pfn))((*it).param, data1, data2);
 			m_lock.unlock();
 		}
 		catch(...)
@@ -169,13 +178,13 @@
 	
 	/** Connects a user callback function to this object.
 	* \param[in] pfn - user callback function address
-	* \param[in] pParam - user parameter to pass to the callback function when executing
+	* \param[in] appParam - user parameter to pass to the callback function when executing
 	*/
-	void connect(PFNCALLBACKPROC2 pfn, ptr_t pParam)
+	void connect(PFNCALLBACKPROC2 pfn, A1 appParam)
 	{
 		_CALLBACKDATA2 cd;
 		cd.pfn=pfn;
-		cd.pParam=pParam;
+		cd.param=appParam;
 
 		m_lock.lock();
 		m_lCalls.push_back(cd);
@@ -199,13 +208,120 @@
 		}
 		m_lock.unlock();
 	}
+
+	/** Clears the callback list. No function will be left.
+	 */
+	void clear()
+	{
+		m_lock.lock();
+		m_lCalls.clear();
+		m_lock.unlock();
+	}
 /**@}*/
 	
 protected:
 	std::list<_CALLBACKDATA2> m_lCalls;		///< List of the callback structures to execute
 	mutex m_lock;							///< Mutex for locking connect/disconnect calls
 };
 
+/** \brief Callback class with three parameters.
+ *
+ *  Class provides a simple interface for user to call a specific callback
+ *  function(s) registered by the user. Good for notifying user that something
+ *  had happened.
+ */
+template<class A1, class T1, class T2, class T3>
+class LIBICPF_API callback3
+{
+protected:
+	/// Callback3-type callback function
+	typedef void(*PFNCALLBACKPROC3)(A1, T1, T2, T3);
+
+	/// Helper structure for callback2 class
+	struct _CALLBACKDATA3
+	{
+		PFNCALLBACKPROC3 pfn;	///< Callback function that is to be called
+		A1 param;				///< The user parameter of a function to be called
+	};
+
+public:
+/** \name Construction/destruction */
+/**@{*/
+	callback3() { };		///< Standard constructor
+	~callback3() { };		///< Standard destructor
+/**@}*/
+
+/** \name User interface */
+/**@{*/
+	/** Executes a callback list associated with this object.
+	* \param[in] data1 - first parameter that will be passed to a user callback function
+	* \param[in] data2 - second parameter that will be passed to a user callback function
+	* \param[in] data3 - third parameter that will be passed to a user callback function
+	*/
+	void exec(T1 data1, T2 data2, T3 data3)
+	{
+		m_lock.lock();
+		try
+		{
+			for (std::list<_CALLBACKDATA3>::iterator it=m_lCalls.begin();it != m_lCalls.end();it++)
+				(*((*it).pfn))((*it).param, data1, data2, data3);
+			m_lock.unlock();
+		}
+		catch(...)
+		{
+			m_lock.unlock();
+			throw;
+		}
+	}
+	
+	/** Connects a user callback function to this object.
+	* \param[in] pfn - user callback function address
+	* \param[in] param - user parameter to pass to the callback function when executing
+	*/
+	void connect(PFNCALLBACKPROC3 pfn, A1 param)
+	{
+		_CALLBACKDATA2 cd;
+		cd.pfn=pfn;
+		cd.param=param;
+
+		m_lock.lock();
+		m_lCalls.push_back(cd);
+		m_lock.unlock();
+	}
+
+	/** Disconnects the user callback function if connected earlier.
+	* \param[in] pfn - address of a function to remove
+	*/
+	void disconnect(PFNCALLBACKPROC3 pfn)
+	{
+		m_lock.lock();
+		for (std::list<_CALLBACKDATA3>::iterator it=m_lCalls.begin();it != m_lCalls.end();it++)
+		{
+			if ( (*it).pfn == pfn )
+			{
+				m_lCalls.erase(it);
+				m_lock.unlock();
+				return;
+			}
+		}
+		m_lock.unlock();
+	}
+
+	/** Clears the callback list. No function will be left.
+	 */
+	void clear()
+	{
+		m_lock.lock();
+		m_lCalls.clear();
+		m_lock.unlock();
+	}
+/**@}*/
+	
+protected:
+	std::list<_CALLBACKDATA3> m_lCalls;		///< List of the callback structures to execute
+	mutex m_lock;							///< Mutex for locking connect/disconnect calls
+};
+
 END_ICPF_NAMESPACE
 
 #endif