Alexander Afanasyev | 8811b35 | 2013-01-02 12:51:15 -0800 | [diff] [blame] | 1 | /* -*- 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 Afanasyev | 49a1852 | 2013-01-18 17:49:04 -0800 | [diff] [blame] | 22 | #include "fetch-manager.h" |
| 23 | #include <boost/make_shared.hpp> |
| 24 | #include <boost/ref.hpp> |
| 25 | #include <boost/throw_exception.hpp> |
| 26 | |
| 27 | using namespace boost; |
| 28 | using namespace std; |
| 29 | using namespace Ccnx; |
| 30 | |
| 31 | FetchManager::FetchManager (CcnxWrapperPtr ccnx, SyncLogPtr sync) |
| 32 | : m_ccnx (ccnx) |
| 33 | , m_sync (sync) |
Alexander Afanasyev | 8811b35 | 2013-01-02 12:51:15 -0800 | [diff] [blame] | 34 | { |
Alexander Afanasyev | e41e7d2 | 2013-01-19 15:13:47 -0800 | [diff] [blame^] | 35 | m_scheduler = make_shared<Scheduler> (); |
| 36 | m_scheduler->start (); |
Alexander Afanasyev | 49a1852 | 2013-01-18 17:49:04 -0800 | [diff] [blame] | 37 | } |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 38 | |
Alexander Afanasyev | 49a1852 | 2013-01-18 17:49:04 -0800 | [diff] [blame] | 39 | FetchManager::~FetchManager () |
| 40 | { |
Alexander Afanasyev | e41e7d2 | 2013-01-19 15:13:47 -0800 | [diff] [blame^] | 41 | m_scheduler->shutdown (); |
| 42 | m_scheduler.reset (); |
Alexander Afanasyev | 49a1852 | 2013-01-18 17:49:04 -0800 | [diff] [blame] | 43 | } |
Alexander Afanasyev | 8811b35 | 2013-01-02 12:51:15 -0800 | [diff] [blame] | 44 | |
Alexander Afanasyev | 49a1852 | 2013-01-18 17:49:04 -0800 | [diff] [blame] | 45 | void |
| 46 | FetchManager::Enqueue (const Ccnx::Name &deviceName, uint32_t minSeqNo, uint32_t maxSeqNo, int priority/*=PRIORITY_NORMAL*/) |
| 47 | { |
| 48 | } |
Alexander Afanasyev | e41e7d2 | 2013-01-19 15:13:47 -0800 | [diff] [blame^] | 49 | |
| 50 | Ccnx::CcnxWrapperPtr |
| 51 | FetchManager::GetCcnx () |
| 52 | { |
| 53 | return m_ccnx; |
| 54 | } |
| 55 | |
| 56 | SchedulerPtr |
| 57 | FetchManager::GetScheduler () |
| 58 | { |
| 59 | return m_scheduler; |
| 60 | } |