kdecore Library API Documentation

krandomsequence.h

00001 /* This file is part of the KDE libraries 00002 Copyright (c) 1999 Sean Harmer <sh@astro.keele.ac.uk> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 #ifndef K_RANDOM_SEQUENCE_H 00019 #define K_RANDOM_SEQUENCE_H 00020 00021 class KRandomSequencePrivate; 00022 class QGList; 00037 class KRandomSequence 00038 { 00039 public: 00053 KRandomSequence( long lngSeed = 0 ); 00054 00058 virtual ~KRandomSequence(); 00059 00063 KRandomSequence(const KRandomSequence &a); 00064 00068 KRandomSequence &operator=(const KRandomSequence &a); 00069 00076 void setSeed( long lngSeed = 1 ); 00077 00083 double getDouble(); 00084 00091 unsigned long getLong(unsigned long max); 00092 00098 bool getBool(); 00099 00105 void randomize(QGList *list); 00106 00128 void modulate(int i); 00129 00130 private: 00131 void Draw(); // Generate the random number 00132 long m_lngSeed1; 00133 long m_lngSeed2; 00134 long m_lngShufflePos; 00135 00136 static const int m_nShuffleTableSize; 00137 long *m_ShuffleArray; 00138 00139 KRandomSequencePrivate *d; 00140 }; 00141 00142 #endif 00143
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Sep 29 09:43:10 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003