Tulip  5.5.1
Large graphs analysis and drawing
tlp::PropertyInterface Class Referenceabstract

#include <PropertyInterface.h>

+ Inheritance diagram for tlp::PropertyInterface:
+ Collaboration diagram for tlp::PropertyInterface:

Classes

class  MetaValueCalculator
 

Public Member Functions

virtual PropertyInterfaceclonePrototype (Graph *graph, const std::string &name) const =0
 
virtual int compare (const edge e1, const edge e2) const =0
 
virtual int compare (const node n1, const node n2) const =0
 
virtual void computeMetaValue (edge metaEdge, tlp::Iterator< edge > *it, Graph *metaGraph)=0
 
virtual void computeMetaValue (node metaNode, Graph *subgraph, Graph *metaGraph)=0
 
virtual bool copy (const edge destination, const edge source, PropertyInterface *property, bool ifNotDefault=false)=0
 
virtual bool copy (const node destination, const node source, PropertyInterface *property, bool ifNotDefault=false)=0
 
virtual void copy (PropertyInterface *source)=0
 
virtual unsigned int edgeValueSize () const =0
 
virtual void erase (const edge)=0
 
virtual void erase (const node)=0
 
virtual const std::string & getCppClassName () const =0
 
virtual DataMem * getEdgeDataMemValue (const edge e) const =0
 
virtual DataMem * getEdgeDefaultDataMemValue () const =0
 
virtual std::string getEdgeDefaultStringValue () const =0
 
virtual std::string getEdgeStringValue (const edge e) const =0
 
tlp::GraphgetGraph () const
 
MetaValueCalculatorgetMetaValueCalculator ()
 
const std::string & getName () const
 
virtual DataMem * getNodeDataMemValue (const node n) const =0
 
virtual DataMem * getNodeDefaultDataMemValue () const =0
 
virtual std::string getNodeDefaultStringValue () const =0
 
virtual std::string getNodeStringValue (const node n) const =0
 
virtual DataMem * getNonDefaultDataMemValue (const edge e) const =0
 
virtual DataMem * getNonDefaultDataMemValue (const node n) const =0
 
virtual tlp::Iterator< edge > * getNonDefaultValuatedEdges (const Graph *=nullptr) const =0
 
virtual tlp::Iterator< node > * getNonDefaultValuatedNodes (const Graph *=nullptr) const =0
 
virtual const std::string & getTypename () const =0
 
virtual bool hasNonDefaultValuatedEdges (const Graph *=nullptr) const =0
 
virtual bool hasNonDefaultValuatedNodes (const Graph *=nullptr) const =0
 
virtual unsigned int nodeValueSize () const =0
 
virtual unsigned int numberOfNonDefaultValuatedEdges (const Graph *=nullptr) const =0
 
virtual unsigned int numberOfNonDefaultValuatedNodes (const Graph *=nullptr) const =0
 
virtual bool readEdgeDefaultValue (std::istream &)=0
 
virtual bool readEdgeValue (std::istream &, edge)=0
 
virtual bool readNodeDefaultValue (std::istream &)=0
 
virtual bool readNodeValue (std::istream &, node)=0
 
bool rename (const std::string &newName)
 
virtual void setAllEdgeDataMemValue (const DataMem *v)=0
 
virtual bool setAllEdgeStringValue (const std::string &value)=0
 
virtual void setAllNodeDataMemValue (const DataMem *value)=0
 
virtual bool setAllNodeStringValue (const std::string &value)=0
 
virtual void setEdgeDataMemValue (const edge e, const DataMem *v)=0
 
virtual bool setEdgeDefaultStringValue (const std::string &value)=0
 
virtual bool setEdgeStringValue (const edge e, const std::string &value)=0
 
virtual void setMetaValueCalculator (MetaValueCalculator *calculator)
 
virtual void setNodeDataMemValue (const node n, const DataMem *value)=0
 
virtual bool setNodeDefaultStringValue (const std::string &value)=0
 
virtual bool setNodeStringValue (const node n, const std::string &value)=0
 
virtual bool setStringValueToGraphEdges (const std::string &value, const Graph *graph)=0
 
virtual bool setStringValueToGraphNodes (const std::string &value, const Graph *graph)=0
 
virtual void writeEdgeDefaultValue (std::ostream &) const =0
 
virtual void writeEdgeValue (std::ostream &, edge) const =0
 
virtual void writeNodeDefaultValue (std::ostream &) const =0
 
virtual void writeNodeValue (std::ostream &, node) const =0
 
- Public Member Functions inherited from tlp::Observable
void addListener (Observable &listener) const
 
void addListener (Observable *const listener) const
 
void addObserver (Observable &observer) const
 
void addObserver (Observable *const observer) const
 
unsigned int countListeners () const
 
unsigned int countObservers () const
 
unsigned int getReceived () const
 
unsigned int getSent () const
 
void removeListener (Observable &listener) const
 
void removeListener (Observable *const listener) const
 
void removeObserver (Observable &observer) const
 
void removeObserver (Observable *const observer) const
 

Protected Member Functions

void notifyAfterSetAllEdgeValue ()
 
void notifyAfterSetAllNodeValue ()
 
void notifyAfterSetEdgeValue (const edge e)
 
void notifyAfterSetNodeValue (const node n)
 
void notifyBeforeSetAllEdgeValue ()
 
void notifyBeforeSetAllNodeValue ()
 
void notifyBeforeSetEdgeValue (const edge e)
 
void notifyBeforeSetNodeValue (const node n)
 
void notifyDestroy ()
 
void notifyRename (const std::string &newName)
 
- Protected Member Functions inherited from tlp::Observable
 Observable (const Observable &)
 
bool hasOnlookers () const
 
void observableDeleted ()
 
Observableoperator= (const Observable &)
 
void sendEvent (const Event &message)
 
virtual void treatEvent (const Event &message)
 
virtual void treatEvents (const std::vector< Event > &events)
 

Protected Attributes

Graphgraph
 
MetaValueCalculatormetaValueCalculator
 
std::string name
 

Friends

class PropertyManager
 

Additional Inherited Members

- Static Public Member Functions inherited from tlp::Observable
static void disableEventNotification ()
 
static void enableEventNotification ()
 
static tlp::node getNode (const tlp::Observable *obs)
 
static ObservablegetObject (tlp::node n)
 
static const tlp::VectorGraph & getObservableGraph ()
 
static unsigned int getScheduled (tlp::node n)
 
static void holdObservers ()
 
static bool isAlive (tlp::node n)
 
static unsigned int observersHoldCounter ()
 
static void unholdObservers ()
 

Detailed Description

PropertyInterface describes the interface of a graph property.

The intent of a property is to hold a value for each node and edge (e.g. the degree of the nodes).

A property can be used in two different ways : Either it is attached to a graph; and in this case creating and deleting the property is handled by the graph (

See also
Graph::getProperty()).

Either is is detached from a graph, and you have to handle creation and deletion yourself. This is most useful for some algorithms that need a temporary property, but do not want the property to appear on the graph after the computation.

Definition at line 60 of file PropertyInterface.h.

Member Function Documentation

◆ clonePrototype()

virtual PropertyInterface* tlp::PropertyInterface::clonePrototype ( Graph graph,
const std::string &  name 
) const
pure virtual

Creates a property of the same type (e.g. tlp::DoubleProperty) in the graph. The new property will not contain a copy of this property's values.

Parameters
graphThe Graph in which to create the new property.
nameThe name of the new property.
Returns
The newly created property.

Implemented in tlp::CoordVectorProperty, tlp::DoubleVectorProperty, tlp::IntegerVectorProperty, tlp::SizeVectorProperty, tlp::BooleanVectorProperty, tlp::StringVectorProperty, tlp::ColorVectorProperty, tlp::LayoutProperty, tlp::GraphProperty, tlp::SizeProperty, tlp::DoubleProperty, tlp::IntegerProperty, tlp::StringProperty, tlp::BooleanProperty, and tlp::ColorProperty.

◆ compare() [1/2]

◆ compare() [2/2]

◆ computeMetaValue() [1/2]

◆ computeMetaValue() [2/2]

◆ copy() [1/3]

◆ copy() [2/3]

◆ copy() [3/3]

◆ edgeValueSize()

virtual unsigned int tlp::PropertyInterface::edgeValueSize ( ) const
pure virtual

Returns the size in bytes of an edge's value.

Returns
the size of a node's value (0 means the size is not fixed)

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >, tlp::StringVectorProperty, tlp::GraphProperty, and tlp::StringProperty.

◆ erase() [1/2]

◆ erase() [2/2]

◆ getCppClassName()

virtual const std::string& tlp::PropertyInterface::getCppClassName ( ) const
pure virtual

Gets a string giving the name of a the PropertyInterface subclass (e.g "tlp::BooleanProperty", "tlp::DoubleProperty", ...)

Returns
The subclass name.

◆ getEdgeDataMemValue()

◆ getEdgeDefaultDataMemValue()

virtual DataMem* tlp::PropertyInterface::getEdgeDefaultDataMemValue ( ) const
pure virtual

Gets a pointer to the tlp::DataMem structure that contains the edge default value.

Returns
The DataMem structure containing the edge default value.
Warning
The ownership of this pointer is given to the caller.

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >.

◆ getEdgeDefaultStringValue()

virtual std::string tlp::PropertyInterface::getEdgeDefaultStringValue ( ) const
pure virtual

Gets a string representation of the edge default value.

Returns
A string representation of the edge default value.

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >.

◆ getEdgeStringValue()

◆ getMetaValueCalculator()

MetaValueCalculator* tlp::PropertyInterface::getMetaValueCalculator ( )
inline

Gets the MetaValueCalculator of this property.

Returns
The MetaValueCalculator of this property

Definition at line 554 of file PropertyInterface.h.

◆ getName()

const std::string& tlp::PropertyInterface::getName ( ) const
inline

Gets the name of the property (e.g. viewLayout).

Returns
The name of this property.

Definition at line 159 of file PropertyInterface.h.

◆ getNodeDataMemValue()

◆ getNodeDefaultDataMemValue()

virtual DataMem* tlp::PropertyInterface::getNodeDefaultDataMemValue ( ) const
pure virtual

Gets a pointer to the tlp::DataMem structure that contains the node default value.

Returns
The DataMem structure containing the node default value.
Warning
The ownership of this pointer is given to the caller.

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >.

◆ getNodeDefaultStringValue()

virtual std::string tlp::PropertyInterface::getNodeDefaultStringValue ( ) const
pure virtual

Gets a string representation of the node default value.

Returns
A string representation of the node default value.

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >.

◆ getNodeStringValue()

◆ getNonDefaultDataMemValue() [1/2]

◆ getNonDefaultDataMemValue() [2/2]

◆ getNonDefaultValuatedEdges()

◆ getNonDefaultValuatedNodes()

◆ getTypename()

virtual const std::string& tlp::PropertyInterface::getTypename ( ) const
pure virtual

Gets a string describing the type of the property value (e.g. "graph", "double", "layout", "string", "integer", "color", "size").

Returns
The name of this property's type.

Implemented in tlp::CoordVectorProperty, tlp::DoubleVectorProperty, tlp::IntegerVectorProperty, tlp::SizeVectorProperty, tlp::BooleanVectorProperty, tlp::StringVectorProperty, tlp::ColorVectorProperty, tlp::GraphProperty, tlp::LayoutProperty, tlp::SizeProperty, tlp::DoubleProperty, tlp::IntegerProperty, tlp::StringProperty, tlp::BooleanProperty, and tlp::ColorProperty.

+ Here is the caller graph for this function:

◆ hasNonDefaultValuatedEdges()

◆ hasNonDefaultValuatedNodes()

◆ nodeValueSize()

virtual unsigned int tlp::PropertyInterface::nodeValueSize ( ) const
pure virtual

Returns the size in bytes of a node's value.

Returns
the size of a node's value (0 means the size is not fixed)

Implemented in tlp::AbstractProperty< Tnode, Tedge, Tprop >, tlp::StringVectorProperty, tlp::GraphProperty, and tlp::StringProperty.

◆ numberOfNonDefaultValuatedEdges()

◆ numberOfNonDefaultValuatedNodes()

◆ readEdgeDefaultValue()

◆ readEdgeValue()

◆ readNodeDefaultValue()

◆ readNodeValue()

◆ rename()

bool tlp::PropertyInterface::rename ( const std::string &  newName)

Rename a property.

Parameters
thenew name
Returns
returns true if the renaming succeeded. It may fails if a property with the given name already exists

◆ setAllEdgeDataMemValue()

◆ setAllEdgeStringValue()

◆ setAllNodeDataMemValue()

◆ setAllNodeStringValue()

◆ setEdgeDataMemValue()

◆ setEdgeDefaultStringValue()

◆ setEdgeStringValue()

◆ setMetaValueCalculator()

◆ setNodeDataMemValue()

◆ setNodeDefaultStringValue()

◆ setNodeStringValue()

◆ setStringValueToGraphEdges()

virtual bool tlp::PropertyInterface::setStringValueToGraphEdges ( const std::string &  value,
const Graph graph 
)
pure virtual

Sets all the edges value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty). Only the edges from that graph will have their value modified in the property and the default edge value will not be modified.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on all the edges.
graphA graph that defines the set of edges.
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no edge value will be modified in it.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implemented in tlp::GraphProperty, tlp::AbstractProperty< Tnode, Tedge, Tprop >, tlp::AbstractProperty< tlp::DoubleVectorType, tlp::DoubleVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::CoordVectorType, tlp::CoordVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::ColorVectorType, tlp::ColorVectorType, VectorPropertyInterface >, tlp::AbstractProperty< nodeType, edgeType, PropertyInterface >, tlp::AbstractProperty< tlp::StringVectorType, tlp::StringVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::SizeVectorType, tlp::SizeVectorType, VectorPropertyInterface >, tlp::AbstractProperty< vectType, vectType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::BooleanVectorType, tlp::BooleanVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::IntegerVectorType, tlp::IntegerVectorType, VectorPropertyInterface >, and tlp::AbstractProperty< tlp::BooleanType, tlp::BooleanType >.

◆ setStringValueToGraphNodes()

virtual bool tlp::PropertyInterface::setStringValueToGraphNodes ( const std::string &  value,
const Graph graph 
)
pure virtual

Sets all the nodes value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty). Only the nodes from that graph will have their value modified in the property and the default node value will not be modified.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on all the nodes.
graphA graph that defines the set of nodes.
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no node value will be modified in it.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implemented in tlp::GraphProperty, tlp::AbstractProperty< Tnode, Tedge, Tprop >, tlp::AbstractProperty< tlp::DoubleVectorType, tlp::DoubleVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::CoordVectorType, tlp::CoordVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::ColorVectorType, tlp::ColorVectorType, VectorPropertyInterface >, tlp::AbstractProperty< nodeType, edgeType, PropertyInterface >, tlp::AbstractProperty< tlp::StringVectorType, tlp::StringVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::SizeVectorType, tlp::SizeVectorType, VectorPropertyInterface >, tlp::AbstractProperty< vectType, vectType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::BooleanVectorType, tlp::BooleanVectorType, VectorPropertyInterface >, tlp::AbstractProperty< tlp::IntegerVectorType, tlp::IntegerVectorType, VectorPropertyInterface >, and tlp::AbstractProperty< tlp::BooleanType, tlp::BooleanType >.

◆ writeEdgeDefaultValue()

◆ writeEdgeValue()

◆ writeNodeDefaultValue()

◆ writeNodeValue()