SmacqGraphNode Class Reference

This is a node in a graph. Each node references its parents and children. More...

#include <SmacqGraph.h>

Inheritance diagram for SmacqGraphNode:

Inheritance graph
[legend]
Collaboration diagram for SmacqGraphNode:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool set (int argc, const char **argv)
 (Re-)Initialize module
const int getArgc () const
 Return argc.
const char **const getArgv () const
 Return argv (do not modify).
 SmacqGraphNode (std::string)
 SmacqGraphNode (int argc, const char **argv)
SmacqGraphNodeinit (DTS *, SmacqScheduler *)
 This method must be called before a graph is used.
void print (FILE *fh, int indent)
 Print the graph.
std::string print_query ()
 Print the graph in re-parsable syntax.
void log (const char *format,...)
 Log something about this graph (printf-style arguments).
bool distribute_children (DTS *)
 Attempt to distribute children of this graph. Return true iff successful.
Factories
SmacqGraphNodenew_child (int argc, const char **argv)
 Construct a new graph using the given arguments.
SmacqGraphNodeclone (SmacqGraphNode *newParent)
 Recursively clone a graph.
Invariant Optimization
SmacqGraphNodegetInvariants (DTS *, SmacqScheduler *, DtsField &)
 Return a subgraph containing only invariants over the specified field.
SmacqGraphNodegetChildInvariants (DTS *, SmacqScheduler *, DtsField &)
 Same as getInvariants() but operates only on the graph's children.
Scheduling
void seed_produce ()
 Schedule the node to produce.
void runable (DtsObject)
 Schedule the given object to be consumed.
void produce_done ()
 Scheduler is done handling a mustProduce.

Static Public Member Functions

static void do_shutdown (SmacqGraphNode_ptr f)
 Shutdown a graph node (will propagate to parents and children).

Public Attributes

runq< DtsObjectinputq
 Queue of input items to consume.

Protected Attributes

const char ** argv
int argc
struct SmacqModule::algebra algebra
ThreadSafeBoolean shutdown
ThreadSafeBoolean mustProduce
SmacqModuleinstance

Friends

void intrusive_ptr_add_ref (SmacqGraphNode *o)
void intrusive_ptr_release (SmacqGraphNode *o)
 Decrement the reference count.

Parent/Child Relationships

void join (SmacqGraphNode *)
 Attach the specified graph onto the tail(s) of the graph(s).
void join (SmacqGraph *, bool dofree=false)
 Attach the specified graph onto the tail(s) of the graph(s).
void replace (SmacqGraph *)
 Modify parent(s) and children to replace myself with the specified graph.
void dynamic_insert (SmacqGraphNode *, DTS *)
 Insert a new graph between my parents and me.
void add_child (SmacqGraphNode_ptr child, unsigned int channel=0)
 Add a new graph as one of my children.
void add_children (SmacqGraph *child, unsigned int channel=0)
 Establish a parent/child relationship on the specified channel.
void remove_parent (SmacqGraphNode *parent)
 Remove the specified graph from the list of this graph's parents.
void remove_child_bynum (int, int)
void remove_child (SmacqGraphNode_ptr)
void replace_child (int, int, SmacqGraphNode *newchild)
void replace_child (int, int, SmacqGraph *newchild)
void replace_child (SmacqGraphNode *oldchild, SmacqGraphNode *newchild)
void replace_child (SmacqGraphNode *oldchild, SmacqGraph *newchild)
void remove_children ()
bool live_children ()
bool live_parents ()
const std::vector
< ThreadSafeMultiSet
< SmacqGraphNode_ptr > > 
getChildren ()
static void move_children (SmacqGraphNode *from, SmacqGraphNode *to, bool addvector=false)


Detailed Description

This is a node in a graph. Each node references its parents and children.

Member Function Documentation

void SmacqGraphNode::add_child ( SmacqGraphNode_ptr  child,
unsigned int  channel = 0 
)

Add a new graph as one of my children.

Establish a parent/child relationship on the specified channel.

SmacqGraphNode * SmacqGraphNode::clone ( SmacqGraphNode newParent  ) 

Recursively clone a graph.

Recursively clone a graph and all of it's children.

The clone is made a child of newParent, unless newParent is NULL.

Make the new graph be a child of the specified parent (which may be NULL).

void SmacqGraphNode::do_shutdown ( SmacqGraphNode_ptr  f  )  [static]

Shutdown a graph node (will propagate to parents and children).

The caller should not refer to instance after this method is called.

The node may be destroyed by this call.

The call may result in the object being destroyed.

SmacqGraphNode * SmacqGraphNode::getInvariants ( DTS dts,
SmacqScheduler sched,
DtsField field 
)

Return a subgraph containing only invariants over the specified field.

The subgraph will contain only stateless filters that are applied to all objects in the graph (e.g. not within an OR) and that do NOT use the specified field. The returned graph is newly allocated.

SmacqGraphNode * SmacqGraphNode::init ( DTS dts,
SmacqScheduler sched 
)

This method must be called before a graph is used.

Init graph and return replacement graph pointer.

The graph may be modified as a side-effect, so the caller should replace the called object with the return pointer.

void SmacqGraphNode::move_children ( SmacqGraphNode from,
SmacqGraphNode to,
bool  addvector = false 
) [inline, static]

If the module is vectorized, then add a new vector element; otherwise add it to channel 0

SmacqGraphNode * SmacqGraphNode::new_child ( int  argc,
const char **  argv 
)

Construct a new graph using the given arguments.

The new graph is automatically attached as a child of the current graph.

void SmacqGraphNode::produce_done (  ) 

Scheduler is done handling a mustProduce.

We are done handling a mustProduce.

bool SmacqGraphNode::set ( int  argc,
const char **  argv 
)

(Re-)Initialize module

Setup a graph node based on the given argument vector.


Friends And Related Function Documentation

void intrusive_ptr_release ( SmacqGraphNode o  )  [friend]

Decrement the reference count.

If the refcount is 0, then clean-up references and destroy


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

Generated on Tue Oct 6 14:36:12 2009 for SMACQ by  doxygen 1.5.8