00001 /* 00002 * Copyright (c) 2008 - 2010 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 00020 typedef struct __of_list_object { 00022 struct __of_list_object *next; 00024 struct __of_list_object *prev; 00026 id object; 00027 } of_list_object_t; 00028 00032 @interface OFList: OFObject <OFCopying> 00033 { 00034 of_list_object_t *firstListObject; 00035 of_list_object_t *lastListObject; 00036 size_t count; 00037 } 00038 00039 #ifdef OF_HAVE_PROPERTIES 00040 @property (readonly) of_list_object_t *firstListObject; 00041 @property (readonly) of_list_object_t *lastListObject; 00042 @property (readonly) size_t count; 00043 #endif 00044 00048 + list; 00049 00053 - (of_list_object_t*)firstListObject; 00054 00058 - (of_list_object_t*)lastListObject; 00059 00068 - (of_list_object_t*)appendObject: (OFObject*)obj; 00069 00078 - (of_list_object_t*)prependObject: (OFObject*)obj; 00079 00089 - (of_list_object_t*)insertObject: (OFObject*)obj 00090 beforeListObject: (of_list_object_t*)listobj; 00091 00101 - (of_list_object_t*)insertObject: (OFObject*)obj 00102 afterListObject: (of_list_object_t*)listobj; 00103 00109 - (void)removeListObject: (of_list_object_t*)listobj; 00110 00114 - (size_t)count; 00115 @end