Changeset 24522

Show
Ignore:
Timestamp:
03/22/08 10:36:20 (8 months ago)
Author:
nielx
Message:

First version of the BMessageQueue documentation.

Note: I have cleared the original MessageQueue.cpp file from the inline documentation. When the storage kit comes up, we need to rediscuss the documentation policy.

Location:
haiku/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/kits/app/MessageQueue.cpp

    r19956 r24522  
    2626 
    2727 
    28 /*! 
    29         \brief This is the desctructor for the BMessageQueue.  It iterates over 
    30                 any messages left on the queue and deletes them. 
    31  
    32         The implementation is careful not to release the lock when the 
    33         BMessageQueue is deconstructed.  If the lock is released, it is 
    34         possible another thread will start an AddMessage() operation before 
    35         the BLocker is deleted.  The safe thing to do is not to unlock the 
    36         BLocker from the destructor once it is acquired. That way, any thread 
    37         waiting to do a AddMessage() will fail to acquire the lock since the 
    38         BLocker will be deleted before they can acquire it. 
    39 */ 
    4028BMessageQueue::~BMessageQueue() 
    4129{ 
     
    5341 
    5442 
    55 /*! 
    56         \brief This method adds a BMessage to the queue. 
    57  
    58         It makes a couple of assumptions: 
    59                 - The BMessage was allocated on the heap with new, since the 
    60                   destructor delete's BMessages left on the queue. 
    61                 - The BMessage is not already on this or any other BMessageQueue. 
    62                   If it is, the queue it is already on will be corrupted. 
    63 */ 
    6443void 
    6544BMessageQueue::AddMessage(BMessage* message) 
     
    8968 
    9069 
    91 /*! 
    92         \brief This method searches the queue for a particular BMessage. 
    93                 If it is found, it is removed from the queue. 
    94 */ 
    9570void 
    9671BMessageQueue::RemoveMessage(BMessage* message) 
     
    12398 
    12499 
    125 /*! 
    126         \brief This method just returns the number of BMessages on the queue. 
    127 */ 
    128100int32 
    129101BMessageQueue::CountMessages() const 
     
    133105 
    134106 
    135 /*! 
    136         \brief This method just returns true if there are no BMessages on the queue. 
    137 */ 
    138107bool 
    139108BMessageQueue::IsEmpty() const 
     
    143112 
    144113 
    145 /*! 
    146         \brief This method searches the queue for the index'th BMessage. 
    147          
    148         The first BMessage is at index 0, the second at index 1 etc. 
    149         The BMessage is returned if it is found.  If no BMessage exists at that 
    150         index (ie the queue is not that long or the index is invalid) NULL is 
    151         returned. 
    152 */ 
    153114BMessage * 
    154115BMessageQueue::FindMessage(int32 index) const 
     
    173134 
    174135 
    175 /*! 
    176         \brief Searches the queue for the index'th BMessage that has a 
    177                 particular what code. 
    178 */ 
    179136BMessage * 
    180137BMessageQueue::FindMessage(uint32 what, int32 index) const 
     
    201158 
    202159 
    203 /*! 
    204         \brief Locks the BMessageQueue so no other thread can change 
    205                 or search the queue. 
    206 */ 
    207160bool 
    208161BMessageQueue::Lock() 
     
    212165 
    213166 
    214 /*! 
    215         \brief Releases the lock which was acquired by Lock(). 
    216 */ 
    217167void 
    218168BMessageQueue::Unlock() 
     
    222172 
    223173 
    224 /*! 
    225         \brief Returns whether or not the queue is locked 
    226 */ 
    227174bool 
    228175BMessageQueue::IsLocked() const 
     
    232179 
    233180 
    234 /*! 
    235         \brief Removes the first BMessage on the queue and returns 
    236                 it to the caller.  If the queue is empty, NULL is returned. 
    237 */ 
    238181BMessage * 
    239182BMessageQueue::NextMessage() 
     
    263206 
    264207 
    265 /*! 
    266         \brief Checks wether or not the specified \a message is the message 
    267                 you would get when calling NextMessage(). 
    268 */ 
    269208bool 
    270209BMessageQueue::IsNextMessage(const BMessage* message) const