libgexf  0.1.3
Public Member Functions | Friends | List of all members
libgexf::Data Class Reference

Associated data and attributes on nodes and edges. More...

#include <data.h>

Public Member Functions

 Data (const Data &orig)
 Copy constructor.
 
std::string getNodeLabel (const libgexf::t_id node_id) const
 Get node label. More...
 
bool hasNodeLabel (const libgexf::t_id node_id) const
 Check if the node label exists. More...
 
void setNodeLabel (const libgexf::t_id node_id, const std::string &label)
 Set node label. More...
 
std::string getEdgeLabel (const libgexf::t_id edge_id) const
 Get edge label. More...
 
bool hasEdgeLabel (const libgexf::t_id edge_id) const
 Check if the edge label exists. More...
 
void setEdgeLabel (const libgexf::t_id edge_id, const std::string &label)
 Set edge label. More...
 
void addNodeAttributeColumn (const libgexf::t_id id, const std::string &title, const std::string &type="STRING")
 Add a node attribute column. More...
 
void addEdgeAttributeColumn (const libgexf::t_id id, const std::string &title, const std::string &type="STRING")
 Add an edge attribute column. More...
 
void setNodeAttributeDefault (const libgexf::t_id attr_id, const std::string &default_value)
 Set the default value of a node attribute. More...
 
void setEdgeAttributeDefault (const libgexf::t_id attr_id, const std::string &default_value)
 Set the default value of an edge attribute. More...
 
void setNodeAttributeOptions (const libgexf::t_id attr_id, const std::string &options)
 Set the options of a node attribute. More...
 
void setEdgeAttributeOptions (const libgexf::t_id attr_id, const std::string &options)
 Set the options of an edge attribute. More...
 
void setNodeValue (const libgexf::t_id node_id, const libgexf::t_id attr_id, const std::string &value)
 Set the node value of an attribute. More...
 
void setEdgeValue (const libgexf::t_id edge_id, const libgexf::t_id attr_id, const std::string &value)
 Set the edge value of an attribute. More...
 
libgexf::AttributeItergetNodeAttributeColumn () const
 Get an iterator on the node attribute column. More...
 
libgexf::AttributeItergetEdgeAttributeColumn () const
 Get an iterator on the edge attribute column. More...
 
std::string getNodeAttribute (const libgexf::t_id node_id, const libgexf::t_id attr_id) const
 Get the node attribute value. More...
 
std::string getEdgeAttribute (const libgexf::t_id edge_id, const libgexf::t_id attr_id) const
 Get the edge attribute value. More...
 
libgexf::AttValueItergetNodeAttributeRow (const libgexf::t_id node_id) const
 Get an iterator on the node attribute row. More...
 
libgexf::AttValueItergetEdgeAttributeRow (const libgexf::t_id edge_id) const
 Get an iterator on the edge attribute row. More...
 
std::string getNodeAttributeDefault (const libgexf::t_id attr_id) const
 Get the default value of a node attribute. More...
 
std::string getEdgeAttributeOptions (const libgexf::t_id attr_id) const
 Get the options of an edge attribute. More...
 
std::string getNodeAttributeOptions (const libgexf::t_id attr_id) const
 Get the options of a node attribute. More...
 
std::string getEdgeAttributeDefault (const libgexf::t_id attr_id) const
 Get the default value of an edge attribute. More...
 
bool hasNodeAttributeDefault (const libgexf::t_id attr_id) const
 Check if a node attribute has a default value. More...
 
bool hasEdgeAttributeDefault (const libgexf::t_id attr_id) const
 Check if an edge attribute has a default value. More...
 
bool hasNodeAttributeOptions (const libgexf::t_id attr_id) const
 Check if a node attribute has options. More...
 
bool hasEdgeAttributeOptions (const libgexf::t_id attr_id) const
 Check if an edge attribute has options. More...
 
bool isNodeAttributeOption (const libgexf::t_id attr_id, const std::string &option) const
 Check if an option is available for the given node attribute. More...
 
bool isEdgeAttributeOption (const libgexf::t_id attr_id, const std::string &option) const
 Check if an option is available for the given edge attribute. More...
 
void removeNodeAttributeColumn (const libgexf::t_id attr_id)
 
void removeEdgeAttributeColumn (const libgexf::t_id attr_id)
 
void clearNodeAttributes (const libgexf::t_id node_id)
 Delete all attribute values for a node. More...
 
void clearEdgeAttributes (const libgexf::t_id edge_id)
 Delete all attribute values for an edge. More...
 
void clear ()
 Clear all attributes (columns an rows)
 
void clearEdgesAttributes ()
 Clear edge attributes (columns an rows), and labels.
 

Friends

class AttributeIter
 
class AttValueIter
 
std::ostream & operator<< (std::ostream &os, const Data &o)
 

Detailed Description

Associated data and attributes on nodes and edges.

Member Function Documentation

◆ addEdgeAttributeColumn()

void libgexf::Data::addEdgeAttributeColumn ( const libgexf::t_id  id,
const std::string &  title,
const std::string &  type = "STRING" 
)

Add an edge attribute column.

Parameters
id: attribute ID
title: name of the edge attribute
type: type of attribute (integer, double, float, boolean, string or list-string)

◆ addNodeAttributeColumn()

void libgexf::Data::addNodeAttributeColumn ( const libgexf::t_id  id,
const std::string &  title,
const std::string &  type = "STRING" 
)

Add a node attribute column.

Parameters
id: attribute ID
title: name of the node attribute
type: type of attribute (integer, double, float, boolean, string or list-string)

◆ clearEdgeAttributes()

void libgexf::Data::clearEdgeAttributes ( const libgexf::t_id  edge_id)

Delete all attribute values for an edge.

Parameters
edge_id: edge ID

◆ clearNodeAttributes()

void libgexf::Data::clearNodeAttributes ( const libgexf::t_id  node_id)

Delete all attribute values for a node.

Parameters
node_id: node ID

◆ getEdgeAttribute()

string libgexf::Data::getEdgeAttribute ( const libgexf::t_id  edge_id,
const libgexf::t_id  attr_id 
) const

Get the edge attribute value.

Parameters
edge_id: edge ID
attr_id: attribute ID
Returns
edge attribute value

◆ getEdgeAttributeColumn()

AttributeIter * libgexf::Data::getEdgeAttributeColumn ( ) const

Get an iterator on the edge attribute column.

Returns
Attribute iterator instance

◆ getEdgeAttributeDefault()

string libgexf::Data::getEdgeAttributeDefault ( const libgexf::t_id  attr_id) const

Get the default value of an edge attribute.

Parameters
attr_id: attribute ID
Returns
default value

◆ getEdgeAttributeOptions()

std::string libgexf::Data::getEdgeAttributeOptions ( const libgexf::t_id  attr_id) const

Get the options of an edge attribute.

Parameters
attr_id: attribute ID
Returns
options

◆ getEdgeAttributeRow()

AttValueIter * libgexf::Data::getEdgeAttributeRow ( const libgexf::t_id  edge_id) const

Get an iterator on the edge attribute row.

Parameters
edge_id: edge ID
Returns
iterator instance on attribute values

◆ getEdgeLabel()

string libgexf::Data::getEdgeLabel ( const libgexf::t_id  edge_id) const

Get edge label.

Parameters
edge_id: edge ID

◆ getNodeAttribute()

string libgexf::Data::getNodeAttribute ( const libgexf::t_id  node_id,
const libgexf::t_id  attr_id 
) const

Get the node attribute value.

Parameters
node_id: node ID
attr_id: attribute ID
Returns
node attribute value

◆ getNodeAttributeColumn()

AttributeIter * libgexf::Data::getNodeAttributeColumn ( ) const

Get an iterator on the node attribute column.

Returns
Attribute iterator instance

◆ getNodeAttributeDefault()

string libgexf::Data::getNodeAttributeDefault ( const libgexf::t_id  attr_id) const

Get the default value of a node attribute.

Parameters
attr_id: attribute ID
Returns
default value

◆ getNodeAttributeOptions()

std::string libgexf::Data::getNodeAttributeOptions ( const libgexf::t_id  attr_id) const

Get the options of a node attribute.

Parameters
attr_id: attribute ID
Returns
options

◆ getNodeAttributeRow()

AttValueIter * libgexf::Data::getNodeAttributeRow ( const libgexf::t_id  node_id) const

Get an iterator on the node attribute row.

Parameters
node_id: node ID
Returns
iterator instance on attribute values

◆ getNodeLabel()

string libgexf::Data::getNodeLabel ( const libgexf::t_id  node_id) const

Get node label.

Parameters
node_id: node ID

◆ hasEdgeAttributeDefault()

bool libgexf::Data::hasEdgeAttributeDefault ( const libgexf::t_id  attr_id) const

Check if an edge attribute has a default value.

Parameters
attr_id: attribute ID
Returns
true if the default value exists, false otherwise

◆ hasEdgeAttributeOptions()

bool libgexf::Data::hasEdgeAttributeOptions ( const libgexf::t_id  attr_id) const

Check if an edge attribute has options.

Parameters
attr_id: attribute ID
Returns
true if options exists, false otherwise

◆ hasEdgeLabel()

bool libgexf::Data::hasEdgeLabel ( const libgexf::t_id  edge_id) const

Check if the edge label exists.

Parameters
edge_id: edge ID

◆ hasNodeAttributeDefault()

bool libgexf::Data::hasNodeAttributeDefault ( const libgexf::t_id  attr_id) const

Check if a node attribute has a default value.

Parameters
attr_id: attribute ID
Returns
true if the default value exists, false otherwise

◆ hasNodeAttributeOptions()

bool libgexf::Data::hasNodeAttributeOptions ( const libgexf::t_id  attr_id) const

Check if a node attribute has options.

Parameters
attr_id: attribute ID
Returns
true if options exists, false otherwise

◆ hasNodeLabel()

bool libgexf::Data::hasNodeLabel ( const libgexf::t_id  node_id) const

Check if the node label exists.

Parameters
node_id: node ID

◆ isEdgeAttributeOption()

bool libgexf::Data::isEdgeAttributeOption ( const libgexf::t_id  attr_id,
const std::string &  option 
) const

Check if an option is available for the given edge attribute.

Parameters
attr_id: attribute ID
option: option strings separated by pipes (|)
Returns
true if the option is available, false otherwise

◆ isNodeAttributeOption()

bool libgexf::Data::isNodeAttributeOption ( const libgexf::t_id  attr_id,
const std::string &  option 
) const

Check if an option is available for the given node attribute.

Parameters
attr_id: attribute ID
option: option strings separated by pipes (|)
Returns
true if the option is available, false otherwise

◆ setEdgeAttributeDefault()

void libgexf::Data::setEdgeAttributeDefault ( const libgexf::t_id  attr_id,
const std::string &  default_value 
)

Set the default value of an edge attribute.

Parameters
attr_id: attribute ID
default_value: default value

◆ setEdgeAttributeOptions()

void libgexf::Data::setEdgeAttributeOptions ( const libgexf::t_id  attr_id,
const std::string &  options 
)

Set the options of an edge attribute.

Parameters
attr_id: attribute ID
options: options

◆ setEdgeLabel()

void libgexf::Data::setEdgeLabel ( const libgexf::t_id  edge_id,
const std::string &  label 
)

Set edge label.

Parameters
edge_id: edge ID
label: edge label

◆ setEdgeValue()

void libgexf::Data::setEdgeValue ( const libgexf::t_id  edge_id,
const libgexf::t_id  attr_id,
const std::string &  value 
)

Set the edge value of an attribute.

Parameters
edge_id: edge ID
attr_id: attribute ID
value: edge value

◆ setNodeAttributeDefault()

void libgexf::Data::setNodeAttributeDefault ( const libgexf::t_id  attr_id,
const std::string &  default_value 
)

Set the default value of a node attribute.

Parameters
attr_id: attribute ID
default_value: default value

◆ setNodeAttributeOptions()

void libgexf::Data::setNodeAttributeOptions ( const libgexf::t_id  attr_id,
const std::string &  options 
)

Set the options of a node attribute.

Parameters
attr_id: attribute ID
options: options

◆ setNodeLabel()

void libgexf::Data::setNodeLabel ( const libgexf::t_id  node_id,
const std::string &  label 
)

Set node label.

Parameters
node_id: node ID
label: node label

◆ setNodeValue()

void libgexf::Data::setNodeValue ( const libgexf::t_id  node_id,
const libgexf::t_id  attr_id,
const std::string &  value 
)

Set the node value of an attribute.

Parameters
node_id: node ID
attr_id: attribute ID
value: node value

Friends And Related Function Documentation

◆ AttributeIter

friend class AttributeIter
friend

◆ AttValueIter

friend class AttValueIter
friend

The documentation for this class was generated from the following files: