graph::WeakVertex< VertexContent > Class Template Reference

Weak pointer on a vertex. More...

#include <graph/vertex.h>

Inheritance diagram for graph::WeakVertex< VertexContent >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef VertexContent content_t
 Type of the content of the vertex.
typedef vertex_identity_t identity_t
 Type of the identifier of the vertex.
typedef VertexContent * pointer
 Type of the equivalent pointer.
typedef Vertex< VERTEX_ARGS > strong_ref
 Strong reference corresponding to the weak one.

Public Member Functions

bool isNull () const
 Test if a vertex is a null vertex.
WeakVertexoperator= (const strong_ref &other)
WeakVertexoperator= (const identity_t &id)
WeakVertexoperator= (const WeakVertex &other)
 Set the content of the weak reference.
 WeakVertex (const identity_t &id)
 Construct a weak reference from an id.
 WeakVertex (const WeakVertex &copy)
 Copy constructor.
 WeakVertex (const strong_ref &v)
 Construct a weak reference from a strong one.
 WeakVertex ()
 Construct an empty weak vertex.

Detailed Description

template<typename VertexContent>
class graph::WeakVertex< VertexContent >

Weak pointer on a vertex.

Be careful using this class as there is no garanty the vertex still exists.

Definition at line 503 of file vertex.h.


Member Typedef Documentation

template<typename VertexContent>
typedef VertexContent graph::WeakVertex< VertexContent >::content_t

Type of the content of the vertex.

Reimplemented from graph::Vertex< VERTEX_ARGS >.

Definition at line 516 of file vertex.h.

template<typename VertexContent>
typedef vertex_identity_t graph::WeakVertex< VertexContent >::identity_t

Type of the identifier of the vertex.

Reimplemented from graph::Vertex< VERTEX_ARGS >.

Definition at line 511 of file vertex.h.

template<typename VertexContent>
typedef VertexContent* graph::WeakVertex< VertexContent >::pointer

Type of the equivalent pointer.

Reimplemented from graph::Vertex< VERTEX_ARGS >.

Definition at line 526 of file vertex.h.

template<typename VertexContent>
typedef Vertex<VERTEX_ARGS> graph::WeakVertex< VertexContent >::strong_ref

Strong reference corresponding to the weak one.

Definition at line 521 of file vertex.h.


Constructor & Destructor Documentation

template<typename VertexContent>
graph::WeakVertex< VertexContent >::WeakVertex (  )  [inline]

Construct an empty weak vertex.

At the difference of normal vertices, constructing a weak vertex creates a null one.

Definition at line 534 of file vertex.h.

00535       : Vertex<VERTEX_ARGS>(0)
00536     {}

template<typename VertexContent>
graph::WeakVertex< VertexContent >::WeakVertex ( const strong_ref v  )  [inline]

Construct a weak reference from a strong one.

Definition at line 541 of file vertex.h.

References graph::Vertex< VertexContent >::_content, and graph::Vertex< VERTEX_ARGS >::_content.

00542       : Vertex<VERTEX_ARGS>(0)
00543     {
00544       this->_content = v._content;
00545     }

template<typename VertexContent>
graph::WeakVertex< VertexContent >::WeakVertex ( const WeakVertex< VertexContent > &  copy  )  [inline]

Copy constructor.

Definition at line 550 of file vertex.h.

References graph::Vertex< VertexContent >::_content, and graph::Vertex< VERTEX_ARGS >::_content.

00551       : Vertex<VERTEX_ARGS>(0)
00552     {
00553       this->_content = copy._content;
00554     }

template<typename VertexContent>
graph::WeakVertex< VertexContent >::WeakVertex ( const identity_t id  )  [inline, explicit]

Construct a weak reference from an id.

Definition at line 566 of file vertex.h.

References graph::Vertex< VERTEX_ARGS >::_content.

00567       : Vertex<VERTEX_ARGS>(0)
00568     {
00569       this->_content = reinterpret_cast<real_pointer>(id);
00570       if(this->_content and this->_content->count == 0)
00571         this->_content = 0;
00572     }


Member Function Documentation

template<typename VertexContent>
bool graph::WeakVertex< VertexContent >::isNull (  )  const [inline]

Test if a vertex is a null vertex.

Reimplemented from graph::Vertex< VERTEX_ARGS >.

Definition at line 608 of file vertex.h.

References graph::Vertex< VERTEX_ARGS >::_content.

00609     {
00610       return this->_content == 0 or this->_content->count == 0;
00611     }

template<typename VertexContent>
WeakVertex& graph::WeakVertex< VertexContent >::operator= ( const WeakVertex< VertexContent > &  other  )  [inline]

Set the content of the weak reference.

Definition at line 577 of file vertex.h.

References graph::Vertex< VertexContent >::_content, and graph::Vertex< VERTEX_ARGS >::_content.

00578     {
00579       this->_content = other._content;
00580       return *this;
00581     }


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:13 2013 for VVE by  doxygen 1.6.3