Yingdi Yu | fa4ce79 | 2014-02-06 18:09:22 -0800 | [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 | |
| 11 | #ifndef CHRONOS_INVITATION_H |
| 12 | #define CHRONOS_INVITATION_H |
| 13 | |
| 14 | |
| 15 | #include <ndn-cpp-dev/name.hpp> |
| 16 | #include <ndn-cpp-dev/signature.hpp> |
| 17 | |
| 18 | namespace chronos{ |
| 19 | |
| 20 | class Invitation |
| 21 | { |
| 22 | /* |
| 23 | * /ndn/broadcast/chronos/invitation/[invitee_namespace]/<chatroom_name>/<inviter_routing_prefix>/<timestamp>/<keylocator>/<signature> |
| 24 | */ |
| 25 | static const size_t NAME_SIZE_MIN; |
| 26 | static const size_t INVITEE_START; |
| 27 | static const ssize_t SIGNATURE; |
| 28 | static const ssize_t KEY_LOCATOR; |
| 29 | static const ssize_t TIMESTAMP; |
| 30 | static const ssize_t INVITER_PREFIX; |
| 31 | static const ssize_t CHATROOM; |
| 32 | static const ndn::Name INVITATION_PREFIX; |
| 33 | |
| 34 | public: |
| 35 | struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} }; |
| 36 | |
| 37 | Invitation() {} |
| 38 | |
| 39 | Invitation(const ndn::Name& interestName); |
| 40 | |
| 41 | Invitation(const ndn::Name &inviteeNameSpace, |
| 42 | const ndn::Name &chatroom, |
| 43 | const ndn::Name &inviterRoutingPrefix); |
| 44 | |
| 45 | Invitation(const Invitation& invitation); |
| 46 | |
| 47 | virtual |
| 48 | ~Invitation() {}; |
| 49 | |
| 50 | const ndn::Name& |
| 51 | getInviteeNameSpace() const |
| 52 | { return m_inviteeNameSpace; } |
| 53 | |
| 54 | const ndn::Name& |
| 55 | getChatroom() const |
| 56 | { return m_chatroom; } |
| 57 | |
| 58 | const ndn::Name& |
| 59 | getInviterRoutingPrefix() const |
| 60 | { return m_inviterRoutingPrefix; } |
| 61 | |
| 62 | const ndn::Name& |
| 63 | getUnsignedInterestName() const |
| 64 | { return m_interestName; } |
| 65 | |
| 66 | private: |
| 67 | ndn::Name m_interestName; |
| 68 | |
| 69 | ndn::Name m_inviteeNameSpace; |
| 70 | ndn::Name m_chatroom; |
| 71 | ndn::Name m_inviterRoutingPrefix; |
| 72 | }; |
| 73 | |
| 74 | }//chronos |
| 75 | |
| 76 | #endif |