blob: faf8f2704bdd31758be7ba6ebdcb8c85774cbef9 [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
shockjiang99ad3892014-08-03 14:56:13 -070032class ZoneMgr: public DBMgr
shockjianga5ae48c2014-07-27 23:21:41 -070033{
34
35public:
shockjiang99ad3892014-08-03 14:56:13 -070036 ZoneMgr(Zone& zone);
shockjianga5ae48c2014-07-27 23:21:41 -070037
38public:
39 void
40 lookupId(const Name& name);
41
42 void
43 lookupId();
44
shockjiang99ad3892014-08-03 14:56:13 -070045 const Zone& getZone() const
46 {
shockjianga5ae48c2014-07-27 23:21:41 -070047 return m_zone;
48 }
49
shockjiang99ad3892014-08-03 14:56:13 -070050 void setZone(const Zone& zone)
51 {
shockjianga5ae48c2014-07-27 23:21:41 -070052 this->m_zone = zone;
53 }
54
55 int
56 callback_setId(int argc, char **argv, char **azColName);
57
shockjiang99ad3892014-08-03 14:56:13 -070058 static int static_callback_setId(void *param, int argc, char **argv,
59 char **azColName)
60 {
shockjianga5ae48c2014-07-27 23:21:41 -070061
shockjiang99ad3892014-08-03 14:56:13 -070062 ZoneMgr *mgr = reinterpret_cast<ZoneMgr*>(param);
63 return mgr->callback_setId(argc, argv, azColName);
64 }
shockjianga5ae48c2014-07-27 23:21:41 -070065
66private:
67 Zone& m_zone;
shockjiang99ad3892014-08-03 14:56:13 -070068};
69//class ZoneMgr
shockjianga5ae48c2014-07-27 23:21:41 -070070
71}//namespace ndns
shockjiang99ad3892014-08-03 14:56:13 -070072} //namespace ndn
shockjianga5ae48c2014-07-27 23:21:41 -070073#endif