bug+codestyle: Fix compile bugs and adjust code style

Change-Id: I008bb538441c099fa25b8b967fbf23ffce13a220
diff --git a/src/invitation.hpp b/src/invitation.hpp
new file mode 100644
index 0000000..c724661
--- /dev/null
+++ b/src/invitation.hpp
@@ -0,0 +1,118 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+#ifndef CHRONOS_INVITATION_HPP
+#define CHRONOS_INVITATION_HPP
+
+
+#include "common.hpp"
+
+#include <ndn-cxx/security/identity-certificate.hpp>
+
+namespace chronos {
+
+class Invitation
+{
+public:
+  /*
+   *  /[invitee_namespace]
+   *  /CHRONOCHAT-INVITATION
+   *  /<chatroom_name>
+   *  /<inviter_routing_prefix>
+   *  /<inviter_cert>
+   *  /<timestamp>
+   *  /<keylocator>
+   *  /<signature>
+   */
+  static const size_t NAME_SIZE_MIN;
+  static const ssize_t SIGNATURE;
+  static const ssize_t KEY_LOCATOR;
+  static const ssize_t TIMESTAMP;
+  static const ssize_t INVITER_CERT;
+  static const ssize_t INVITER_PREFIX;
+  static const ssize_t CHATROOM;
+  static const ssize_t CHRONOCHAT_INVITATION;
+
+  class Error : public std::runtime_error
+  {
+  public:
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
+
+  Invitation()
+  {
+  }
+
+  Invitation(const Name& interestName);
+
+  Invitation(const Name& inviteeNameSpace,
+             const std::string& chatroom,
+             const Name& inviterRoutingPrefix,
+             const ndn::IdentityCertificate& inviterCertificate);
+
+  Invitation(const Invitation& invitation);
+
+  virtual
+  ~Invitation()
+  {
+  }
+
+  const Name&
+  getInviteeNameSpace() const
+  {
+    return m_inviteeNameSpace;
+  }
+
+  const std::string&
+  getChatroom() const
+  {
+    return m_chatroom;
+  }
+
+  const Name&
+  getInviterRoutingPrefix() const
+  {
+    return m_inviterRoutingPrefix;
+  }
+
+  const ndn::IdentityCertificate&
+  getInviterCertificate() const
+  {
+    return m_inviterCertificate;
+  }
+
+  const uint64_t
+  getTimestamp() const
+  {
+    return m_timestamp;
+  }
+
+  const Name&
+  getUnsignedInterestName() const
+  {
+    return m_interestName;
+  }
+
+private:
+  Name m_interestName;
+
+  Name m_inviteeNameSpace;
+  std::string m_chatroom;
+  Name m_inviterRoutingPrefix;
+  ndn::IdentityCertificate m_inviterCertificate;
+  uint64_t m_timestamp;
+};
+
+} // namespace chronos
+
+#endif // CHRONOS_INVITATION_HPP