FBX SDK Reference Guide: kset.h Source File
00001 /**********************************************************************
00002 
00003  $Source: k:/usr/kaydara/SunTan/dev//1.5/RCS/include/klib/kset.h,v $
00004  $Revision: 1.6 $ $Date: 1998/03/13 18:29:16 $
00005  Last checked in by $Author: llaprise $
00006  
00007   This file contains the KSet declaration. KSet is
00008   a class that contains a llst of relations in the forme of 
00009   int Sets
00010   
00011  (C) Copyright 1994-1995 Kaydara, Inc.
00012  ALL RIGHTS RESERVED
00013  
00014   THIS IS UNPUBLISHED PROPRIETARY  SOURCE CODE OF Kaydara inc.
00015  The copyright  notice above  does not evidence any  actual or
00016  intended  publication  of this source code and material is an
00017  unpublished  work by  Kaydara,  Inc.  This  material contains 
00018  CONFIDENTIAL  INFORMATION  that is  the  property and a trade 
00019  secret of  Kaydara, Inc. Any use,  duplication or  disclosure
00020  not specifically authorized in writing by Kaydara is strictly
00021  prohibited.  THE  RECEIPT OR  POSSESSION  OF THIS SOURCE CODE
00022  AND/OR INFORMATION DOES NOT CONVEY  ANY RIGHTS TO  REPRODUCE, 
00023  DISCLOSE OR  DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE, USE, 
00024  OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
00025  
00026 ************************************************************************/
00027 
00028 #ifndef _FBXSDK_KSET_H_
00029 #define _FBXSDK_KSET_H_
00030 
00031 #include <kbaselib_h.h>
00032 
00033 #include <kbaselib_nsbegin.h>
00034 
00035     #define KITEM_PER_BLOCK   20
00036     #define NOT_FOUND          0x0L
00037 
00038     struct SSet;
00039 
00040     // *************************************************************************
00041     //
00042     //  class KSet
00043     //
00044     // ************************************************************************* 
00045 
00049     class KBASELIB_DLL KSet {
00050     public:
00055 
00056         
00060         KSet( int pItemPerBlock = KITEM_PER_BLOCK );
00061 
00065         KSet(const KSet& other);
00066 
00068         ~KSet();
00070 
00071         // Add and remove
00078         bool  Add       ( kReference pReference, kReference pItem );
00079 
00080         
00085         bool  Remove        ( kReference pReference );
00086         
00091         bool  RemoveItem    ( kReference pItem );
00092 
00098         bool  SetItem   ( kReference pReference, kReference pItem ); // Change Item Reference, don't Create if doesn't Exist
00099 
00105         kReference Get ( kReference pReference, int* pIndex = NULL ) const;
00106 
00108         void     Clear();
00109 
00110         // Index manipulation
00116         kReference GetFromIndex ( int pIndex, kReference* pReference = NULL )const;
00117 
00122         bool  RemoveFromIndex( int pIndex );
00123 
00124         // Get The Count
00128         int  GetCount ()const       { return mSetCount; }
00129 
00130         // Sorting
00135         bool  Swap()const;
00136 
00137         //The array can be sorted only if the private member:mIsChanged be true.
00141         bool  Sort()const;
00142 
00144         const KSet& operator=(const KSet&);
00145 
00146     private:
00147         // internal functions for Sets manipulation
00148         SSet*   FindEqual( kReference pReference)const;
00149 
00150     private:
00151         SSet*   mSetArray;
00152         int     mSetCount;
00153         int     mBlockCount;
00154         int     mItemPerBlock;
00155         mutable bool    mIsChanged;
00156     };
00157 
00158 #include <kbaselib_nsend.h>
00159 
00160 #endif // _FBXSDK_KSET_H_
00161