11 #ifndef BIOPROCESSING_GRAPH_BASEEDGE
12 #define BIOPROCESSING_GRAPH_BASEEDGE
15 #include <cartobase/smart/rcptr.h>
20 template <
typename V>
class BaseEdge;
21 template <
typename V>
class BaseEdgeRef;
87 os <<
"E{ " << e.
x() <<
" -- " << e.
y() <<
" }";
100 template <
typename V>
106 typedef carto::rc_ptr<BaseEdge<V> >
Base;
138 virtual const Vertex x()
const {
return (*this)->x(); }
142 virtual const Vertex y()
const {
return (*this)->y(); }
154 if( !(*
this) && !
other )
156 else if( !(*
this) || !
other )
159 return *(this->get()) == *(
other.get());
163 return !( *
this ==
other );
170 return this > &
other;
177 return this < &
other;
181 return ( *
this ==
other ) || ( *
this >
other );
185 return ( *
this ==
other ) || ( *
this <
other );
200 template <
typename V>
std::ostream & operator<<(std::ostream &os, const bio::BaseEdge< V > &e)
Print of a BaseEdge.
Reference counting pointer to a BaseEdge.
virtual bool operator>(const This &other) const
virtual bool operator>=(const This &other) const
carto::rc_ptr< BaseEdge< V > > Base
Base class.
Pointed::Vertex Vertex
Usable vertex type.
BaseEdgeRef(const Base &other)
Copy constructor (it copies the reference, it does not duplicate the pointed object)
Pointed::Edge Edge
Usable edge type.
virtual bool operator!=(const This &other) const
virtual const Vertex other(const Vertex &v) const
access the vertex that is not v
BaseEdgeRef(Pointed *e)
Constructor from a pointer (the pointer should either be created by new, or be already referenced by ...
Pointed::Edge Ref
Reference type.
BaseEdgeRef()
Default constructor (creates an empty pointer)
BaseEdgeRef< V > This
Type of *this.
virtual bool operator==(const This &other) const
There is equality if both pointers are none, or if both pointed objects are equal.
virtual Vertex other(const Vertex &v)
access the vertex that is not v
virtual Vertex x()
access the first vertex (arbitrary choice for non oriented edges)
virtual bool operator<(const This &other) const
virtual Vertex y()
access the second vertex (arbitrary choice for non oriented edges)
static Edge none()
Empty pointer factory.
virtual const Vertex y() const
access the second vertex (arbitrary choice for non oriented edges)
virtual bool operator<=(const This &other) const
virtual const Vertex x() const
access the first vertex (arbitrary choice for non oriented edges)
BaseEdge< V > Pointed
Pointed object type.
virtual bool operator!=(const This &other) const
virtual bool operator>=(const This &other) const
virtual const Vertex y() const
access the second vertex (arbitrary choice for non oriented edges)
virtual Vertex x()
access the first vertex (arbitrary choice for non oriented edges)
virtual bool operator<(const This &other) const
BaseEdgeRef< V > Ref
Reference type.
BaseEdgeRef< V > Edge
Usable Edge type (RC)
virtual bool operator<=(const This &other) const
virtual const Vertex x() const
access the first vertex (arbitrary choice for non oriented edges)
virtual bool operator>(const This &other) const
virtual bool operator==(const This &other) const
BaseEdge< V > This
Type of *this.
virtual Vertex y()
access the second vertex (arbitrary choice for non oriented edges)
virtual const Vertex other(const Vertex &v) const
access the vertex that is not v
virtual Vertex other(const Vertex &v)
access the vertex that is not v