Change ChatroomInfo to contain more information
Change-Id: Ie91ced5dd9be51c8d59a0c5d881967658a58fd15
diff --git a/src/chatroom-info.hpp b/src/chatroom-info.hpp
index e182713..fc7c707 100644
--- a/src/chatroom-info.hpp
+++ b/src/chatroom-info.hpp
@@ -22,6 +22,7 @@
#include <ndn-cxx/encoding/encoding-buffer.hpp>
#include <ndn-cxx/exclude.hpp>
#include <boost/concept_check.hpp>
+#include <list>
namespace chronos {
@@ -44,7 +45,6 @@
}
};
-
enum TrustModel {
TRUST_MODEL_HIERARCHICAL = 2,
TRUST_MODEL_WEBOFTRUST = 1,
@@ -67,26 +67,35 @@
const Name::Component&
getName() const;
+ const TrustModel
+ getTrustModel() const;
+
+ const Name&
+ getSyncPrefix() const;
+
+ const Name&
+ getManagerPrefix() const;
+
+ const std::list<Name>&
+ getParticipants() const;
+
void
setName(const Name::Component& name);
- const std::vector<Name>&
- getParticipants() const;
+ void
+ setTrustModel(const TrustModel trustModel);
void
addParticipant(const Name& participant);
- const std::vector<Name>&
- getContacts() const;
+ void
+ removeParticipant(const Name& participant);
void
- addContact(const Name& contact);
-
- const TrustModel
- getTrustModel() const;
+ setSyncPrefix(const Name& prefix);
void
- setTrustModel(const TrustModel trustModel);
+ setManager(const Name& manager);
private:
template<bool T>
@@ -95,29 +104,18 @@
private:
mutable Block m_wire;
- Name::Component m_name;
- std::vector<Name> m_participants;
+ Name::Component m_chatroomName;
+ std::list<Name> m_participants;
+ Name m_manager;
+ Name m_syncPrefix;
TrustModel m_trustModel;
- std::vector<Name> m_contacts;
};
inline const Name::Component&
ChatroomInfo::getName() const
{
- return m_name;
-}
-
-inline const std::vector<Name>&
-ChatroomInfo::getParticipants() const
-{
- return m_participants;
-}
-
-inline const std::vector<Name>&
-ChatroomInfo::getContacts() const
-{
- return m_contacts;
+ return m_chatroomName;
}
inline const ChatroomInfo::TrustModel
@@ -126,6 +124,25 @@
return m_trustModel;
}
+
+inline const Name&
+ChatroomInfo::getManagerPrefix() const
+{
+ return m_manager;
+}
+
+inline const Name&
+ChatroomInfo::getSyncPrefix() const
+{
+ return m_syncPrefix;
+}
+
+inline const std::list<Name>&
+ChatroomInfo::getParticipants() const
+{
+ return m_participants;
+}
+
BOOST_CONCEPT_ASSERT((ndn::WireEncodable<ChatroomInfo>));
BOOST_CONCEPT_ASSERT((ndn::WireDecodable<ChatroomInfo>));