Steve DiBenedetto | 9f6c364 | 2014-03-10 17:02:27 -0600 | [diff] [blame] | 1 | /* -*- 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 | |
| 15 | namespace nfd { |
| 16 | |
| 17 | class AppFace; |
| 18 | |
| 19 | class SegmentPublisher : noncopyable |
| 20 | { |
| 21 | public: |
| 22 | SegmentPublisher(shared_ptr<AppFace> face, |
| 23 | const Name& prefix); |
| 24 | |
| 25 | virtual |
| 26 | ~SegmentPublisher(); |
| 27 | |
| 28 | void |
| 29 | publish(); |
| 30 | |
| 31 | protected: |
| 32 | |
| 33 | virtual size_t |
| 34 | generate(ndn::EncodingBuffer& outBuffer) =0; |
| 35 | |
| 36 | private: |
| 37 | void |
| 38 | publishSegment(shared_ptr<Data>& data); |
| 39 | |
| 40 | private: |
| 41 | shared_ptr<AppFace> m_face; |
| 42 | const Name m_prefix; |
| 43 | }; |
| 44 | |
| 45 | } // namespace nfd |
| 46 | |
| 47 | #endif // NFD_MGMT_SEGMENT_PUBLISHER_HPP |