Maintain a diff list of changes that have happened to a World. More...
#include <world_diff.h>
Public Types | |
typedef std::map< std::string, World::Action >::const_iterator | const_iterator |
Public Member Functions | |
const_iterator | begin () const |
void | clearChanges () |
Clear the internally maintained vector of changes. More... | |
const_iterator | end () const |
const_iterator | find (const std::string &id) const |
const std::map< std::string, World::Action > & | getChanges () const |
Return all the changes that have been recorded. More... | |
void | reset (const WorldPtr &world) |
Set which world to record. Erases all previously recorded changes. More... | |
void | reset () |
Turn off recording and erase all previously recorded changes. More... | |
void | set (const std::string &id, World::Action val) |
void | setWorld (const WorldPtr &world) |
Set which world to record. Records all objects in old world (if any) as DESTROYED and all objects in new world as CREATED and ADD_SHAPE. More... | |
size_t | size () const |
WorldDiff () | |
Constructor. More... | |
WorldDiff (const WorldPtr &world) | |
Constructor. More... | |
WorldDiff (WorldDiff &other) | |
copy constructor. More... | |
~WorldDiff () | |
Private Member Functions | |
void | notify (const World::ObjectConstPtr &, World::Action) |
Notification function. More... | |
Private Attributes | |
std::map< std::string, World::Action > | changes_ |
World::ObserverHandle | observer_handle_ |
std::weak_ptr< World > | world_ |
Maintain a diff list of changes that have happened to a World.
Definition at line 50 of file world_diff.h.
typedef std::map<std::string, World::Action>::const_iterator collision_detection::WorldDiff::const_iterator |
Definition at line 82 of file world_diff.h.
collision_detection::WorldDiff::WorldDiff | ( | ) |
Constructor.
Definition at line 49 of file world_diff.cpp.
collision_detection::WorldDiff::WorldDiff | ( | const WorldPtr & | world | ) |
Constructor.
Definition at line 53 of file world_diff.cpp.
collision_detection::WorldDiff::WorldDiff | ( | WorldDiff & | other | ) |
copy constructor.
Definition at line 58 of file world_diff.cpp.
collision_detection::WorldDiff::~WorldDiff | ( | ) |
Definition at line 42 of file world_diff.cpp.
|
inline |
iterator pointing to first change
Definition at line 84 of file world_diff.h.
void collision_detection::WorldDiff::clearChanges | ( | ) |
Clear the internally maintained vector of changes.
Definition at line 108 of file world_diff.cpp.
|
inline |
iterator pointing to end of changes
Definition at line 89 of file world_diff.h.
|
inline |
find changes for a named object
Definition at line 99 of file world_diff.h.
|
inline |
Return all the changes that have been recorded.
Definition at line 77 of file world_diff.h.
|
private |
Notification function.
Definition at line 113 of file world_diff.cpp.
void collision_detection::WorldDiff::reset | ( | const WorldPtr & | world | ) |
Set which world to record. Erases all previously recorded changes.
Definition at line 81 of file world_diff.cpp.
void collision_detection::WorldDiff::reset | ( | ) |
Turn off recording and erase all previously recorded changes.
Definition at line 70 of file world_diff.cpp.
|
inline |
set the entry for an id
Definition at line 104 of file world_diff.h.
void collision_detection::WorldDiff::setWorld | ( | const WorldPtr & | world | ) |
Set which world to record. Records all objects in old world (if any) as DESTROYED and all objects in new world as CREATED and ADD_SHAPE.
Definition at line 93 of file world_diff.cpp.
|
inline |
number of changes stored
Definition at line 94 of file world_diff.h.
|
private |
keep changes in a map so they can be coalesced
Definition at line 120 of file world_diff.h.
|
private |
Definition at line 123 of file world_diff.h.
|
private |
Definition at line 126 of file world_diff.h.