krandomsequence.h
/* This file is part of the KDE libraries
Copyright (c) 1999 Sean Harmer <sh@astro.keele.ac.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef K_RANDOM_SEQUENCE_H
#define K_RANDOM_SEQUENCE_H
#include "kdelibs_export.h"
class KRandomSequencePrivate;
class QGList;
class KDECORE_EXPORT KRandomSequence
{
public:
KRandomSequence( long lngSeed = 0 );
virtual ~KRandomSequence();
KRandomSequence(const KRandomSequence &a);
KRandomSequence &operator=(const KRandomSequence &a);
void setSeed( long lngSeed = 0 );
double getDouble();
unsigned long getLong(unsigned long max);
bool getBool();
void randomize(QGList *list);
void modulate(int i);
private:
void Draw(); // Generate the random number
long m_lngSeed1;
long m_lngSeed2;
long m_lngShufflePos;
static const int m_nShuffleTableSize;
long *m_ShuffleArray;
KRandomSequencePrivate *d;
};
#endif
KRandomSequence
A class to create a pseudo-random sequence.
Definition: krandomsequence.h:39

KDE Home | KDE Accessibility Home | Description of Access Keys