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: DLREP.h,v 1.3 2002/02/01 08:46:17 spee Exp $ 00010 * 00011 * Class: CNDLREP --- Discrete LRE (LRE III), probability function 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 00034 #ifndef __CNDLREP_h 00035 #define __CNDLREP_h 00036 00037 00038 #include <CNCL/DLRE.h> // Base class 00039 00040 extern CNClassDesc CN_DLREP; // Class CNDLREP description 00041 00042 00046 class CNDLREP : public CNDLRE 00047 { 00048 public: /****** Constructors ******************************************/ 00049 00051 CNDLREP(double*, long, double, double = 0.0, 00052 const char* = NIL, const char* = NIL, 00053 bool = false, unsigned long = ULONG_MAX); 00054 00056 CNDLREP(double, double, double, double, double = 0.0, 00057 const char* = NIL, const char* = NIL, 00058 bool = false, unsigned long = ULONG_MAX); 00059 00061 CNDLREP(CNParam *) {} 00062 00064 ~CNDLREP() {} 00065 00066 private: 00068 CNDLREP() {} 00069 00070 public: /****** Public interface **************************************/ 00071 void put( double ); 00072 00075 virtual const struct CNDLRE::resultline *get_result( long ); 00076 00077 virtual void change_error( double ); 00078 00079 private: 00081 Phase rtc(); // runtime control 00082 00083 private: /****** Internal private members ******************************/ 00084 bool force_cf; 00085 00086 public: /****** Member functions required by CNCL *********************/ 00087 virtual CNClassDesc class_desc() const // CNClass description 00088 { return CN_DLREP; } 00089 00091 virtual bool is_a(CNClassDesc desc) const // Type checking 00092 { return desc == CN_DLREP ? TRUE : CNDLRE::is_a(desc); } 00093 00095 static CNDLREP *cast_from_object(CNObject *obj) 00096 { 00097 # ifdef NO_TYPE_CHECK 00098 return (CNDLREP *)obj; 00099 # else 00100 return (CNDLREP *)( !obj || obj->is_a(CN_DLREP) 00101 ? obj : fatal_type(obj->class_desc(), CN_DLREP) ); 00102 # endif 00103 } 00104 00107 static CNObject *new_object(CNParam *param = NIL) 00108 { return param ? new CNDLREP(param) : new CNDLREP; } 00109 00111 virtual void print(ostream &strm = cout) const; 00113 virtual void dump (ostream &strm = cout) const; 00114 }; 00115 00116 00117 00118 ostream &operator << (ostream &strm, const CNDLREP &obj); 00119 ostream &operator << (ostream &strm, const CNDLREP *obj); 00120 00121 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001