MyraMath
NullJobGraph.h
Go to the documentation of this file.
1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
6 #ifndef MYRAMATH_JOBGRAPH_NULLJOBGRAPH_H
7 #define MYRAMATH_JOBGRAPH_NULLJOBGRAPH_H
8 
14 #include <myramath/MYRAMATH_EXPORT.h>
15 
16 #include <myramath/jobgraph/Job.h>
19 #include <myramath/jobgraph/Options.h>
20 
21 #include <string>
22 #include <stdint.h>
23 
24 namespace myra {
25 
27 class NullJobGraph : public JobGraphBase
28  {
29  public:
30 
32  virtual uint64_t n_work() const;
33 
35  virtual std::string name() const;
36 
38  virtual void begins(JobIDs& output) const;
39 
41  virtual void ends(JobIDs& output) const;
42 
44  virtual Job* create(JobID j);
45 
47  virtual std::vector<Job*> create();
48 
50  virtual uint64_t size() const;
51 
53  virtual JobGraphBase* clone() const;
54 
56  virtual ~NullJobGraph();
57 
58  };
59 
60 } // namespace myra
61 
62 #endif
virtual ~NullJobGraph()
Frees internal resources.
Definition: NullJobGraph.cpp:43
Abstraction to represent one node of a JobGraph.
Definition: Job.h:25
virtual std::vector< Job * > create()
Returns empty vector, a NullJobGraph has no Job&#39;s.
Definition: NullJobGraph.cpp:31
Abstraction to represent one node of a JobGraph.
virtual void ends(JobIDs &output) const
Does nothing, a NullJobGraph has no ends()
Definition: NullJobGraph.cpp:23
The value of a default-constructed JobGraph.
Definition: NullJobGraph.h:27
virtual void begins(JobIDs &output) const
Does nothing, a NullJobGraph has no begins()
Definition: NullJobGraph.cpp:19
virtual uint64_t n_work() const
Returns 0.
Definition: NullJobGraph.cpp:11
Definition: syntax.dox:1
Base/contract class for all other JobGraph&#39;s.
Definition: JobGraph.h:30
Abstraction for representing a directed acyclic graph of Job&#39;s.
virtual JobGraphBase * clone() const
Virtual copy-constructor.
Definition: NullJobGraph.cpp:39
Key type used to identify the Job&#39;s of a JobGraph.
virtual uint64_t size() const
Returns 0, a NullJobGraph has no Job&#39;s.
Definition: NullJobGraph.cpp:35
virtual std::string name() const
Returns "NullJobGraph".
Definition: NullJobGraph.cpp:15
Key type used to identify the Job&#39;s of a JobGraph.
Definition: JobID.h:60
std::vector< JobID > JobIDs
Useful typedef.
Definition: JobID.h:118