Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CMsgQueue Class Reference

CMsgQueue. More...

#include <MsgQueue.h>

List of all members.

Public Member Functions

 CMsgQueue ()
 CMsgQueue.
 ~CMsgQueue ()
 CMsgQueue.
CMessagePop_Front ()
 Pop_Front.
void Push_Back (const CMessage *pMsg)
 Push_Back.
bool Empty () const
 Empty.
void CleanUp ()
 CleanUp.


Detailed Description

CMsgQueue.

Description: The CMsgQueue is a safe list that can be used by applications that require object created in dll files to add and remove items from a list. The CMsgQueue class does not immediately delete the internal nodes and other memory associated with the list when an item is removed from the queue. The memory can be safely removed later by calling CleanUp from the Dll or from the application.

Limitations: Whoever pushes messages into the queue is responsible for calling the cleanup function. If the messages are pushed by an object allocated in a dll file, some object from the dll file must call CleanUp. If this constraint is not satisfied, memory exceptions will occur!


Constructor & Destructor Documentation

CMsgQueue::CMsgQueue  ) 
 

CMsgQueue.

Description: This constructor initializes internal class variables.

Returns:
None
Limitations: None

CMsgQueue::~CMsgQueue  ) 
 

CMsgQueue.

Description: This destructor has been included for maintenance purposes only.

Returns:
void
Limitations:


Member Function Documentation

void CMsgQueue::CleanUp  ) 
 

CleanUp.

Description: Frees all memory associated with popped items that were "scheduled" for deletion.

Returns:
void
Limitations: Whoever pushes messages into the queue is responsible for calling the cleanup function. If the messages are pushed by an object allocated in a dll file, some object from the dll file must call CleanUp. If this constraint is not satisfied, memory exceptions will occur!

bool CMsgQueue::Empty  )  const
 

Empty.

Description: This function checks whether or not the queue is empty.

Returns:
bool: True if the queue is empty, false if at least one message is present.
Limitations: None

CMessage * CMsgQueue::Pop_Front  ) 
 

Pop_Front.

Description: Retrieves a message from the message queue. The retrieved message is popped from the top of the list.

Returns:
CMessage*: a poinnter to a copy of the topmost message.
Limitations: The responsibility of the deletion of the returned pointer is left to the object calling this function.

void CMsgQueue::Push_Back const CMessage pMsg  ) 
 

Push_Back.

Description: This function adds a COPY of the message to the message queue. The orignal message can be deleted if desired.

Parameters:
pMsg - The message whose copy will be added to the message queue.
Returns:
void
Limitations: Memory allocated in a dll file should be freed in a dll file. This means that a given instance of the message queue should only be added to (using the Push_Back function) by a single type of memory resident object. That is, if the object calling the function was allocated in a dll file, only objects created in the same dll memory can add messages to the queue. It is permissible, however, for any memory resident object to pop from the queue. Whoever pushes messages into the queue is responsible for calling the cleanup function. If this constraint is not satisfied, memory exceptions will occur!


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo