blob: 578b894aff54f4f948d6cc3069f8699c86829cf3 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/third_party/quiche/src/quic/test_tools/simulator/actor.h"
6#include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
7
8namespace quic {
9namespace simulator {
10
vasilvvc48c8712019-03-11 13:38:16 -070011Actor::Actor(Simulator* simulator, std::string name)
QUICHE teama6ef0a62019-03-07 20:34:33 -050012 : simulator_(simulator),
13 clock_(simulator->GetClock()),
14 name_(std::move(name)) {
15 simulator_->AddActor(this);
16}
17
18Actor::~Actor() {
19 simulator_->RemoveActor(this);
20}
21
22void Actor::Schedule(QuicTime next_tick) {
23 simulator_->Schedule(this, next_tick);
24}
25
26void Actor::Unschedule() {
27 simulator_->Unschedule(this);
28}
29
30} // namespace simulator
31} // namespace quic