blob: 4ae719bb393a921e0b140f681c236dd2800f7455 [file] [log] [blame]
Alexander Afanasyev68f2a952013-01-08 14:34:16 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012-2013 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
22#ifndef OBJECT_MANAGER_H
23#define OBJECT_MANAGER_H
24
25#include <string>
26#include <ccnx-wrapper.h>
27#include <hash-helper.h>
28#include <boost/filesystem.hpp>
29
30// everything related to managing object files
31
32class ObjectManager
33{
34public:
35 ObjectManager (Ccnx::CcnxWrapperPtr ccnx, const Ccnx::Name &localDeviceName, const boost::filesystem::path &folder);
36 virtual ~ObjectManager ();
37
38 HashPtr
39 storeLocalFile (const boost::filesystem::path &file);
40
41private:
42 Ccnx::CcnxWrapperPtr m_ccnx;
43 Ccnx::Name m_localDeviceName;
44 boost::filesystem::path m_folder;
45};
46
47typedef boost::shared_ptr<ObjectManager> ObjectManagerPtr;
48
49namespace Error {
50struct ObjectManager : virtual boost::exception, virtual std::exception { };
51}
52
53#endif // OBJECT_MANAGER_H