File: programming/cocoa/Filie.zip/Filie/Filie/UKThreadActionQueue.m


/* =============================================================================
    PROJECT:    Filie
    FILE:       UKThreadActionQueue.m
    
    COPYRIGHT:  (c) 2004 by M. Uli Kusterer, all rights reserved.
    
    AUTHORS:    M. Uli Kusterer - UK
    
    LICENSES:   GNU GPL, Modified BSD
    
    REVISIONS:
        2004-11-23  UK  Created.
   ========================================================================== */
 
// -----------------------------------------------------------------------------
//  Headers:
// -----------------------------------------------------------------------------
 
#import "UKThreadActionQueue.h"
#include <unistd.h>
// -----------------------------------------------------------------------------
//	initWithMessage:
//		Create a new queue and specify the message it will send to each object
//      in the queue.
//
//	REVISIONS:
//		2004-12-22	UK	Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//	release:
//		Since NSThread retains its target, we need this method to terminate the
//      thread when we reach a retain-count of two.
//
//	REVISIONS:
//		2004-11-12	UK	Created.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//	addObject:
//		Append a new object to the queue.
//
//	REVISIONS:
//		2004-12-22	UK	Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//	setMessage:
//		Change the message to be sent to objects in the queue. This will also
//      change the message for all objects still in the queue.
//
//	REVISIONS:
//		2004-12-22	UK	Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//	message:
//		Return the message that'll be sent to objects in the queue.
//
//	REVISIONS:
//		2004-12-22	UK	Documented.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//	sendMessages:
//		Thread action that keeps looping and processes the queue in batches.
//
//	REVISIONS:
//		2004-12-22	UK	Documented.
// -----------------------------------------------------------------------------
// Release this every 16 items.
//[obj performSelectorOnMainThread: message withObject: nil waitUntilDone: YES];    // Quick fix for Filie.
"Exception during queued message '%@': %@"

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.