/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012 University of California, Los Angeles
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
 *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
 *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 */

#ifndef SYNC_NAME_INFO_H
#define SYNC_NAME_INFO_H

#include <boost/shared_ptr.hpp>
#include <map>
#include <string>
#include "sync-digest.h"

namespace Sync {

/**
 * @ingroup sync
 * @brief Templated class for the leaf name
 */
class NameInfo
{
private:
  typedef boost::shared_ptr<const NameInfo> const_ptr;
  
public:
  virtual ~NameInfo () { };

  /**
   * @brief Get ID of the record (should be locally-unique, but not really necessary---this is be used for hashing purposes)
   */
  size_t
  getHashId () const { return m_id; }
  
  virtual bool
  operator == (const NameInfo &info) const = 0;

  /**
   * @brief Calculates digest of the name
   */
  const Digest &
  getDigest () const { return m_digest; }

  /**
   * @brief Convert prefix to string
   * @returns string representation of prefix
   */
  virtual std::string
  toString () const = 0;

protected:
  // actual stuff
  size_t m_id; ///< @brief Identifies NameInfo throughout the library (for hash container, doesn't need to be strictly unique)
  Digest m_digest;

  // static stuff
  typedef std::map<std::string, const_ptr> NameMap;
  static size_t  m_ids;
  static NameMap m_names;
};

typedef boost::shared_ptr<NameInfo> NameInfoPtr;
typedef boost::shared_ptr<const NameInfo> NameInfoConstPtr;


} // Sync

#endif // SYNC_NAME_INFO_H
