Macaulay2 Engine
Loading...
Searching...
No Matches
MutableEngineObject Class Reference

Base class for engine objects that may mutate, so their hash must be identity-based rather than content-based. More...

#include <hash.hpp>

Inheritance diagram for MutableEngineObject:
our_gc_cleanup our_new_delete SLP< ComplexField > Computation Homotopy M2Homotopy M2PointArray M2SLEvaluator M2SLProgram Monoid MutableComplex MutableMatrix PathTracker Ring SLP< Field > hilb_comp

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)

Detailed Description

Base class for engine objects that may mutate, so their hash must be identity-based rather than content-based.

Note
AI-generated documentation. Verify against the source before relying on it.

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).

Definition at line 97 of file hash.hpp.


The documentation for this class was generated from the following files: