So, Packet and Request have lots of functions called getFoo and
setFoo.  That sort of style has always annoyed me because it requires
a lot of extra typing and space. e.g.

    /// Accessor function for the destination index of the packet.
    short getDest() const     { assert(destValid); return dest; }
    /// Accessor function to set the destination index of the packet.
    void setDest(short _dest) { dest = _dest; destValid = true; }

Would there be major objections to changing this to:

    /// Accessor function for the destination index of the packet.
    short dest() const     { assert(destValid); return _dest; }
    /// Accessor function to set the destination index of the packet.
    void dest(short d) { _dest = d; destValid = true; }

You can tell if it is a get or a set by how it is called.  If people
hate this, we could keep the setDest() version and rename getDest to
dest().

I can see one major objection to this change being the impact that it
could have on people porting their own code forward to newer versions
of M5 after this change.  That said, if we're going to be doing any
major changes to the memory system, now is the time to make this sort
of change.

  Nate
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to