MorphoGraphX
|
Classes | |
struct | CountedContent |
Type of the reference counted content. More... | |
Public Types | |
typedef vertex_identity_t | identity_t |
Type of the identifier of the vertex. | |
typedef VertexContent | content_t |
Type of the content of the vertex. | |
typedef WeakVertex < VertexContent, Alloc > | weak_ref_t |
typedef VertexContent * | pointer |
Type of the equivalent pointer. | |
Public Member Functions | |
Vertex () | |
Creates a new vertex with a new content. More... | |
Vertex (identity_t id) | |
Creates a reference on the vertex of identifier id . More... | |
Vertex (const Vertex ©) | |
Copy a vertex. More... | |
Vertex (const weak_ref_t &w) | |
Construct a strong reference from a weak one. | |
~Vertex () | |
Desctructor. | |
VertexContent * | operator-> () const |
Access to the data. More... | |
VertexContent & | operator* () const |
Access to the data. More... | |
Vertex & | operator= (const Vertex &other) |
Change the vertex held by the current object. More... | |
Vertex & | operator= (const identity_t &id) |
Vertex & | operator= (const weak_ref_t &other) |
Vertex & | operator= (const VertexContent *value) |
bool | operator== (const Vertex &other) const |
Comparison operators. More... | |
bool | operator!= (const Vertex &other) const |
Comparison operators. More... | |
bool | operator> (const Vertex &other) const |
Comparison operators. More... | |
bool | operator< (const Vertex &other) const |
Comparison operators. More... | |
bool | operator>= (const Vertex &other) const |
Comparison operators. More... | |
bool | operator<= (const Vertex &other) const |
Comparison operators. More... | |
bool | isNull () const |
Test if a vertex is a null vertex. | |
identity_t | id () const |
Return the identifier of a vertex. | |
size_t | num () const |
Return a number unique to each vertex, globally. | |
operator bool () const | |
Convert a vertex to true if it is not null. | |
bool | isWeakRef () const |
Return true if the current object hold a weak reference on a vertex. | |
weak_ref_t | weakRef () const |
Construct a weak reference on the current vertex. | |
unsigned int | count () const |
Serialization method. More... | |
Static Public Attributes | |
static Vertex | null |
Null vertex. More... | |
Protected Member Functions | |
void | release () |
Release the current pointer. | |
void | acquire () |
Acquire the current pointer. | |
Protected Attributes | |
CountedContent * | content |
Content of the vertex. More... | |
Friends | |
class | WeakVertex< VertexContent, Alloc > |
Vertex of a vv graph.
The vertexes handle their associated data using a reference counting scheme. As such, they can be used as smart pointers. They are also comparable (<,>,==,!=), which allow for use in any sorted structure and hashable for use in any hash table-based structure.
They also all have a unique identifier. This identifier can be used to retrieve a weak reference on the data.
mgx::graph::Vertex< VertexContent, Alloc >::Vertex | ( | ) |
Creates a new vertex with a new content.
Example:
|
explicit |
Creates a reference on the vertex of identifier id
.
If id
is 0, creates a null vertex.
[in] | id | Label of the vertex to retrieve. |
Example:
mgx::graph::Vertex< VertexContent, Alloc >::Vertex | ( | const Vertex< VertexContent, Alloc > & | copy | ) |
Copy a vertex.
The data is not copied. The quality of the copy (i.e. weak/strong reference) is the same as the copied.
|
inline |
Serialization method.
|
inline |
Comparison operators.
|
inline |
Access to the data.
|
inline |
Access to the data.
|
inline |
Comparison operators.
|
inline |
Comparison operators.
Vertex< VertexContent, Alloc > & mgx::graph::Vertex< VertexContent, Alloc >::operator= | ( | const Vertex< VertexContent, Alloc > & | other | ) |
Change the vertex held by the current object.
The data is never modified by this operation. If you wish to copy the data of a vertex v1 into a vertex v2 use:
|
inline |
Comparison operators.
|
inline |
Comparison operators.
|
inline |
Comparison operators.
|
mutableprotected |
Content of the vertex.
This member is mutable to allow for modification of constant references. This is useful as no operation on the vertex depend on this.
|
static |