Overview     Modules     Class Hierarchy     Classes     Members  

tlp::AbstractProperty< Tnode, Tedge, TPROPERTY > Class Template Reference
[Properties]

This class is used to store a property of a graph. It implements PropertyInterface and add new methods to deal with two distinct type of values :

More...

#include <AbstractProperty.h>

Inheritance diagram for tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >:
Collaboration diagram for tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >:

List of all members.

Classes

  • class MetaValueCalculator
    This class is used to delegate the computation of the values associated to meta nodes or edges. More...

Public Member Functions

Static Public Member Functions

Static Public Attributes

Protected Types

Protected Member Functions

Protected Attributes

Friends


Detailed Description

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
class tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >

This class is used to store a property of a graph. It implements PropertyInterface and add new methods to deal with two distinct type of values :

An AbstractProperty can be connected or not to a PropertyAlgorithm. In the first case it can be seen as buffer beetween the property and the user. In the second case it is only a memory area for storing data. An AbstractProperty is an Observable (through PropertyInterface), so it can be observed by others objects.


Member Typedef Documentation

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
typedef PropertyAlgorithm tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::PAlgorithm [protected]

Constructor & Destructor Documentation

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::AbstractProperty ( Graph ,
std::string  n = "" 
)

Member Function Documentation

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::clone_handler ( AbstractProperty< Tnode, Tedge, TPROPERTY > &   )  [inline, protected, virtual]

Enable to clone part of sub_class.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::computeMetaValue ( edge  mE,
tlp::Iterator< edge > *  itE,
Graph mg 
) [inline, virtual]

Set a computed value for the meta edge mE representing the edges from the iterator itE. mg is the graph owning the meta edge

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::computeMetaValue ( node  mN,
Graph sg,
Graph mg 
) [inline, virtual]

Set a computed value for the meta node mN pointing to the sub-graph sg mg is the graph owning the meta node

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::copy ( const edge  destination,
const edge  source,
PropertyInterface property,
bool  ifNotDefault = false 
) [inline, virtual]

Copies the value help by a property on an edge to another edge on this property.

Parameters:
destination The edge to copy the value to.
source The edge to copy the value from.
property The property holding the value to copy.
ifNotDefault Whether to ignore default-valuated nodes or not. Defaults to false.
Returns:
void
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::copy ( const node  destination,
const node  source,
PropertyInterface property,
bool  ifNotDefault = false 
) [inline, virtual]

Copies the value help by a property on a node to another node on this property.

Parameters:
destination The node to copy the value to.
source The node to copy the value from.
property The property holding the value to copy.
ifNotDefault Whether to ignore default-valuated nodes or not. Defaults to false.
Returns:
void
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::erase ( const edge  e  )  [inline, virtual]

Resets the value of an edge to the default value.

Parameters:
e The edge to reset the value of.
Returns:
void

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::erase ( const node  n  )  [inline, virtual]

Resets the value of a node to the default value.

Parameters:
n The node to reset the value of.
Returns:
void

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeDataMemValue ( const edge  e  )  const [inline, virtual]

Returns a pointer to a DataMem structure embedding the edge registered value WARNING: it is of the caller responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeDefaultDataMemValue (  )  const [inline, virtual]

Returns a pointer to a DataMem structure embedding the edge default value WARNING: the caller have the responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual std::string tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeDefaultStringValue (  )  const [inline, virtual]

Returns a string representation of the edge default value

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
Tedge::RealType tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeDefaultValue (  )  const

Returns the default edge value of the property.

Returns:
:RealType The default value applied to edges.
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual std::string tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeStringValue ( const edge  e  )  const [inline, virtual]

Returns a string conversion of the value registered for the given edge

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
tlp::StoredType<typename Tedge::RealType>::ReturnedConstValue tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getEdgeValue ( const edge  e  )  const

Returns the value associated to the edge e in this property. If there is no value, it returns the default edge value.

Parameters:
e The edge for which we want to get the value of the property.
Returns:
:StoredType< Tedge::RealType >::ReturnedConstValue The value of the property for this edge.
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeDataMemValue ( const node  n  )  const [inline, virtual]

Returns a pointer to a DataMem structure embedding the node registered value WARNING: it is of the caller responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeDefaultDataMemValue (  )  const [inline, virtual]

Returns a pointer to a DataMem structure embedding the node default value WARNING: it is of the caller responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual std::string tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeDefaultStringValue (  )  const [inline, virtual]

Returns a string representation of the node default value

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
Tnode::RealType tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeDefaultValue (  )  const

Returns the default node value of the property.

Returns:
:RealType The default value applied to nodes.
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual std::string tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeStringValue ( const node  n  )  const [inline, virtual]

Returns a string conversion of the value registered for the given node

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
tlp::StoredType<typename Tnode::RealType>::ReturnedConstValue tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNodeValue ( const node  n  )  const

Returns the value associated with the node n in this property. If there is no value, it returns the default ndoe value.

Parameters:
n The node for which we want to get the value of the property.
Returns:
:StoredType< Tnode::RealType >::ReturnedConstValue The value of the property for this node.
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNonDefaultDataMemValue ( const edge  e  )  const [inline, virtual]

Returns a NULL pointer if the given edge registered value is the default else returns a pointer to a DataMem structure embedding the value. WARNING: it is of the caller responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual DataMem* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNonDefaultDataMemValue ( const node  n  )  const [inline, virtual]

Returns a NULL pointer if the given node registered value is the default else returns a pointer to a DataMem structure embedding the value WARNING: it is of the caller responsability to delete the returned structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual tlp::Iterator<edge>* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNonDefaultValuatedEdges ( const Graph g = NULL  )  const [virtual]

Returns an iterator on all edges whose value is different from the default value. When the pointer to the graph is not NULL, only the edges owned by this graph are returned by the iterator.

Warning:
Ownership of the iterator belongs to the caller, i.e. the caller must delete the operator.
Parameters:
g If not NULL, only iterate on edges from this Graph. Defaults to NULL.
Returns:
:Iterator< tlp::node >* A new Iterator on edges whose value is not default.

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual tlp::Iterator<node>* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::getNonDefaultValuatedNodes ( const Graph g = NULL  )  const [virtual]

Returns an iterator on all nodes whose value is different from the default value. When the pointer to the graph is not NULL, only the nodes owned by this graph are returned by the iterator.

Warning:
Ownership of the iterator belongs to the caller, i.e. the caller must delete the operator.
Parameters:
g If not NULL, only iterate on nodes from this Graph. Defaults to NULL.
Returns:
:Iterator< tlp::node >* A new Iterator on nodes whose value is not default.

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
static void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::initFactory (  )  [inline, static]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual AbstractProperty<Tnode,Tedge,TPROPERTY>& tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::operator= ( AbstractProperty< Tnode, Tedge, TPROPERTY > &  prop  )  [inline, virtual]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllEdgeDataMemValue ( const DataMem v  )  [inline, virtual]

Clear all edges registered values, and set a new edge default value using the value embedded in the pointed DataMem structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual bool tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllEdgeStringValue ( const std::string &  v  )  [inline, virtual]

Clear all edges registered values, and set a new edge default value in converting the given string representation of a value

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllEdgeValue ( const typename Tedge::RealType &  v  )  [virtual]

Sets the value of all edges and notify the observers.

Parameters:
v The value to set to all edges.
Returns:
void
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllNodeDataMemValue ( const DataMem v  )  [inline, virtual]

Clear all nodes registered values, and set a new node default value using the value embedded in the pointed DataMem structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual bool tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllNodeStringValue ( const std::string &  v  )  [inline, virtual]

Clear all nodes registered values, and set a new node default value in converting the given string representation of a value

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setAllNodeValue ( const typename Tnode::RealType &  v  )  [virtual]

Sets the value of all nodes and notify the observers.

Parameters:
v The value to set to all nodes.
Returns:
void
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setEdgeDataMemValue ( const edge  e,
const DataMem v 
) [inline, virtual]

Register a new value for the given node using the value embedded in the pointed DataMem structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual bool tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setEdgeStringValue ( const edge  e,
const std::string &  v 
) [inline, virtual]

Register a new value for the given edge in converting the given string representation

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setEdgeValue ( const edge  e,
const typename Tedge::RealType &  v 
) [virtual]

Set the value of an edge and notify the observers of a modification.

Parameters:
e The edge to set the value of.
v The value to affect for this edge.
Returns:
void
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setMetaValueCalculator ( PropertyInterface::MetaValueCalculator mvCalc  )  [inline, virtual]

Sets the meta value calculator. Be careful that its destruction is not managed by the property

Reimplemented from tlp::PropertyInterface.

Reimplemented in tlp::DoubleProperty.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setNodeDataMemValue ( const node  n,
const DataMem v 
) [inline, virtual]

Register a new value for the given node using the value embedded in the pointed DataMem structure

Implements tlp::PropertyInterface.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual bool tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setNodeStringValue ( const node  n,
const std::string &  v 
) [inline, virtual]

Register a new value for the given node in converting the given string representation

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
virtual void tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::setNodeValue ( const node  n,
const typename Tnode::RealType &  v 
) [virtual]

Sets the value of a node and notify the observers of a modification.

Parameters:
n The node to set the value of.
v The value to affect for this node.
Returns:
void

Friends And Related Function Documentation

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
friend class Graph [friend]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
friend class GraphView [friend]

Member Data Documentation

template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
Tedge::RealType tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::edgeDefaultValue [protected]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
MutableContainer<typename Tedge::RealType> tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::edgeProperties [protected]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
TemplateFactory< PropertyFactory<TPROPERTY>, TPROPERTY, PropertyContext >* tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::factory [static]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
Tnode::RealType tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::nodeDefaultValue [protected]
template<class Tnode, class Tedge, class TPROPERTY = PropertyAlgorithm>
MutableContainer<typename Tnode::RealType> tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >::nodeProperties [protected]


Tulip Software by LaBRI Visualization Team    2001 - 2011