next up previous contents index
Next: Ptrlist Up: Graphcode Previous: Self linking nodes   Contents   Index


objref

For every object in the Graphcode system, there is an objref on every processor referring to it.

Synopsis:

  class objref
  {
  public:
    GraphID_t ID;
    unsigned int proc;

    objref(GraphID_t id=0, int proc=myid(), object *o=NULL);
    objref(GraphID_t id, int proc, object &o); 
    objref(const objref& x);
    ~objref();

    objref& operator=(const objref& x); 
    object& operator*();
    object* operator->();
    const object* operator->() const;
    const object* operator->() const;
    void addref(object* o, bool mflag=false); 
    bool nullref() const;
    void nullify();
  };

ID
A unique integer value that identifies the object within a Graph
proc
The location of the active copy of the object
*, ->
Dereferencing an objref allows one to access the object. It is an error to dereference a nullified objref.
addref
Add an object to this reference. The mflag parameter indicates whether the object is managed (created by new or lnew()), and can be safely deleted when nullified, or is an external object that should not be deleted. An objref can also be instantiated already pointing to an unmanaged object via its constructor.
nullref
whether this objref points to an object or not. If the active copy is on this processor, then nullref should be false. Otherwise, it may true or false depending on whether this processor has a cached copy of the object.
nullify
Remove the object from the Graph (but leaving the objref in place). It is an error to remove the active copy, without replacing it with another object.


next up previous contents index
Next: Ptrlist Up: Graphcode Previous: Self linking nodes   Contents   Index
Russell Standish 2016-09-02