|
Macaulay2 Engine
|
Base class for engine objects that are immutable once their hash has been pinned (typically once they cross over to the front end). More...
#include <hash.hpp>
Public Member Functions | |
| EngineObject () | |
| virtual | ~EngineObject () |
| unsigned int | hash () const |
Protected Member Functions | |
| virtual unsigned int | computeHashValue () const =0 |
Private Attributes | |
| unsigned int | mHashValue |
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 are immutable once their hash has been pinned (typically once they cross over to the front end).
Holds a single lazily computed mHashValue that defaults to zero and is filled in by computeHashValue() (pure virtual — every subclass supplies its own hashing rule). The non-zero invariant doubles as a "computed yet" flag: hash() returns the cached value, or runs the computation and bumps a zero result to 1 so the flag still distinguishes uncomputed from "genuinely hashed to 0".