home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.4 KB | 103 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWOrdCol.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFound.hpp"
-
- #ifndef FWORDCOL_H
- #include "FWOrdCol.h"
- #endif
-
- #ifndef FWODEXCE_H
- #include "FWODExce.h"
- #endif
-
- //======================================================================================
- // Runtime Informations
- //======================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwcollec
- #endif
-
- //======================================================================================
- // Default Matching Proc
- //======================================================================================
-
- static FW_Boolean FW_PrivOrderedCollection_DefaultMatchProc(const void* v1, const void* v2)
- {
- return (v1 == v2);
- }
-
- //======================================================================================
- // Class FW_CPrivOrderedCollection
- //======================================================================================
-
- FW_DEFINE_AUTO(FW_CPrivOrderedCollection)
-
- //--------------------------------------------------------------------------------------
- // FW_CPrivOrderedCollection::FW_CPrivOrderedCollection
- //--------------------------------------------------------------------------------------
-
- FW_CPrivOrderedCollection::FW_CPrivOrderedCollection(FW_OrderedCollection_MatchProc matchProc) :
- fImplementation(NULL),
- fMatchProc(matchProc ? matchProc : &FW_PrivOrderedCollection_DefaultMatchProc)
- {
- FW_PlatformError error;
- fImplementation = FW_PrivNewLinkedList(&error);
- FW_FailOnError(error);
-
- FW_END_CONSTRUCTOR
- }
-
- //--------------------------------------------------------------------------------------
- // FW_CPrivOrderedCollection::~FW_CPrivOrderedCollection
- //--------------------------------------------------------------------------------------
-
- FW_CPrivOrderedCollection::~FW_CPrivOrderedCollection()
- {
- FW_START_DESTRUCTOR
- FW_PrivDeleteLinkedList(fImplementation);
- }
-
- //======================================================================================
- // FW_CPrivOrderedCollectionIterator
- //======================================================================================
-
- FW_DEFINE_AUTO(FW_CPrivOrderedCollectionIterator)
-
- //--------------------------------------------------------------------------------------
- // FW_CPrivOrderedCollectionIterator::FW_CPrivOrderedCollectionIterator
- //--------------------------------------------------------------------------------------
-
- FW_CPrivOrderedCollectionIterator::FW_CPrivOrderedCollectionIterator(const FW_CPrivOrderedCollection* collection)
- : fImplementation(NULL)
- {
- FW_PlatformError error;
- fImplementation = FW_PrivNewLinkedListIterator(collection ? collection->fImplementation : NULL, &error);
- FW_FailOnError(error);
-
- FW_END_CONSTRUCTOR
- }
-
- //--------------------------------------------------------------------------------------
- // FW_CPrivOrderedCollectionIterator::~FW_CPrivOrderedCollectionIterator
- //--------------------------------------------------------------------------------------
-
- FW_CPrivOrderedCollectionIterator::~FW_CPrivOrderedCollectionIterator()
- {
- FW_START_DESTRUCTOR
- FW_PrivDeleteLinkedListIterator(fImplementation);
- }
-
-
-
-
-
-
-