blob: 34b853a4b31e3769f5ea1540e4c7d58e26e849a4 [file] [log] [blame]
Alexander Afanasyev2fc2d672012-03-05 16:57:39 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
19 * 卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
20 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
21 */
22
23#ifndef SYNC_STD_NAME_INFO_H
24#define SYNC_STD_NAME_INFO_H
25
26#include "sync-name-info.h"
27#include <string>
28
29namespace Sync {
30
31class StdNameInfo : public NameInfo
32{
33public:
34 /**
35 * @brief Lookup existing or create new NameInfo object
36 * @param name routable prefix
37 */
38 static NameInfoConstPtr
39 FindOrCreate (const std::string &name);
40
41 virtual ~StdNameInfo () { };
42
43 // from NameInfo
44 virtual bool
45 operator == (const NameInfo &info) const;
46
47 virtual std::string
48 toString () const;
49
50private:
51 // implementing a singleton pattern.
52 /**
53 * @brief Disabled default constructor. NameInfo object should be created through FindOrCreate static call.
54 */
55
56 /**
57 * @brief Disabled default
58 */
59 StdNameInfo () {}
60 StdNameInfo& operator = (const StdNameInfo &info) { return *this; }
61 StdNameInfo (const std::string &name);
62
63 std::string m_name;
64};
65
66} // Sync
67
68#endif // SYNC_CCNX_NAME_INFO_H