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()); |
| 25 | |
| 26 | ~ContactItem() {} |
| 27 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame^] | 28 | inline const EndorseCertificate& |
| 29 | getSelfEndorseCertificate() const |
| 30 | { return m_selfEndorseCertificate; } |
| 31 | |
| 32 | inline const ndn::Name& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 33 | getNameSpace() const |
| 34 | { return m_namespace; } |
| 35 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame^] | 36 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 37 | getAlias() const |
| 38 | { return m_alias; } |
| 39 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame^] | 40 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 41 | getName() const |
| 42 | { return m_name; } |
| 43 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame^] | 44 | inline const std::string& |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 45 | getInstitution() const |
| 46 | { return m_institution; } |
| 47 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame^] | 48 | inline const ndn::Name |
| 49 | getPublicKeyName() const |
| 50 | { return m_selfEndorseCertificate.getPublicKeyName(); } |
| 51 | |
| 52 | protected: |
Yingdi Yu | 53b8a9c | 2013-10-14 09:36:31 -0700 | [diff] [blame] | 53 | EndorseCertificate m_selfEndorseCertificate; |
| 54 | |
| 55 | ndn::Name m_namespace; |
| 56 | std::string m_alias; |
| 57 | |
| 58 | std::string m_name; |
| 59 | std::string m_institution; |
| 60 | }; |
| 61 | |
| 62 | #endif |