|
Macaulay2 Engine
|
Base class for engine objects that may mutate, so their hash must be identity-based rather than content-based. More...
#include <hash.hpp>
Public Member Functions | |
| MutableEngineObject () | |
| virtual | ~MutableEngineObject () |
| unsigned int | hash () const |
| Public Member Functions inherited from our_gc_cleanup | |
| our_gc_cleanup () | |
| virtual | ~our_gc_cleanup () |
Private Attributes | |
| unsigned int | mHashValue |
Static Private Attributes | |
| static unsigned int | mNextMutableHashValue = 13 |
Additional Inherited Members | |
| Static Public Member Functions inherited from our_new_delete | |
| static void * | operator new (size_t size) |
| static void * | operator new[] (size_t size) |
| static void | operator delete (void *obj) |
| static void | operator delete[] (void *obj) |
| static void * | operator new (size_t size, void *existing_memory) |
| static void * | operator new[] (size_t size, void *existing_memory) |
| static void | operator delete (void *obj, void *existing_memory) |
| static void | operator delete[] (void *obj, void *existing_memory) |
Base class for engine objects that may mutate, so their hash must be identity-based rather than content-based.
Pulls a fresh integer from the static counter mNextMutableHashValue at construction and keeps it for the object's whole lifetime, so even after mutation hash() still returns the same value. Inherits from our_gc_cleanup so the GC can run a destructor when the object becomes unreachable (mutable objects often need to free non-GC resources).