Class InEdgeFilter::Edge

Nested Relationships

This class is a nested type of Class DeviceEnvironmentDirectedGraph::InEdgeFilter.

Class Documentation

class Edge

Provides access to a specific edge Returned by the iterator

See also

In::Filter::iterator

Public Functions

__device__ inline Edge(const InEdgeFilter &parent, const unsigned int &_ipbm_index)

Constructs an edge and directly initialises all of it’s member variables

Note

See member variable documentation for their purposes

__device__ inline bool operator==(const Edge &rhs) const

Equality operator Compares all internal member vars for equality

Note

Does not compare _parent

__device__ inline bool operator!=(const Edge &rhs) const

Inequality operator Returns inverse of equality operator

See also

operator==(const Edge&)

__device__ inline Edge &operator++()

Updates the edge to return variables from the next edge joining the vertex

Returns:

Returns itself

__device__ inline unsigned int getIndex() const

Returns the index of the current edge within the graph’s full list of edges

Note

Edge indexes are not constant, they can change if edges are updated causing the graph’s CSR to be rebuilt

template<typename T, flamegpu::size_type N>
__device__ T getProperty(const char (&property_name)[N]) const

Returns the value for the current edge attached to the named property

Parameters:

property_name – Name of the property

Template Parameters:
  • T – type of the property

  • N – Length of property name (this should be implicit if a string literal is passed to property_name)

Returns:

The specified variable, else 0x0 if an error occurs

template<typename T, flamegpu::size_type N, unsigned int M>
__device__ T getProperty(const char (&property_name)[M], const unsigned int &index) const

Returns the specified property array element from the current edge attached to the named property

Parameters:
  • property_name – name used for accessing the property, this value should be a string literal e.g. “foobar”

  • index – Index of the element within the property array to return

Template Parameters:
  • T – Type of the edge property being accessed

  • N – The length of the edge’s array property, as set within the model description hierarchy

  • M – Length of property name (this should be implicit if a string literal is passed to property_name)

Throws:
  • exception::DeviceError – If name is not a valid property within the edge (flamegpu must be built with SEATBELTS enabled for device error checking)

  • exception::DeviceError – If T is not the type of property ‘name’ within the message (flamegpu must be built with SEATBELTS enabled for device error checking)

  • exception::DeviceError – If index is out of bounds for the property array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)

__device__ unsigned int getEdgeSource() const

Returns the source vertex indexof this edge

Note

getEdgeDestination() is not provided, as this value is required to access an edge via iteration so should already be available