/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012-2014 University of California, Los Angeles
 *
 * This file is part of ChronoSync, synchronization library for distributed realtime
 * applications for NDN.
 *
 * ChronoSync 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.
 *
 * ChronoSync 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
 * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Zhenkai Zhu <http://irl.cs.ucla.edu/~zhenkai/>
 * @author Chaoyi Bian <bcy@pku.edu.cn>
 * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
 */

#ifndef SYNC_STD_NAME_INFO_H
#define SYNC_STD_NAME_INFO_H

#include "sync-name-info.h"
#include <string>

namespace Sync {

class StdNameInfo : public NameInfo
{
public:
  /**
   * @brief Lookup existing or create new NameInfo object
   * @param name routable prefix
   */
  static NameInfoConstPtr
  FindOrCreate (const std::string &name);

  /**
   * @brief Destructor which will clean up m_names structure
   */
  virtual ~StdNameInfo ();

  // from NameInfo
  virtual bool
  operator == (const NameInfo &info) const;

  virtual bool
  operator < (const NameInfo &info) const;

  virtual std::string
  toString () const;

private:
  // implementing a singleton pattern.
  /**
   * @brief Disabled default constructor. NameInfo object should be created through FindOrCreate static call.
   */

  /**
   * @brief Disabled default
   */
  StdNameInfo () {}
  StdNameInfo& operator = (const StdNameInfo &info) { (void)info; return *this; }
  StdNameInfo (const std::string &name);

  std::string m_name;
};

} // Sync

#endif // SYNC_CCNX_NAME_INFO_H
