Motr  M0
Graph

Data Structures

struct  m0_garc
 
struct  m0_gvertice
 
struct  m0_graph
 
struct  m0_gvertice_type
 
struct  m0_garc_type
 

Enumerations

enum  { VTYPE_MAX = 256 }
 
enum  { M0_GRAPH_ARC_PER_NODE_MAX = 16 }
 

Functions

static struct m0_garcarc_get (const struct m0_gvertice *src, const struct m0_garc_type *atype)
 
static struct m0_gverticearc_try (const struct m0_gvertice *vertice, const struct m0_garc_type *atype)
 
static void graph_add (struct m0_graph *g, struct m0_gvertice *vertice)
 
static void graph_del (struct m0_graph *g, struct m0_gvertice *vertice)
 
static void vertice_init (struct m0_gvertice *vertice, const struct m0_gvertice_type *vt, const struct m0_fid *fid)
 
static bool has_arc (const struct m0_gvertice *vertice, const struct m0_garc_type *atype)
 
static const struct m0_gvertice_typevtype (const struct m0_gvertice *src)
 
void m0_gvertice_link (struct m0_gvertice *src, struct m0_gvertice *dst, const struct m0_garc_type *atype)
 
void m0_gvertice_unlink (struct m0_gvertice *src, struct m0_gvertice *dst, const struct m0_garc_type *atype)
 
bool m0_gvertice_linked (const struct m0_gvertice *src, const struct m0_gvertice *dst, const struct m0_garc_type *atype)
 
bool m0_gvertice_is_set (const struct m0_gvertice *vertice, const struct m0_garc_type *atype)
 
void m0_gvertice_init (struct m0_graph *g, struct m0_gvertice *vertice, const struct m0_gvertice_type *vt, const struct m0_fid *fid)
 
void m0_gvertice_fini (struct m0_graph *g, struct m0_gvertice *vertice)
 
bool m0_gvertice_invariant (const struct m0_gvertice *vertice)
 
bool m0_gvertice_type_invariant (const struct m0_gvertice_type *vt)
 
bool m0_garc_type_invariant (const struct m0_gvertice_type *vt, const struct m0_garc_type *atype)
 
bool m0_graph_invariant (const struct m0_graph *graph)
 
struct m0_gverticem0_garc_try (const struct m0_gvertice *vertice, const struct m0_garc_type *atype)
 
void m0_gvertice_type_register (struct m0_gvertice_type *vt)
 
void m0_garc_type_register (const struct m0_garc_type *atype)
 
void m0_garc_type_pair_register (struct m0_garc_type *direct, struct m0_garc_type *reverse)
 
void m0_garc_type_add (struct m0_gvertice_type *vt, const struct m0_garc_type *atype)
 
int m0_garc_follow (const struct m0_gvertice *vertice, const struct m0_garc_type *atype,...)
 
M0_INTERNAL int m0_graph_mod_init (void)
 
M0_INTERNAL void m0_graph_mod_fini (void)
 

Variables

static struct m0_garc_type GRAPH_PREV
 
static struct m0_garc_type GRAPH_NEXT
 
static const struct m0_gvertice_typevtypes [VTYPE_MAX]
 

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VTYPE_MAX 

Definition at line 56 of file graph.c.

◆ anonymous enum

anonymous enum
Enumerator
M0_GRAPH_ARC_PER_NODE_MAX 

Definition at line 70 of file graph.h.

Function Documentation

◆ arc_get()

static struct m0_garc * arc_get ( const struct m0_gvertice src,
const struct m0_garc_type atype 
)
static

Definition at line 239 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ arc_try()

static struct m0_gvertice * arc_try ( const struct m0_gvertice vertice,
const struct m0_garc_type atype 
)
static

Definition at line 225 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graph_add()

static void graph_add ( struct m0_graph g,
struct m0_gvertice vertice 
)
static

Definition at line 257 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graph_del()

static void graph_del ( struct m0_graph g,
struct m0_gvertice vertice 
)
static

Definition at line 271 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_arc()

static bool has_arc ( const struct m0_gvertice vertice,
const struct m0_garc_type atype 
)
static

Definition at line 291 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_garc_follow()

int m0_garc_follow ( const struct m0_gvertice vertice,
const struct m0_garc_type atype,
  ... 
)

Definition at line 232 of file graph.c.

◆ m0_garc_try()

struct m0_gvertice * m0_garc_try ( const struct m0_gvertice vertice,
const struct m0_garc_type atype 
)

Definition at line 186 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_garc_type_add()

void m0_garc_type_add ( struct m0_gvertice_type vt,
const struct m0_garc_type atype 
)

Definition at line 217 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_garc_type_invariant()

bool m0_garc_type_invariant ( const struct m0_gvertice_type vt,
const struct m0_garc_type atype 
)

Definition at line 171 of file graph.c.

Here is the caller graph for this function:

◆ m0_garc_type_pair_register()

void m0_garc_type_pair_register ( struct m0_garc_type direct,
struct m0_garc_type reverse 
)

Definition at line 210 of file graph.c.

Here is the caller graph for this function:

◆ m0_garc_type_register()

void m0_garc_type_register ( const struct m0_garc_type atype)

Definition at line 206 of file graph.c.

Here is the caller graph for this function:

◆ m0_graph_invariant()

bool m0_graph_invariant ( const struct m0_graph graph)

Definition at line 181 of file graph.c.

Here is the caller graph for this function:

◆ m0_graph_mod_fini()

M0_INTERNAL void m0_graph_mod_fini ( void  )

Definition at line 316 of file graph.c.

◆ m0_graph_mod_init()

M0_INTERNAL int m0_graph_mod_init ( void  )

Definition at line 308 of file graph.c.

Here is the call graph for this function:

◆ m0_gvertice_fini()

void m0_gvertice_fini ( struct m0_graph g,
struct m0_gvertice vertice 
)

Definition at line 143 of file graph.c.

Here is the call graph for this function:

◆ m0_gvertice_init()

void m0_gvertice_init ( struct m0_graph g,
struct m0_gvertice vertice,
const struct m0_gvertice_type vt,
const struct m0_fid fid 
)

Definition at line 134 of file graph.c.

Here is the call graph for this function:

◆ m0_gvertice_invariant()

bool m0_gvertice_invariant ( const struct m0_gvertice vertice)

Definition at line 152 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_gvertice_is_set()

bool m0_gvertice_is_set ( const struct m0_gvertice vertice,
const struct m0_garc_type atype 
)

Definition at line 125 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_gvertice_link()

void m0_gvertice_link ( struct m0_gvertice src,
struct m0_gvertice dst,
const struct m0_garc_type atype 
)

Definition at line 60 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_gvertice_linked()

bool m0_gvertice_linked ( const struct m0_gvertice src,
const struct m0_gvertice dst,
const struct m0_garc_type atype 
)

Definition at line 113 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_gvertice_type_invariant()

bool m0_gvertice_type_invariant ( const struct m0_gvertice_type vt)

Definition at line 161 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_gvertice_type_register()

void m0_gvertice_type_register ( struct m0_gvertice_type vt)

Definition at line 193 of file graph.c.

Here is the call graph for this function:

◆ m0_gvertice_unlink()

void m0_gvertice_unlink ( struct m0_gvertice src,
struct m0_gvertice dst,
const struct m0_garc_type atype 
)

Definition at line 90 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertice_init()

static void vertice_init ( struct m0_gvertice vertice,
const struct m0_gvertice_type vt,
const struct m0_fid fid 
)
static

Definition at line 248 of file graph.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vtype()

static const struct m0_gvertice_type * vtype ( const struct m0_gvertice src)
static

Definition at line 285 of file graph.c.

Here is the caller graph for this function:

Variable Documentation

◆ GRAPH_NEXT

static struct m0_garc_type GRAPH_NEXT
static
Initial value:
= {
.at_name = "next in graph",
.at_field = 1
}

Definition at line 45 of file graph.c.

◆ GRAPH_PREV

static struct m0_garc_type GRAPH_PREV
static
Initial value:
= {
.at_name = "prev in graph",
.at_field = 2
}

Definition at line 44 of file graph.c.

◆ vtypes

const struct m0_gvertice_type* vtypes[VTYPE_MAX]
static

Definition at line 58 of file graph.c.