blob: 4b5dc4f1a948a4048537c293c055ddb05a1d094a [file] [log] [blame]
Steve DiBenedetto9f6c3642014-03-10 17:02:27 -06001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NFD_MGMT_SEGMENT_PUBLISHER_HPP
8#define NFD_MGMT_SEGMENT_PUBLISHER_HPP
9
10#include "common.hpp"
11#include "mgmt/app-face.hpp"
12
13#include <ndn-cpp-dev/encoding/encoding-buffer.hpp>
14
15namespace nfd {
16
17class AppFace;
18
19class SegmentPublisher : noncopyable
20{
21public:
22 SegmentPublisher(shared_ptr<AppFace> face,
23 const Name& prefix);
24
25 virtual
26 ~SegmentPublisher();
27
28 void
29 publish();
30
31protected:
32
33 virtual size_t
34 generate(ndn::EncodingBuffer& outBuffer) =0;
35
36private:
37 void
38 publishSegment(shared_ptr<Data>& data);
39
40private:
41 shared_ptr<AppFace> m_face;
42 const Name m_prefix;
43};
44
45} // namespace nfd
46
47#endif // NFD_MGMT_SEGMENT_PUBLISHER_HPP