12 #ifndef __UNI_GraphHandle_h__
13 #define __UNI_GraphHandle_h__
27 : myGraphPtr( graph_ptr ) {}
29 : myGraphPtr( std::move(graph_ptr) ) {}
35 explicit operator bool()
const
41 {
return graph() == other.
graph(); }
43 {
return graph() != other.
graph(); }
48 {
return myGraphPtr.get(); }
56 return myGraphPtr ? myGraphPtr->graphID() : UNI_GraphID();
bool operator==(const UNI_ConstGraphHandle &other) const
Comparison operators.
UNI_GraphID graphID() const
Returns the ID of a UNI graph referenced by this handle.
bool operator!=(const UNI_ConstGraphHandle &other) const
Comparison operators.
bool isValid() const
Returns true if this handle refers to a valid graph; false otherwise.
UNI_ConstGraphHandle(UNI_ConstGraphPtr &&graph_ptr)
Constructor for the graph handle.
UNI_GraphHandle(const UNI_GraphPtr &graph_ptr)
Constructor for the graph handle.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UNI_Graph * graph() const
Returns the UNI graph referenced by this handle.
UNI_Graph * operator->() const
Returns the UNI graph referenced by this handle.
UNI_GraphHandle(UNI_GraphPtr &&graph_ptr)
Constructor for the graph handle.
UNI_GraphHandle(UT_UniquePtr< UNI_Graph > graph)
UNI_ConstGraphHandle(const UNI_ConstGraphPtr &graph_ptr)
Constructor for the graph handle.
const UNI_Graph * operator->() const
Returns the UNI graph referenced by this handle.
const UNI_Graph * graph() const
Returns the UNI graph referenced by this handle.