Files
sdk/runtime/vm/random.h
T
iposva@google.com fd8565b071 - Add a minimal implementation of Capability.
- Make RawReceivePort and SendPort VM internal objects.
- Rationalize the creation of ports and their handling within the VM.

R=asiva@google.com

Review URL: https://codereview.chromium.org//243973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35325 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 19:44:03 +00:00

35 lines
675 B
C++

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef VM_RANDOM_H_
#define VM_RANDOM_H_
#include "vm/globals.h"
#include "vm/allocation.h"
namespace dart {
class Random {
public:
Random();
~Random();
uint32_t NextUInt32();
uint64_t NextUInt64() {
return (static_cast<uint64_t>(NextUInt32()) << 32) |
static_cast<uint64_t>(NextUInt32());
}
private:
void NextState();
uint64_t _state;
DISALLOW_COPY_AND_ASSIGN(Random);
};
} // namespace dart
#endif // VM_RANDOM_H_