/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2014-2018,  The University of Memphis
 *
 * This file is part of PSync.
 * See AUTHORS.md for complete list of PSync authors and contributors.
 *
 * PSync is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * PSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * PSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 **/

#ifndef PSYNC_STATE_HPP
#define PSYNC_STATE_HPP

#include <ndn-cxx/name.hpp>

namespace psync {

namespace tlv {

enum {
  PSyncContent = 128
};

} // namespace tlv

class State
{
public:
  explicit State(const ndn::Block& block);

  State() = default;

  void
  addContent(const ndn::Name& prefix);

  std::vector<ndn::Name>
  getContent() const
  {
    return m_content;
  }

  const ndn::Block&
  wireEncode() const;

  template<ndn::encoding::Tag TAG>
  size_t
  wireEncode(ndn::EncodingImpl<TAG>& block) const;

  void
  wireDecode(const ndn::Block& wire);

private:
  std::vector<ndn::Name> m_content;
  mutable ndn::Block m_wire;
};

NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(State);

std::ostream&
operator<<(std::ostream& os, const State& State);

} // namespace psync

#endif // PSYNC_STATE_HPP