summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/mir_contactqueue.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-02 15:53:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-02 15:53:19 +0000
commitddace4b7aeb7bb5b9008fa6879696b3443fe6a98 (patch)
treeca4cafea3034ff7d7b7ac8cb36db830c3019c00a /plugins/UserInfoEx/src/mir_contactqueue.h
parentc9800ae6522dd29238a762e4a7b6f64123af567b (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@13376 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/mir_contactqueue.h')
-rw-r--r--plugins/UserInfoEx/src/mir_contactqueue.h75
1 files changed, 22 insertions, 53 deletions
diff --git a/plugins/UserInfoEx/src/mir_contactqueue.h b/plugins/UserInfoEx/src/mir_contactqueue.h
index 32ccdd1eaa..efd9fbd1dd 100644
--- a/plugins/UserInfoEx/src/mir_contactqueue.h
+++ b/plugins/UserInfoEx/src/mir_contactqueue.h
@@ -33,10 +33,8 @@ struct CQueueItem
PVOID param;
};
-/**
- *
- *
- **/
+/////////////////////////////////////////////////////////////////////////////////////////
+
class CContactQueue
{
public:
@@ -48,33 +46,23 @@ public:
STOPPED = 2
};
- CContactQueue (int initialSize = 10);
- ~CContactQueue ();
-
- inline int Size () const { return _queue.getCount();}
- inline int Remove (int idx) { mir_free(_queue[idx]); return _queue.remove(idx);}
- inline CQueueItem* Get (int idx) const { return _queue[idx];}
-
+ CContactQueue(int initialSize = 10);
+ ~CContactQueue();
+ __forceinline int Size() const {
+ return _queue.getCount();
+ }
+
+ CQueueItem* Get(int idx) const {
+ return _queue[idx];
+ }
+
void RemoveAll();
- /**
- * This function removes all queue items for the hContact.
- *
- * @param hContact - the contact whose queue items to delete
- *
- * @return nothing
- **/
+ // This function removes all queue items for the hContact.
void RemoveAll(MCONTACT hContact);
- /**
- * This function removes all queue items for the hContact considering the correct parameter.
- *
- * @param hContact - the contact whose queue items to delete
- * @param param - a caller defined parameter passed to the callback function
- *
- * @return nothing
- **/
+ // This function removes all queue items for the hContact considering the correct parameter.
void RemoveAllConsiderParam(MCONTACT hContact, PVOID param);
/**
@@ -128,19 +116,12 @@ public:
**/
BOOL AddUniqueConsiderParam (int waitTime, MCONTACT hContact, PVOID param = NULL);
- /**
- * This method resumes the worker thread and immitiatly goes on with the next entry.
- *
- * @param none
- *
- * @return nothing
- **/
+ // This method resumes the worker thread and immitiatly goes on with the next entry.
void ContinueWithNext();
protected:
-
- virtual void OnEmpty () {};
- virtual void Callback (MCONTACT hContact, PVOID param) = 0;
+ virtual void OnEmpty() {};
+ virtual void Callback(MCONTACT hContact, PVOID param) = 0;
/**
* This is the real thread callback function. As long as _status
@@ -155,32 +136,18 @@ protected:
**/
void Thread();
- /**
- * This is a static method to redirect the thread's callback function
- * to the desired class object.
- *
- * @param obj - pointer to the object (instance) of CContactQueue
- *
- * @return nothing
- **/
+ // This is a static method to redirect the thread's callback function
+ // to the desired class object.
static void ThreadProc(CContactQueue* obj)
{
obj->Thread();
}
- /**
- * This method suspends the worker thread for the given ammount of time.
- *
- * @param time - milliseconds to suspend the thread for
- *
- * @return nothing
- **/
+ // This method suspends the worker thread for the given ammount of time.
void Suspend(int time) const;
private:
-
LIST<CQueueItem> _queue;
-
mir_cs _cs;
HANDLE _hEvent;
EQueueStatus _status;
@@ -196,6 +163,8 @@ private:
* @retval FALSE - The item is not added to the queue.
**/
BOOL InternalAdd(int waitTime, MCONTACT hContact, PVOID param);
+
+ void Remove(int idx);
};
#endif // __CONTACTASYNCQUEUE_H__ \ No newline at end of file