Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 1 | /* -*- 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 Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 11 | #ifndef LINKNDN_CONTACT_ITEM_H |
| 12 | #define LINKNDN_CONTACT_ITEM_H |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 13 | |
| 14 | #include <ndn.cxx/data.h> |
| 15 | #include <vector> |
| 16 | #include "endorse-certificate.h" |
| 17 | |
| 18 | class ContactItem |
| 19 | { |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 20 | typedef std::vector<ndn::Ptr<EndorseCertificate> > EndorseCertificateList; |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 21 | |
| 22 | public: |
| 23 | ContactItem(const EndorseCertificate& selfEndorseCertificate, |
| 24 | const std::string& alias = std::string()); |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame^] | 25 | |
| 26 | ContactItem(const ContactItem& contactItem); |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 27 | |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame^] | 28 | virtual |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 29 | ~ContactItem() {} |
| 30 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 31 | inline const EndorseCertificate& |
| 32 | getSelfEndorseCertificate() const |
| 33 | { return m_selfEndorseCertificate; } |
| 34 | |
| 35 | inline const ndn::Name& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 36 | getNameSpace() const |
| 37 | { return m_namespace; } |
| 38 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 39 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 40 | getAlias() const |
| 41 | { return m_alias; } |
| 42 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 43 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 44 | getName() const |
| 45 | { return m_name; } |
| 46 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 47 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 48 | getInstitution() const |
| 49 | { return m_institution; } |
| 50 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 51 | inline const ndn::Name |
| 52 | getPublicKeyName() const |
| 53 | { return m_selfEndorseCertificate.getPublicKeyName(); } |
| 54 | |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame^] | 55 | inline bool |
| 56 | isIntroducer() |
| 57 | { return m_isIntroducer; } |
| 58 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 59 | protected: |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 60 | 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 Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame^] | 67 | |
| 68 | bool m_isIntroducer; |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | #endif |