Skip to content

Commit

Permalink
docs: improvement of code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dpugliese6 committed Jan 7, 2025
1 parent 5a561cb commit 5b2f908
Show file tree
Hide file tree
Showing 96 changed files with 416 additions and 78 deletions.
7 changes: 4 additions & 3 deletions src/application/drone-client-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ns3
{

/**
* \brief the client states
* \brief Define the client states
*/
enum ClientState
{
Expand All @@ -37,7 +37,7 @@ enum ClientState
};

/**
* \brief the intent of a packet
* \brief Define the intent of a packet
*/
enum Intent
{
Expand All @@ -64,7 +64,8 @@ ToString(Intent i)
}

/**
* Application to be installed on each drone that wants to participate in the
* \ingroup applications
* \brief Application to be installed on each drone that wants to participate in the
* IoD inter-network using a simple JSON via UDP with ACK protocol.
*/
class DroneClientApplication : public Application
Expand Down
4 changes: 4 additions & 0 deletions src/application/drone-communications.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
namespace ns3
{

/**
* \ingroup applications
* \brief The type of packet exchanged between drones and ZSPs.
*/
class PacketType
{
public:
Expand Down
10 changes: 9 additions & 1 deletion src/application/drone-server-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,27 @@

namespace ns3
{

/**
* \brief Define the state of the server.
*/
enum ServerState
{
SERVER_CLOSED,
SERVER_LISTEN
};

/**
* \ingroup applications
*
* \brief Application that receives packets from a drone and sends back acknowledgements.
*/
class DroneServerApplication : public Application
{
public:
static TypeId GetTypeId();

DroneServerApplication();

protected:
virtual void DoDispose();

Expand Down
5 changes: 5 additions & 0 deletions src/application/nat-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
namespace ns3
{

/**
* \ingroup applications
*
* \brief Application that defines a Network Address Translation (NAT) service.
*/
class NatApplication : public Application
{
public:
Expand Down
4 changes: 3 additions & 1 deletion src/application/random-udp-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace ns3
{

/**
* Application that sends random packets with Seq.Num. and Timestamp to a remote server
* \ingroup applications
* \brief Application that sends UDP packets with with a defined size and frequency.
*/
class RandomUdpApplication : public Application
{
Expand All @@ -39,6 +40,7 @@ class RandomUdpApplication : public Application
* \brief Default constructor
*/
RandomUdpApplication();

protected:
/**
* \brief Initialize the Object registered as TypeId
Expand Down
4 changes: 3 additions & 1 deletion src/application/tcp-client-server-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ namespace ns3
{

/**
* Base application for reliable TCP-based client-server communications.
* \ingroup applications
* \brief application for reliable TCP-based client-server communications.
*/
class TcpClientServerApplication : public Application
{
public:
static TypeId GetTypeId();

protected:
virtual void StartApplication();
virtual void StopApplication();
Expand Down
4 changes: 3 additions & 1 deletion src/application/tcp-echo-server-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ namespace ns3
{

/**
* Basic Server TCP application that echoes in case data is received.
* \ingroup applications
* \brief Server TCP application that echoes in case data is received.
*/
class TcpEchoServerApplication : public TcpClientServerApplication
{
public:
static TypeId GetTypeId();

protected:
virtual void StartApplication();
virtual void ReceivedDataCallback(Ptr<Socket> s);
Expand Down
6 changes: 4 additions & 2 deletions src/application/tcp-storage-client-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ namespace ns3
{

/**
* TCP client that transmits data to a remote server to free as much memory as possible on the
* storage peripheral attached to the same node.
* \ingroup applications
* \brief TCP client that transmits data to a remote server to free as much memory as possible on
* the storage peripheral attached to the same node.
*/
class TcpStorageClientApplication : public TcpClientServerApplication
{
public:
static TypeId GetTypeId();
TcpStorageClientApplication();

protected:
virtual void DoInitialize();
virtual void StartApplication();
Expand Down
4 changes: 3 additions & 1 deletion src/application/tcp-stub-client-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ namespace ns3
{

/**
* Application that sends random packets with Seq.Num. and Timestamp to a remote server
* \ingroup applications
* \brief Application that sends random packets with Seq.Num. and Timestamp to a remote server.
*/
class TcpStubClientApplication : public TcpStorageClientApplication
{
public:
static TypeId GetTypeId();

protected:
virtual void DoInitialize();
virtual void StartApplication();
Expand Down
2 changes: 1 addition & 1 deletion src/application/udp-echo-client-application.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace ns3
{

/**
* \ingroup udpclientserver
* \ingroup applications
*
* \brief A Udp client. Sends UDP packet carrying sequence number and time stamp
* in their payloads
Expand Down
5 changes: 3 additions & 2 deletions src/configuration/base/model-configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ns3
{

/**
* Data class to recognize and configure a TypeId that is registered on ns-3.
* \brief class to recognize and configure a TypeId that is registered on ns-3.
*/
class ModelConfiguration
{
Expand All @@ -38,7 +38,8 @@ class ModelConfiguration
std::string name;
Ptr<AttributeValue> value;

Attribute() = default;
Attribute() = default;

Attribute(std::string name, Ptr<AttributeValue> value)
: name{name},
value{value}
Expand Down
11 changes: 7 additions & 4 deletions src/configuration/base/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ operator<<(std::ostream& os, const std::vector<T>& v)
}

/**
* Hold objects of type std::vector<T>
* \brief Hold objects of type std::vector<T>
*/
template <class T>
class VectorValue : public AttributeValue
Expand Down Expand Up @@ -84,11 +84,14 @@ class VectorValue : public AttributeValue
value_type m_value;
};

/**
* \brief AttributeChecker for VectorValue.
*/
class VectorChecker : public AttributeChecker
{
public:
virtual void SetChecker(Ptr<const AttributeChecker> checker) = 0;
virtual Ptr<const AttributeChecker> GetChecker(void) const = 0;
public:
virtual void SetChecker(Ptr<const AttributeChecker> checker) = 0;
virtual Ptr<const AttributeChecker> GetChecker(void) const = 0;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/configuration/helper/entity-configuration-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace ns3
using JsonArray = rapidjson::GenericArray<true, rapidjson::Value>;

/**
* \brief Helper to decode Entities from a JSON configuration file.
*
* Helper to decode an Entity (i.e., Drone or ZSP) from a JSON configuration file and read the
* following properties:
* - Its network device(s)
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/ipv4-simulation-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ns3
{

/**
* A data class to store information about an IPv4 layer configuration for a simulation.
* \brief A data class to store information about an IPv4 layer configuration for a simulation.
*/
class Ipv4SimulationHelper : public Object
{
Expand Down
4 changes: 3 additions & 1 deletion src/configuration/helper/lte-phy-simulation-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ namespace ns3
{

/**
* A data class to store information about a WiFi PHY layer configuration for a simulation.
* \ingroup lte
*
* \brief A data class to store information about a WiFi PHY layer configuration for a simulation.
*/
class LtePhySimulationHelper : public Object
{
Expand Down
4 changes: 3 additions & 1 deletion src/configuration/helper/lte-setup-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ namespace ns3
{

/**
* Helper to enhance ns-3 LteHelper functionalities with additional
* \ingroup lte
*
* \brief Helper to enhance ns-3 LteHelper functionalities with additional
* features, without modifying objects external to IoD_Sim.
*/
class LteSetupHelper
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/mac-layer-configuration-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ns3
{

/**
* Helper to decode a MAC Layer from a JSON configuration file.
* \brief Helper to decode a MAC Layer from a JSON configuration file.
*/
class MacLayerConfigurationHelper
{
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/mobility-factory-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ns3
{

/**
* Helper to enhance ns-3 MobilityHelper functionalities with additional
* \brief Helper to enhance ns-3 MobilityHelper functionalities with additional
* features, without modifying objects external to IoD_Sim.
*/
class MobilityFactoryHelper
Expand Down
5 changes: 4 additions & 1 deletion src/configuration/helper/model-configuration-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ using JsonObject = rapidjson::Value::ConstObject;
using JsonValue = rapidjson::Value;

/**
* \brief Helper to decode a ns3 Model from a JSON configuration file.
*
* Helper to decode a ns3 Model from a JSON configuration file and read the following properties:
* - Its name
* - Its set of attributes and values
Expand All @@ -40,7 +42,8 @@ class ModelConfigurationHelper
{
public:
/**
* ModelConfigurationHelper is a utility class with only static members, thus it can't be initialized.
* ModelConfigurationHelper is a utility class with only static members, thus it can't be
* initialized.
*/
ModelConfigurationHelper() = delete;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ns3
{

/**
* Helper to decode a Network Layer from a JSON configuration file.
* \brief Helper to decode a Network Layer from a JSON configuration file.
*/
class NetworkLayerConfigurationHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace ns3
{

/**
* Helper simulate a NTN scenario without a real-world MAC.
* \brief Helper to simulate a NTN scenario without a real-world MAC.
*/
class NullNtnDemoMacLayerSimulationHelper : public Object
{
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/phy-layer-configuration-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ns3
{

/**
* Helper to decode a PHY Layer from a JSON configuration file.
* \brief Helper to decode a PHY Layer from a JSON configuration file.
*/
class PhyLayerConfigurationHelper
{
Expand Down
4 changes: 3 additions & 1 deletion src/configuration/helper/remote-configuration-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ namespace ns3
using JsonArray = rapidjson::GenericArray<true, rapidjson::Value>;

/**
* Helper to decode an Remote from a JSON configuration file and read the following properties:
* \brief Helper to decode a Remote from a JSON configuration.
*
* Helper to decode a Remote from a JSON configuration file and read the following properties:
* - Its Network Layer Identifier
* - Its Applications
*/
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/three-gpp-phy-simulation-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ns3
{

/**
* A data class to store information about a 3GPP PHY layer configuration for a simulation.
* \brief A data class to store information about a 3GPP PHY layer configuration for a simulation.
*/
class ThreeGppPhySimulationHelper : public Object
{
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/wifi-mac-factory-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ns3
{

/**
* Helper to enhance ns-3 WifiHelper functionalities with additional
* \brief Helper to enhance ns-3 WifiHelper functionalities with additional
* features, without modifying objects external to IoD_Sim.
*/
class WifiMacFactoryHelper
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/wifi-mac-simulation-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ns3
{

/**
* A data class to store information about a WiFi MAC layer configuration for a simulation.
* \brief A data class to store information about a WiFi MAC layer configuration for a simulation.
*/
class WifiMacSimulationHelper : public Object
{
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/wifi-phy-factory-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ns3
{

/**
* Helper to enhance ns-3 WifiPhyHelper functionalities with additional
* \brief Helper to enhance ns-3 WifiPhyHelper functionalities with additional
* features, without modifying objects external to IoD_Sim.
*/
class WifiPhyFactoryHelper
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/helper/wifi-phy-simulation-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ns3
{

/**
* A data class to store information about a WiFi PHY layer configuration for a simulation.
* \brief A data class to store information about a WiFi PHY layer configuration for a simulation.
*/
class WifiPhySimulationHelper : public Object
{
Expand Down
3 changes: 2 additions & 1 deletion src/configuration/ipv4-network-layer-configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace ns3
{

/**
* A data class to store configuration information related to the set up of an IPv4 Network Layer.
* \brief A data class to store configuration information related to the set up of an IPv4 Network
* Layer.
*/
class Ipv4NetworkLayerConfiguration : public NetworkLayerConfiguration
{
Expand Down
Loading

0 comments on commit 5b2f908

Please sign in to comment.