[asycxx-devel] SF.net SVN: asycxx:[23] trunk
Status: Alpha
Brought to you by:
joe_steeve
From: <joe...@us...> - 2009-04-08 07:28:22
|
Revision: 23 http://asycxx.svn.sourceforge.net/asycxx/?rev=23&view=rev Author: joe_steeve Date: 2009-04-08 07:28:20 +0000 (Wed, 08 Apr 2009) Log Message: ----------- Generalized Deferred dont make sense here. Removed them. From: Joe Steeve <js...@hi...> Removed Paths: ------------- trunk/include/asycxx/Deferred.h trunk/src/Deferred.cxx Deleted: trunk/include/asycxx/Deferred.h =================================================================== --- trunk/include/asycxx/Deferred.h 2009-04-08 04:42:11 UTC (rev 22) +++ trunk/include/asycxx/Deferred.h 2009-04-08 07:28:20 UTC (rev 23) @@ -1,60 +0,0 @@ - -/******************************************************************** - * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All - * rights reserved. - * - * This program and the accompanying materials are made available - * under the terms described in the LICENSE file which accompanies - * this distribution. If the LICENSE file was not attached to this - * distribution or for further clarifications, please contact - * le...@hi.... - * - *******************************************************************/ - -#ifndef __HIPRO_ASYCXX__DEFERRED_H__ -#define __HIPRO_ASYCXX__DEFERRED_H__ - -#include "Error.h" -#include "_asycxx.h" - -typedef void (*cbDeferredOnEvent_t) (void *obj); -typedef void (*cbDeferredOnError_t) (void *obj); -typedef void (*cbDeferredOnTimeout_t) (void *obj, h_msecs_t excess_time); - -class Deferred -{ - -public: - Deferred (); - ~Deferred (); - - Deferred * OnEvent (cbDeferredOnEvent_t cb_fn, void *cb_obj) throw (); - Deferred * OnError (cbDeferredOnError_t cb_fn, void *cb_obj) throw (); - Deferred * OnTimeout (cbDeferredOnTimeout_t cb_fn, void *cb_obj) throw (); - - void NotifyEvent (void); - void NotifyError (void); - void NotifyTimeout (h_msecs_t excess_time); - -private: - cbDeferredOnEvent_t m_cbOnEvent; - void * m_cbOnEvent_obj; - - cbDeferredOnError_t m_cbOnError; - void * m_cbOnError_obj; - - cbDeferredOnTimeout_t m_cbOnTimeout; - void * m_cbOnTimeout_obj; - -}; - -#endif // __HIPRO_ASYCXX__DEFERRED_H__ - -/* - Local Variables: - mode: c++ - indent-tabs-mode: nil - tab-width: 4 - c-file-style: "gnu" - End: -*/ Deleted: trunk/src/Deferred.cxx =================================================================== --- trunk/src/Deferred.cxx 2009-04-08 04:42:11 UTC (rev 22) +++ trunk/src/Deferred.cxx 2009-04-08 07:28:20 UTC (rev 23) @@ -1,155 +0,0 @@ - -/******************************************************************** - * Copyright (C) 2008,2009 HiPro IT Solutions Pvt. Ltd., Chennai. All - * rights reserved. - * - * This program and the accompanying materials are made available - * under the terms described in the LICENSE file which accompanies - * this distribution. If the LICENSE file was not attached to this - * distribution or for further clarifications, please contact - * le...@hi.... - * - *******************************************************************/ - -#ifdef HAVE_CONFIG_H -#include <asycxx-config.h> -#endif - -#include <stdlib.h> -#include <errno.h> -#include <string.h> - -#include "asycxx-common.h" -#include <asycxx/Error.h> -#include <asycxx/Deferred.h> - - -/** - * \brief ctor - */ -Deferred::Deferred () -{ - -} - - -/** - * \brief dtor - */ -Deferred::~Deferred () -{ - m_cbOnEvent = NULL; - m_cbOnEvent_obj = NULL; - m_cbOnError = NULL; - m_cbOnError_obj = NULL; - m_cbOnTimeout = NULL; - m_cbOnTimeout_obj = NULL; -} - - -/** - * - * - */ -Deferred * -Deferred::OnEvent (cbDeferredOnEvent_t cb_fn, void *cb_obj) throw () -{ - if (cb_fn == NULL) - { - THROW (DevError, "cannot register cbDeferredOnEvent = 'NULL'"); - } - - m_cbOnEvent = cb_fn; - m_cbOnEvent_obj = cb_obj; - return this; -} - - -/** - * - * - */ -Deferred * -Deferred::OnError (cbDeferredOnError_t cb_fn, void *cb_obj) throw () -{ - if (cb_fn == NULL) - { - THROW (DevError, "cannot register cbDeferredOnError = 'NULL'"); - } - - m_cbOnError = cb_fn; - m_cbOnError_obj = cb_obj; - return this; -} - - -/** - * - * - */ -Deferred * -Deferred::OnTimeout (cbDeferredOnTimeout_t cb_fn, void *cb_obj) throw () -{ - if (cb_fn == NULL) - { - THROW (DevError, "cannot register cbDeferredOnTimeout = 'NULL'"); - } - - m_cbOnTimeout = cb_fn; - m_cbOnTimeout_obj = cb_obj; - return this; -} - - -/** - * - * - * - */ -void -Deferred::NotifyEvent (void) -{ - if (m_cbOnEvent != NULL) - { - m_cbOnEvent (m_cbOnEvent_obj); - } -} - - -/** - * - * - * - */ -void -Deferred::NotifyError (void) -{ - if (m_cbOnError != NULL) - { - m_cbOnError (m_cbOnError_obj); - } -} - - -/** - * - * - * - */ -void -Deferred::NotifyTimeout (h_msecs_t excess_time) -{ - if (m_cbOnTimeout != NULL) - { - m_cbOnTimeout (m_cbOnTimeout_obj, excess_time); - } -} - -/* - Local Variables: - mode: c++ - indent-tabs-mode: nil - tab-width: 4 - c-file-style: "gnu" - End: -*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |