From d9a4bf75f6686ba8f439ecb325ecbe23f8e1417b Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Wed, 27 Jan 2010 18:41:38 -0800 Subject: [PATCH] some words about mixins in helpers --- src/helper/csma-helper.h | 10 ++++++++++ src/helper/emu-helper.h | 10 ++++++++++ src/helper/internet-stack-helper.h | 10 ++++++++++ src/helper/point-to-point-helper.h | 10 ++++++++++ src/helper/yans-wifi-helper.h | 10 ++++++++++ 5 files changed, 50 insertions(+) diff --git a/src/helper/csma-helper.h b/src/helper/csma-helper.h index 0006f5c4c..6524b8dc7 100644 --- a/src/helper/csma-helper.h +++ b/src/helper/csma-helper.h @@ -37,6 +37,16 @@ class Packet; /** * \brief build a set of CsmaNetDevice objects + * + * Normally we eschew multiple inheritance, however, the classes + * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are + * treated as "mixins". A mixin is a self-contained class that + * encapsulates a general attribute or a set of functionality that + * may be of interest to many other classes. + * + * Since the mixins below are self-contained and are explicitly + * designed to avoid naming conflicts through explicit resolution, + * multiple inheritance problems are avoided. */ class CsmaHelper : public PcapUserHelperForDevice, public AsciiTraceUserHelperForDevice { diff --git a/src/helper/emu-helper.h b/src/helper/emu-helper.h index fb5229974..a64b03c50 100644 --- a/src/helper/emu-helper.h +++ b/src/helper/emu-helper.h @@ -37,6 +37,16 @@ class Packet; /** * \brief build a set of EmuNetDevice objects + * + * Normally we eschew multiple inheritance, however, the classes + * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are + * treated as "mixins". A mixin is a self-contained class that + * encapsulates a general attribute or a set of functionality that + * may be of interest to many other classes. + * + * Since the mixins below are self-contained and are explicitly + * designed to avoid naming conflicts through explicit resolution, + * multiple inheritance problems are avoided. */ class EmuHelper : public PcapUserHelperForDevice, public AsciiTraceUserHelperForDevice { diff --git a/src/helper/internet-stack-helper.h b/src/helper/internet-stack-helper.h index 95dc43599..d8838cc84 100644 --- a/src/helper/internet-stack-helper.h +++ b/src/helper/internet-stack-helper.h @@ -46,6 +46,16 @@ class Ipv6RoutingHelper; * there is no device. This means that the creation of output file names will * change, and also the user-visible methods will not reference devices and * therefore the number of trace enable methods is reduced. + * + * Normally we eschew multiple inheritance, however, the classes + * PcapUserHelperForIpv4 and AsciiTraceUserHelperForIpv4 are + * treated as "mixins". A mixin is a self-contained class that + * encapsulates a general attribute or a set of functionality that + * may be of interest to many other classes. + * + * Since the mixins below are self-contained and are explicitly + * designed to avoid naming conflicts through explicit resolution, + * multiple inheritance problems are avoided. */ class InternetStackHelper : public PcapUserHelperForIpv4, public AsciiTraceUserHelperForIpv4 { diff --git a/src/helper/point-to-point-helper.h b/src/helper/point-to-point-helper.h index dc799a98f..c50d0abb3 100644 --- a/src/helper/point-to-point-helper.h +++ b/src/helper/point-to-point-helper.h @@ -38,6 +38,16 @@ class Node; /** * \brief Build a set of PointToPointNetDevice objects + * + * Normally we eschew multiple inheritance, however, the classes + * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are + * treated as "mixins". A mixin is a self-contained class that + * encapsulates a general attribute or a set of functionality that + * may be of interest to many other classes. + * + * Since the mixins below are self-contained and are explicitly + * designed to avoid naming conflicts through explicit resolution, + * multiple inheritance problems are avoided. */ class PointToPointHelper : public PcapUserHelperForDevice, public AsciiTraceUserHelperForDevice { diff --git a/src/helper/yans-wifi-helper.h b/src/helper/yans-wifi-helper.h index 5be6903f7..1547f24e2 100644 --- a/src/helper/yans-wifi-helper.h +++ b/src/helper/yans-wifi-helper.h @@ -135,6 +135,16 @@ private: * * The Pcap and ascii traces generated by the EnableAscii and EnablePcap methods defined * in this class correspond to PHY-level traces. + * + * Normally we eschew multiple inheritance, however, the classes + * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are + * treated as "mixins". A mixin is a self-contained class that + * encapsulates a general attribute or a set of functionality that + * may be of interest to many other classes. + * + * Since the mixins below are self-contained and are explicitly + * designed to avoid naming conflicts through explicit resolution, + * multiple inheritance problems are avoided. */ class YansWifiPhyHelper : public WifiPhyHelper, public PcapUserHelperForDevice, public AsciiTraceUserHelperForDevice {