Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

InsertionSort.h

00001 // -*- C++ -*-
00002 /*****************************************************************************
00003  *
00004  *   |_|_|_  |_|_    |_    |_|_|_  |_                C O M M U N I C A T I O N
00005  * |_        |_  |_  |_  |_        |_                          N E T W O R K S
00006  * |_        |_  |_  |_  |_        |_                                C L A S S
00007  *   |_|_|_  |_    |_|_    |_|_|_  |_|_|_|_                      L I B R A R Y
00008  *
00009  * $Id: InsertionSort.h,v 1.4 2002/01/14 11:41:35 spee Exp $
00010  *
00011  * Class: CNInsertionSort --- ...
00012  *
00013  *****************************************************************************
00014  * Copyright (C) 1992-2002   Communication Networks
00015  *                           Aachen University of Technology
00016  *                           D-52056 Aachen
00017  *                           Germany
00018  *                           Email: cncl-adm@comnets.rwth-aachen.de
00019  *****************************************************************************
00020  * This file is part of the CN class library. All files marked with
00021  * this header are free software; you can redistribute it and/or modify
00022  * it under the terms of the GNU Library General Public License as
00023  * published by the Free Software Foundation; either version 2 of the
00024  * License, or (at your option) any later version.  This library is
00025  * distributed in the hope that it will be useful, but WITHOUT ANY
00026  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
00027  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00028  * License for more details.  You should have received a copy of the GNU
00029  * Library General Public License along with this library; if not, write
00030  * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
00031  * USA.
00032  * 
00033  * As an exception to this rule you may use this template to generate
00034  * your own classes. This does not cause these classes to be covered by
00035  * the GNU Library General Public License. This exception does not
00036  * however invalidate any other reasons why the resulting program must be
00037  * covered by the GNU Library General Public License. 
00038  *****************************************************************************/
00039 
00040 #ifndef __CNInsertionSort_h
00041 #define __CNInsertionSort_h
00042 
00043 #include <CNCL/Sort.h>          // Base class
00044 
00045 extern CNClassDesc CN_INSERTIONSORT;    // Class CNInsertionSort description
00046 
00050 class CNInsertionSort : public CNSort
00051 {
00052   public:       /****** Constructors ******************************************/
00054     CNInsertionSort()          {}
00056     CNInsertionSort(CNParam *) {}
00057 
00058   public:       /***** Public interface **************************************/
00060     size_t sort(OrderType order = NORMAL) {
00061         order = order;
00062         fatal("not yet implemented");
00063         return 0;
00064     };
00065     
00066   private:      /***** Internal private members ******************************/
00067 
00068   public:       /****** Member functions required by CNCL *********************/
00069     virtual CNClassDesc class_desc() const      // CNClass description
00070     { return CN_INSERTIONSORT; }
00071             
00073     virtual bool is_a(CNClassDesc desc) const   
00074         { return desc == CN_INSERTIONSORT ? TRUE : CNSort::is_a(desc); }
00075     
00077     static CNInsertionSort *cast_from_object(CNObject *obj) 
00078     {
00079 #   ifdef NO_TYPE_CHECK
00080         return (CNInsertionSort *)obj;
00081 #   else
00082         return (CNInsertionSort *)( !obj || obj->is_a(CN_INSERTIONSORT)
00083                ? obj : fatal_type(obj->class_desc(), CN_INSERTIONSORT) );
00084 #   endif
00085     }
00086     
00089     static CNObject *new_object(CNParam *param = NIL) 
00090     { return param ? new CNInsertionSort(param) : new CNInsertionSort; }
00091     
00093     virtual void print(ostream &strm = cout) const;
00095     virtual void dump (ostream &strm = cout) const;
00096 };
00097 
00098 ostream &operator << (ostream &strm, const CNInsertionSort &obj);
00099 ostream &operator << (ostream &strm, const CNInsertionSort *obj);
00100 
00101 #endif 

Generated on Fri Feb 1 19:53:52 2002 for CNCL by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001