[Commits] [wesnoth/wesnoth-old] 8f73eb: Change game_events::manager::iteration to not stor...

GitHub noreply at github.com
Sat Feb 22 07:44:00 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth-old
  Commit: 8f73eb02f0526220e4c94aeb72c7c25c392c0003
      https://github.com/wesnoth/wesnoth-old/commit/8f73eb02f0526220e4c94aeb72c7c25c392c0003
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp
    M src/game_events/menu_item.cpp
    M src/game_events/pump.cpp

  Log Message:
  -----------
  Change game_events::manager::iteration to not store a pointer.

Also makes the API more like an iterator's.


  Commit: 2a825ffdc34aad0a99aa4363017e9b7e29b1a977
      https://github.com/wesnoth/wesnoth-old/commit/2a825ffdc34aad0a99aa4363017e9b7e29b1a977
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp
    M src/game_events/pump.cpp

  Log Message:
  -----------
  Allow an event handler to be destroyed just before it handles an event.

This is to support some future commits.
I've included comments to point out where pointers might become invalid
through non-obvious means.


  Commit: f3c18b62925183901e3963b2315ee572af34326a
      https://github.com/wesnoth/wesnoth-old/commit/f3c18b62925183901e3963b2315ee572af34326a
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    A src/utils/smart_list.hpp

  Log Message:
  -----------
  Implementation of a "smart" linked list.

With a standard linked list, iterators are never invalidated unless
they point to an element that was erased (or the list is destroyed).
This implementation takes that one step further and never invalidates
iterators (unless the list is destroyed). From the perspective of the
list, erased elements no longer exist, but an iterator that still
points to an erased element can be dereferenced, incremented, and
decremented.

I was having trouble implementing this based on STL and Boost, so
I went ahead and coded this from scratch. The standard list interface
is implemented, aside from assignment (since I could not reconcile
assignment with the goal of not invalidating iterators).


  Commit: 3f584e2435eaf9a7a4b90c2dc34e18ffc7eaa943
      https://github.com/wesnoth/wesnoth-old/commit/3f584e2435eaf9a7a4b90c2dc34e18ffc7eaa943
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp

  Log Message:
  -----------
  Implementation of a list of event handlers.

This is actually a list of weak pointers that will be cleared of
expired entries as they are encountered. (So some garbage may
accumulate, but only to a point as it will be cleared the next
time the list is traversed.)


  Commit: 03770e4be38b8cf3d67cc93a91cbba0f72cec893
      https://github.com/wesnoth/wesnoth-old/commit/03770e4be38b8cf3d67cc93a91cbba0f72cec893
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp

  Log Message:
  -----------
  Index events by name.

This commit causes the index to be created. The next commit will
make use of the index.


  Commit: edbd4fcb72a5856f03f07a71d6033d782ee5d82c
      https://github.com/wesnoth/wesnoth-old/commit/edbd4fcb72a5856f03f07a71d6033d782ee5d82c
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M changelog
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp

  Log Message:
  -----------
  Optimizing game event firing.

This uses the indexing of handlers by name to reduce the number of
event handlers that are checked when an event is fired. There is
extra overhead to independently track handlers whose names contain
variables, but in more common cases, there should be an improvement,
particularly when many events fire in sequence, such as the enter/
exit_hex events.


  Commit: 33cb3e491f3f27edc1b4bb051bc7927646497b4c
      https://github.com/wesnoth/wesnoth-old/commit/33cb3e491f3f27edc1b4bb051bc7927646497b4c
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp

  Log Message:
  -----------
  Speed the lookup of a game event handler by ID.


  Commit: 939e0805ba644926377877642b6061a645e06d6d
      https://github.com/wesnoth/wesnoth-old/commit/939e0805ba644926377877642b6061a645e06d6d
  Author: JaMiT <jt_coding at zoho.com>
  Date:   2014-02-21 (Fri, 21 Feb 2014)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp

  Log Message:
  -----------
  Merge event_handler::set_index() into the constructor.


Compare: https://github.com/wesnoth/wesnoth-old/compare/41fff387e8fc...939e0805ba64


More information about the Commits mailing list