|
Broom 1.0.0
A thread-local C++ Garbage Collector
|
#include <broom.h>

Public Member Functions | |
| virtual | ~BroomValue () |
| virtual void | Visit (Visitor *visitor) const =0 |
Protected Member Functions | |
| BroomValue (GarbageCollector *gc) | |
| BroomValue () | |
| BroomValue (const BroomValue &other) | |
| BroomValue & | operator= (const BroomValue &other) |
| BroomValue & | operator= (BroomValue &&other) noexcept |
BroomValue implements the notion of a precise garbage collector root via inheritance. Every class/struct that inherits from this class needs to call the BroomValue::BroomValue() constructor for every one of its constructors. Additionally, every class that inherits from BroomValue must also implement the BroomValue::Visit() method and call Visitor::Visit() on any member that may be a managed object.
gc_root is also available as a type alias for this class to support a more traditional C++ style.
|
protected |
A constructor accepting a garbage collector state.
| gc | The garbage collector state that this BroomValue belongs to. |
|
protected |
The default constructor. This is the one that should be used by most classes inheriting from BroomValue.
|
protected |
Copy constructor. This constructor won't re-register the root with the garbage collector.
| other | The BroomValue object to copy. |
|
protectednoexcept |
Assignment operator with an rvalue reference. This constructor will unregister other with the garbage collector state and register this instance instead. The operator is guarded against self-assignment.
| other | The rvalue reference of the BroomValue object to assign. |
|
protected |
Assignment operator with a reference. This constructor will unregister other with the garbage collector state and register this instance instead. The operator is guarded against self-assignment.
| other | The reference of the BroomValue object to assign. |
An abstract Visit() method that needs to be implemented by any class that inherits from this class. The Visit() method is expected to call the visitor's Visitor::Visit() method on any managed pointer member.
| visitor | The Visitor object that implements a Visitor::Visit() method. |
Implemented in broom::map< Key, T, Compare, Allocator >, broom::multimap< Key, T, Compare, Allocator >, broom::unordered_map< Key, T, Hash, KeyEqual, Allocator >, broom::unordered_map< std::string, Node * >, and broom::unordered_multimap< Key, T, Hash, KeyEqual, Allocator >.