1#ifndef HALIDE_FUNCTION_PTR_H
2#define HALIDE_FUNCTION_PTR_H
19struct FunctionContents;
32 FunctionGroup *
weak =
nullptr;
46 FunctionContents *
get()
const;
86 return get() < other.
get();
Support classes for reference-counting via intrusive shared pointers.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A possibly-weak pointer to a Halide function.
void weaken()
Convert from a strong reference to a weak reference.
FunctionContents * get() const
Get the opaque FunctionContents object this pointer refers to.
IntrusivePtr< FunctionGroup > strong
A strong and weak pointer to the group.
bool operator<(const FunctionPtr &other) const
Pointer comparison, for using FunctionPtrs as keys in maps and sets.
bool defined() const
Check if the reference is defined.
FunctionContents & operator*() const
void strengthen()
Convert from a weak reference to a strong reference.
FunctionGroup * group() const
Get a pointer to the group this Function belongs to.
bool same_as(const FunctionPtr &other) const
Check if two FunctionPtrs refer to the same Function.
FunctionContents * operator->() const
int idx
The index of the function within the group.
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
HALIDE_ALWAYS_INLINE bool defined() const
T * get() const
Access the raw pointer in a variety of ways.