You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/05/06 23:09:47 UTC

svn commit: r941929 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h

Author: tabish
Date: Thu May  6 21:09:46 2010
New Revision: 941929

URL: http://svn.apache.org/viewvc?rev=941929&view=rev
Log:
Update the methods to make some virtual so the Random Number Generator can be extended.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h?rev=941929&r1=941928&r2=941929&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Random.h Thu May  6 21:09:46 2010
@@ -85,16 +85,6 @@ namespace util{
         bool nextBoolean();
 
         /**
-         * Modifies the byte array by a random sequence of bytes generated
-         * by this random number generator.
-         *
-         * @param buf non-null array to contain the new random bytes
-         *
-         * @see #next
-         */
-        void nextBytes( std::vector<unsigned char>& buf );
-
-        /**
          * Generates a normally distributed random double number between
          * 0.0 inclusively and 1.0 exclusively.
          *
@@ -164,6 +154,18 @@ namespace util{
          */
         long long nextLong();
 
+    public:  // Virtual Methods
+
+        /**
+         * Modifies the byte array by a random sequence of bytes generated
+         * by this random number generator.
+         *
+         * @param buf non-null array to contain the new random bytes
+         *
+         * @see #next
+         */
+        virtual void nextBytes( std::vector<unsigned char>& buf );
+
         /**
          * Modifies the seed using linear congruential formula presented
          * in <i>The Art of Computer Programming, Volume 2</i>, Section
@@ -176,9 +178,9 @@ namespace util{
          * @see #Random()
          * @see #Random(long)
          */
-        void setSeed( unsigned long long seed );
+        virtual void setSeed( unsigned long long seed );
 
-    protected:
+    protected:  // Virtual method used by all non-virtual methods in Random.
 
         /**
          * Answers a pseudo-random uniformly distributed <code>int</code>