blob: 8ced971d9da9677b4d74a3484b9c3a2f4e5b7bcf [file] [log] [blame]
shockjianga5ae48c2014-07-27 23:21:41 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014, Regents of the University of California.
4 *
5 * This file is part of NDNS (Named Data Networking Domain Name Service).
6 * See AUTHORS.md for complete list of NDNS authors and contributors.
7 *
8 * NDNS is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * NDNS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * NDNS, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef NDNS_ZONE_MGR_CPP
21#define NDNS_ZONE_MGR_CPP
22
23#include <sqlite3.h>
24
25#include "db-mgr.hpp"
26#include "zone.hpp"
27#include <ndn-cxx/name.hpp>
28
29namespace ndn {
30namespace ndns {
31
32class ZoneMgr : public DBMgr
33{
34
35public:
36 ZoneMgr( Zone& zone);
37
38public:
39 void
40 lookupId(const Name& name);
41
42 void
43 lookupId();
44
45 const Zone& getZone() const {
46 return m_zone;
47 }
48
49 void setZone(const Zone& zone) {
50 this->m_zone = zone;
51 }
52
53 int
54 callback_setId(int argc, char **argv, char **azColName);
55
56
57 static int
58 static_callback_setId(void *param, int argc, char **argv, char **azColName){
59
60 ZoneMgr *mgr = reinterpret_cast<ZoneMgr*>(param);
61 return mgr->callback_setId(argc, argv, azColName);
62 }
63
64private:
65 Zone& m_zone;
66};//class ZoneMgr
67
68
69
70}//namespace ndns
71}//namespace ndn
72#endif