OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * 2016 National Institute of Standards and Technology (NIST) |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Wesley Garey <wesley.garey@nist.gov> |
| 19 */ |
| 20 |
| 21 #ifndef NIST_MCPTT_HELPER_H |
| 22 #define NIST_MCPTT_HELPER_H |
| 23 |
| 24 #include <stdint.h> |
| 25 #include <string> |
| 26 |
| 27 #include <ns3/address.h> |
| 28 #include <ns3/application-container.h> |
| 29 #include <ns3/attribute.h> |
| 30 #include <ns3/data-rate.h> |
| 31 #include <ns3/node-container.h> |
| 32 #include <ns3/object-factory.h> |
| 33 #include <ns3/ptr.h> |
| 34 |
| 35 namespace ns3 { |
| 36 |
| 37 /** |
| 38 * \ingroup mcptt |
| 39 * \brief A helper for creating, configuring, and installing MCPTT apps. |
| 40 */ |
| 41 class NistMcpttHelper |
| 42 { |
| 43 public: |
| 44 /** |
| 45 * \brief Creates an instance of the NistMcpttHelper class. |
| 46 */ |
| 47 NistMcpttHelper (); |
| 48 /** |
| 49 * \brief Destructor of the NistMcpttHelper class. |
| 50 */ |
| 51 virtual ~NistMcpttHelper (void); |
| 52 /** |
| 53 * \brief Creates an instance of the NistMcpttHelper class. |
| 54 * \param peerAddress The address of the node that the peer application is on. |
| 55 * \param peerPort The port number of the peer application on the server. |
| 56 */ |
| 57 NistMcpttHelper (const Address& peerAddress, const uint16_t& peerPort); |
| 58 /** |
| 59 * \brief Install an ns3::NistMcpttPttApp on each node of the input container. |
| 60 * |
| 61 * \param c NodeContainer of the set of nodes on which an NistMcpttPttApp· |
| 62 * will be installed. |
| 63 * \returns Container of Ptr to the applications installed. |
| 64 */ |
| 65 virtual ApplicationContainer Install (const NodeContainer& c); |
| 66 /** |
| 67 * \brief Install an ns3::NistMcpttPttApp on the node.· |
| 68 * |
| 69 * \param node The node on which an NistMcpttPttApp will be installed. |
| 70 * \returns Container of Ptr to the applications installed. |
| 71 */ |
| 72 virtual ApplicationContainer Install (const Ptr<Node>& node); |
| 73 /** |
| 74 * \brief Install an ns3::NistMcpttPttApp on the node. |
| 75 * |
| 76 * \param nodeName The node on which an NistMcpttPttApp will be installed. |
| 77 * \returns Container of Ptr to the applications installed. |
| 78 */ |
| 79 virtual ApplicationContainer Install (const std::string& nodeName); |
| 80 /** |
| 81 * Sets the attribute of the created MCPTT applications. |
| 82 * \param name The name of the attribute. |
| 83 * \param value The value of the attribute. |
| 84 */ |
| 85 virtual void SetAppAttribute (const std::string& name, const AttributeValue& va
lue); |
| 86 /** |
| 87 * Sets the type ID of the MCPTT applicaton to create. |
| 88 * \param appTid The type ID of the MCPTT application. |
| 89 */ |
| 90 virtual void SetAppTid (const TypeId& appTid); |
| 91 /** |
| 92 * Sets the attribute of the created floor machines. |
| 93 * \param name The name of the attribute. |
| 94 * \param value The value of the attribute. |
| 95 */ |
| 96 virtual void SetFloorMachineAttribute (const std::string& name, const Attribute
Value& value); |
| 97 /** |
| 98 * Sets the type ID of the floor machine to create. |
| 99 * \param floorTid The type ID of the floor machine. |
| 100 */ |
| 101 virtual void SetFloorMachineTid (const TypeId& floorTid); |
| 102 /** |
| 103 * Sets the attriubte of the message parsers that will be created. |
| 104 * \param name The name of the attribute. |
| 105 * \param value The value of the attribute. |
| 106 */ |
| 107 virtual void SetMsgParserAttribute (const std::string& name, const AttributeVal
ue& value); |
| 108 /** |
| 109 * Sets the type ID of the message parser to create. |
| 110 * \param parserTid The type ID. |
| 111 */ |
| 112 virtual void SetMsgParserTid (const TypeId& parserTid); |
| 113 /** |
| 114 * Sets the attribute of the pushers that will be created. |
| 115 * \param name The name of the attribute. |
| 116 * \param value The value of the attribute. |
| 117 */ |
| 118 virtual void SetPusherAttribute (const std::string& name, const AttributeValue&
value); |
| 119 /** |
| 120 * Sets the type ID of the pusher to create. |
| 121 * \param pusherTid The typeId. |
| 122 */ |
| 123 virtual void SetPusherTid (const TypeId& pusherTid); |
| 124 /** |
| 125 * Sets the attribute of the requesters that will be created. |
| 126 * \param name The name of the attribute. |
| 127 * \param value The value of the attribute. |
| 128 */ |
| 129 virtual void SetRequesterAttribute (const std::string& name, const AttributeVal
ue& value); |
| 130 /** |
| 131 * Sets the type ID of the requester to create. |
| 132 * \param requesterTid The type ID. |
| 133 */ |
| 134 virtual void SetRequesterTid (const TypeId& requesterTid); |
| 135 protected: |
| 136 /** |
| 137 * \brief Install an ns3::NistMcpttPttApp on the node. |
| 138 * |
| 139 * \param node The node on which an NistMcpttPttApp will be installed. |
| 140 * \returns Ptr to the application installed. |
| 141 */ |
| 142 virtual Ptr<Application> InstallPriv (const Ptr<Node>& node); |
| 143 /** |
| 144 * \brief Gets the next MCPTT ID and advances the sequence. |
| 145 * \returns The next MCPTT ID. |
| 146 */ |
| 147 virtual uint32_t NextUserId (void); |
| 148 private: |
| 149 ObjectFactory m_appFac; //!< The MCPTT application object factory. |
| 150 ObjectFactory m_floorFac; //!< The MCPTT floor machine object factory. |
| 151 ObjectFactory m_msgParserFac; //!< The MCPTT message parser object factory. |
| 152 uint32_t m_nextUserId; //!< The MCPTT ID that will be assigned to the next appl
ication that is created. |
| 153 ObjectFactory m_requesterFac; //!< The MCPTT send requester object factory. |
| 154 ObjectFactory m_pusherFac; //!< The MCPTT pusher object factory. |
| 155 protected: |
| 156 /** |
| 157 * \brief Gets the MCPTT ID that will be assigned to the next application that
is created. |
| 158 * \returns The MCPTT ID |
| 159 */ |
| 160 virtual uint32_t GetNextUserId (void) const; |
| 161 /** |
| 162 * \brief Sets the MCPTT ID that will be assigned to the next created applicati
on. |
| 163 * \param nextUserId The next MCPTT ID. |
| 164 */ |
| 165 virtual void SetNextUserId (const uint32_t& nextUserId); |
| 166 }; |
| 167 |
| 168 } // namespace ns3 |
| 169 |
| 170 #endif /* NIST_MCPTT_HELPER_H */ |
| 171 |
OLD | NEW |