Coconut Framework  beta
Classes | Typedefs | Functions
CNEdge.h File Reference

Define CNEdge class. More...

#include "CNObject.h"
#include "CNType.h"
#include "CNForwarders.h"

Go to the source code of this file.

Classes

struct  CNEdge
 Edge of the graph. More...
 
struct  CNEdgeMethods
 Methods for CNNode. More...
 

Typedefs

typedef void(* CNPrintEdgeFuncRef )(struct CNText *buf, const struct CNEdge *src)
 

Functions

struct CNEdgeCNAllocateEdge (struct CNGraph *parent, size_t size, const struct CNEdgeMethods *methods)
 Allocate CNEdge. More...
 
static void CNRetainEdge (struct CNEdge *dst)
 Retrain the resource for the CNEdge. More...
 
static void CNReleaseEdge (struct CNEdge *dst)
 Release the resource for the CNEdge. More...
 
static struct CNResource * CNResourceOfEdge (struct CNEdge *src)
 Get resource of the CNEdge. More...
 
static struct CNObjectCNObjectOfEdge (struct CNEdge *src)
 Get object of the edge. More...
 
void CNDestroyContextOfEdge (struct CNEdge *dst)
 Release the contex of the edge. More...
 
static void CNPrintEdge (struct CNText *buf, const struct CNEdge *src)
 Print the context of edge. More...
 
static struct CNNodeCNProducerNodeOfEdge (const struct CNEdge *src)
 Get producer node from edge. More...
 
void CNSetProducerNodeToEdge (struct CNEdge *dst, struct CNNode *src)
 Set producer node for the edge. More...
 
static struct CNNodeCNConsumerNodeOfEdge (const struct CNEdge *src)
 Get consumer node from edge. More...
 
void CNSetConsumerNodeToEdge (struct CNEdge *dst, struct CNNode *src)
 Set consumer node for the edge. More...
 
static CNBoolean CNIsVisitedEdge (const struct CNEdge *src)
 Check visited flag in edge. More...
 
static void CNSetVisitedEdge (struct CNEdge *dst, CNBoolean flag)
 Set visited flag to edge. More...
 

Detailed Description

Define CNEdge class.

Copyright
Copyright (C) 2013 Steel Wheels Project

Typedef Documentation

typedef void(* CNPrintEdgeFuncRef)(struct CNText *buf, const struct CNEdge *src)

Function to dump the context of CNEdge

Function Documentation

struct CNEdge* CNAllocateEdge ( struct CNGraph parent,
size_t  size,
const struct CNEdgeMethods methods 
)

Allocate CNEdge.

Returns
Allocated edge
Parameters
parentOwner of the node
sizeSize of edge class
methodsMethods of edge class
Note
The parent graph will be the owner of the allocated edge. The edge will be released when the parent graph is released.
static void CNRetainEdge ( struct CNEdge dst)
inlinestatic

Retrain the resource for the CNEdge.

Parameters
dstDestination edge

References CNRetainObject(), and CNEdge::superClass.

static void CNReleaseEdge ( struct CNEdge dst)
inlinestatic

Release the resource for the CNEdge.

Parameters
dstDestination edge

References CNReleaseObject(), and CNEdge::superClass.

static struct CNResource* CNResourceOfEdge ( struct CNEdge src)
static

Get resource of the CNEdge.

Returns
Resource of the edge
Parameters
srcSource edge

References CNResourceOfObject(), and CNEdge::superClass.

static struct CNObject* CNObjectOfEdge ( struct CNEdge src)
static

Get object of the edge.

Returns
Object
Parameters
srcSource edge

References CNEdge::superClass.

void CNDestroyContextOfEdge ( struct CNEdge dst)

Release the contex of the edge.

Parameters
dstDestination edge
Note
You can call this in the dealloc function of the node class.
static void CNPrintEdge ( struct CNText buf,
const struct CNEdge src 
)
inlinestatic

Print the context of edge.

Parameters
bufText buffer
srcSource node

References CNMethodsOfObject(), CNEdgeMethods::printEdge, and CNEdge::superClass.

static struct CNNode* CNProducerNodeOfEdge ( const struct CNEdge src)
static

Get producer node from edge.

Returns
Producer node
Parameters
srcSource edge

References CNEdge::producerNode.

void CNSetProducerNodeToEdge ( struct CNEdge dst,
struct CNNode src 
)

Set producer node for the edge.

Parameters
dstDestination edge
srcSource node
static struct CNNode* CNConsumerNodeOfEdge ( const struct CNEdge src)
static

Get consumer node from edge.

Returns
Consumer node
Parameters
srcSource edge

References CNEdge::consumerNode.

void CNSetConsumerNodeToEdge ( struct CNEdge dst,
struct CNNode src 
)

Set consumer node for the edge.

Parameters
dstDestination edge
srcSource node
static CNBoolean CNIsVisitedEdge ( const struct CNEdge src)
inlinestatic

Check visited flag in edge.

Returns
Visited flag
Parameters
srcSource ednge

References CNEdge::isVisited.

static void CNSetVisitedEdge ( struct CNEdge dst,
CNBoolean  flag 
)
inlinestatic

Set visited flag to edge.

Parameters
dstDestination edge
flagFlag value

References CNEdge::isVisited.