Macaulay2 Engine
Loading...
Searching...
No Matches
EngineObject Class Referenceabstract

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>

Inheritance diagram for EngineObject:
our_new_delete EngineMonomial FreeModule Matrix MonomialIdeal RingElement RingMap

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)

Detailed Description

Base class for engine objects that are immutable once their hash has been pinned (typically once they cross over to the front end).

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

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

Definition at line 61 of file hash.hpp.


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