blob: b0154ea2cd46337cc3b9477274d54caebcc5412f [file] [log] [blame]
Alexander Afanasyev8811b352013-01-02 12:51:15 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 * Zhenkai Zhu <zhenkai@cs.ucla.edu>
20 */
21
Alexander Afanasyev49a18522013-01-18 17:49:04 -080022#include "fetch-manager.h"
23#include <boost/make_shared.hpp>
24#include <boost/ref.hpp>
25#include <boost/throw_exception.hpp>
26
27using namespace boost;
28using namespace std;
29using namespace Ccnx;
30
31FetchManager::FetchManager (CcnxWrapperPtr ccnx, SyncLogPtr sync)
32 : m_ccnx (ccnx)
33 , m_sync (sync)
Alexander Afanasyev8811b352013-01-02 12:51:15 -080034{
Alexander Afanasyeve41e7d22013-01-19 15:13:47 -080035 m_scheduler = make_shared<Scheduler> ();
36 m_scheduler->start ();
Alexander Afanasyev49a18522013-01-18 17:49:04 -080037}
Alexander Afanasyeva199f972013-01-02 19:37:26 -080038
Alexander Afanasyev49a18522013-01-18 17:49:04 -080039FetchManager::~FetchManager ()
40{
Alexander Afanasyeve41e7d22013-01-19 15:13:47 -080041 m_scheduler->shutdown ();
42 m_scheduler.reset ();
Alexander Afanasyev49a18522013-01-18 17:49:04 -080043}
Alexander Afanasyev8811b352013-01-02 12:51:15 -080044
Alexander Afanasyev49a18522013-01-18 17:49:04 -080045void
46FetchManager::Enqueue (const Ccnx::Name &deviceName, uint32_t minSeqNo, uint32_t maxSeqNo, int priority/*=PRIORITY_NORMAL*/)
47{
48}
Alexander Afanasyeve41e7d22013-01-19 15:13:47 -080049
50Ccnx::CcnxWrapperPtr
51FetchManager::GetCcnx ()
52{
53 return m_ccnx;
54}
55
56SchedulerPtr
57FetchManager::GetScheduler ()
58{
59 return m_scheduler;
60}