[Ns-developers] Fwd: [Ns-commits] ns-3-dev

Gustavo Carneiro gjcarneiro at gmail.com
Sun Nov 9 04:29:15 PST 2008


2008/11/9 Mathieu Lacage <mathieu.lacage at sophia.inria.fr>

> On Sun, 2008-11-09 at 12:14 +0000, Gustavo Carneiro wrote:
>
> > In case someone missed this:
> >
> > In src/node/ipv6-header.h<
> http://code.nsnam.org/ns-3-dev/diff/9cf7ad0cac85/src/node/ipv6-header.h>
> > :
> >
> >       40 <
> http://code.nsnam.org/ns-3-dev/diff/9cf7ad0cac85/src/node/ipv6-header.h#l40
> >
> > +     * \enum NextHeader_e
> >       41 <
> http://code.nsnam.org/ns-3-dev/diff/9cf7ad0cac85/src/node/ipv6-header.h#l41
> >
> > +     * \brief IPv6 next-header value
> >       42 <
> http://code.nsnam.org/ns-3-dev/diff/9cf7ad0cac85/src/node/ipv6-header.h#l42
> >
> > +     */
> >       43 <
> http://code.nsnam.org/ns-3-dev/diff/9cf7ad0cac85/src/node/ipv6-header.h#l43
> >
> > +    enum NextHeader_e
> >
> >
> > It is not usual NS-3 style to add a suffix _e to enumeration types...
>
> I don't think we have a specific rule about this and it looks like I
> have already done this in a couple of locations:
>
> mathieu at mathieu-boulot:~/code/ns-3-dev/src$ grep -r '_e ' *
> core/attribute-test.cc:  enum Test_e {
> core/attribute-test.cc:  enum Test_e m_enum;
> core/int-to-type.h:  enum v_e {value = v};
> devices/wifi/wifi-mac-header.cc:WifiMacHeader::SetType (enum
> WifiMacType_e type)
> devices/wifi/wifi-mac-header.cc:enum WifiMacType_e
> devices/wifi/wifi-mac-header.h:enum WifiMacType_e {
> devices/wifi/wifi-mac-header.h:  void SetType (enum WifiMacType_e type);
> devices/wifi/wifi-mac-header.h:  enum WifiMacType_e GetType (void)
> const;
> internet-stack/arp-cache.h:    enum ArpCacheEntryState_e {
> internet-stack/arp-cache.h:    ArpCacheEntryState_e m_state;
> internet-stack/arp-header.h:  enum ArpType_e {
> node/address.h:  enum MaxSize_e {
> mathieu at mathieu-boulot:~/code/ns-3-dev/src$
>
> I am not arguing for or against this though: I don't care either way and
> I can live with a mix, but, if someone came up with an extension to the
> coding style document and patches for ns-3-dev to be conformant, I would
> be fine with it.


Ah.. I was utterly convinced the _e suffix was a new thing, and so would
look out of place.  Guess I was wrong.

I'm not very fond of the _e, but I can live with it.

Thanks.

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list