6 #ifndef MYRAMATH_JOBGRAPH_DELETEJOBGRAPH_H 7 #define MYRAMATH_JOBGRAPH_DELETEJOBGRAPH_H 14 #include <myramath/MYRAMATH_EXPORT.h> 34 : object(in_object) { }
51 virtual std::string
name()
const 52 {
return "DeleteJobGraph"; }
56 { output.push_back(
JobID(0)); }
60 { output.push_back(
JobID(0)); }
64 {
return new DeleteJob(
this); }
67 virtual std::vector<::myra::Job*>
create()
68 {
return std::vector<::myra::Job*>(1,
new DeleteJob(
this)); }
71 virtual uint64_t
size()
const 91 virtual JobID id()
const 95 virtual void parents(
JobIDs& output)
const 99 virtual void children(
JobIDs& output)
const 103 virtual uint64_t execute()
104 {
delete host->object;
return 1; }
107 virtual std::string
name()
const 108 {
return "DeleteJob"; }
119 template<
class Object>
Encapsulates "delete object;" into a JobGraph of a single Job.
Definition: DeleteJobGraph.h:25
Abstraction to represent one node of a JobGraph.
Definition: Job.h:25
virtual void ends(JobIDs &output) const
Enumerates the JobIDs of Job's that have no children (where execution ends)
Definition: DeleteJobGraph.h:59
virtual std::vector<::myra::Job * > create()
Constructs all Job's in an implementation-defined order.
Definition: DeleteJobGraph.h:67
virtual uint64_t n_work() const
Total "work" over all Job's of this JobGraph.
Definition: DeleteJobGraph.h:47
Abstraction to represent one node of a JobGraph.
virtual ::myra::Job * create(JobID id)
Constructs the Job corresponding to the given JobIDs.
Definition: DeleteJobGraph.h:63
virtual ~DeleteJobGraph()
Frees internal resources.
Definition: DeleteJobGraph.h:41
virtual JobGraphBase * clone() const
Virtual copy constructor.
Definition: DeleteJobGraph.h:37
Type erasure class that wraps JobGraphBase, gives it value semantics.
Definition: JobGraph.h:64
Base/contract class for all other JobGraph's.
Definition: JobGraph.h:30
Abstraction for representing a directed acyclic graph of Job's.
JobGraph make_DeleteJobGraph(Object *object)
Given a heap allocated Object, returns a JobGraph that delete's it when execute()'d.
Definition: DeleteJobGraph.h:120
DeleteJobGraph(Object *in_object)
Constructor, requires an Object to delete.
Definition: DeleteJobGraph.h:33
virtual uint64_t size() const
Returns maximum JobID.
Definition: DeleteJobGraph.h:71
virtual void begins(JobIDs &output) const
Enumerates the JobIDs of Job's that have no parents (where execution begins)
Definition: DeleteJobGraph.h:55
Key type used to identify the Job's of a JobGraph.
Definition: JobID.h:60
std::vector< JobID > JobIDs
Useful typedef.
Definition: JobID.h:118
virtual std::string name() const
Returns a printable name for this JobGraph, for debugging.
Definition: DeleteJobGraph.h:51