blob: 4dada26da6965c39fc5fe85ca89630e4f6c09433 [file] [log] [blame]
Yingdi Yudbeb8e22013-10-14 09:36:31 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
Yingdi Yud04ed1a2013-10-14 14:07:03 -070011#ifndef LINKNDN_CONTACT_ITEM_H
12#define LINKNDN_CONTACT_ITEM_H
Yingdi Yudbeb8e22013-10-14 09:36:31 -070013
14#include <ndn.cxx/data.h>
15#include <vector>
16#include "endorse-certificate.h"
17
18class ContactItem
19{
Yingdi Yud04ed1a2013-10-14 14:07:03 -070020 typedef std::vector<ndn::Ptr<EndorseCertificate> > EndorseCertificateList;
Yingdi Yudbeb8e22013-10-14 09:36:31 -070021
22public:
23 ContactItem(const EndorseCertificate& selfEndorseCertificate,
24 const std::string& alias = std::string());
Yingdi Yuec5e72a2013-11-03 15:05:26 -080025
26 ContactItem(const ContactItem& contactItem);
Yingdi Yudbeb8e22013-10-14 09:36:31 -070027
Yingdi Yuec5e72a2013-11-03 15:05:26 -080028 virtual
Yingdi Yudbeb8e22013-10-14 09:36:31 -070029 ~ContactItem() {}
30
Yingdi Yud04ed1a2013-10-14 14:07:03 -070031 inline const EndorseCertificate&
32 getSelfEndorseCertificate() const
33 { return m_selfEndorseCertificate; }
34
35 inline const ndn::Name&
Yingdi Yudbeb8e22013-10-14 09:36:31 -070036 getNameSpace() const
37 { return m_namespace; }
38
Yingdi Yud04ed1a2013-10-14 14:07:03 -070039 inline const std::string&
Yingdi Yudbeb8e22013-10-14 09:36:31 -070040 getAlias() const
41 { return m_alias; }
42
Yingdi Yud04ed1a2013-10-14 14:07:03 -070043 inline const std::string&
Yingdi Yudbeb8e22013-10-14 09:36:31 -070044 getName() const
45 { return m_name; }
46
Yingdi Yud04ed1a2013-10-14 14:07:03 -070047 inline const std::string&
Yingdi Yudbeb8e22013-10-14 09:36:31 -070048 getInstitution() const
49 { return m_institution; }
50
Yingdi Yud04ed1a2013-10-14 14:07:03 -070051 inline const ndn::Name
52 getPublicKeyName() const
53 { return m_selfEndorseCertificate.getPublicKeyName(); }
54
Yingdi Yuec5e72a2013-11-03 15:05:26 -080055 inline bool
56 isIntroducer()
57 { return m_isIntroducer; }
58
Yingdi Yud04ed1a2013-10-14 14:07:03 -070059protected:
Yingdi Yudbeb8e22013-10-14 09:36:31 -070060 EndorseCertificate m_selfEndorseCertificate;
61
62 ndn::Name m_namespace;
63 std::string m_alias;
64
65 std::string m_name;
66 std::string m_institution;
Yingdi Yuec5e72a2013-11-03 15:05:26 -080067
68 bool m_isIntroducer;
Yingdi Yudbeb8e22013-10-14 09:36:31 -070069};
70
71#endif