OpenASIP 2.2
Loading...
Searching...
No Matches
OperationDAG.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file OperationDAG.hh
26 *
27 * Declaration of operation directed acyclic graph class
28 *
29 * @author Mikael Lepistö 2007 (mikael.lepisto-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_OPERATION_DAG_HH
34#define TTA_OPERATION_DAG_HH
35
36#include "BoostGraph.hh"
37
38#include "OperationDAGNode.hh"
39#include "OperationDAGEdge.hh"
40
41class TerminalNode;
42
44 public BoostGraph<OperationDAGNode, OperationDAGEdge> {
45
46public:
48 bool isNull() const { return this == &null; }
49
51 OperationDAG(const class OperationPimpl& op);
52 OperationDAG(const OperationDAG& other);
53 virtual ~OperationDAG();
54 bool isTrivial() const;
55
56 int stepsToRoot(const OperationDAGNode& node) const;
57 const OperationDAG::NodeSet& endNodes() const;
58
59 const class OperationPimpl& operation() const { assert(op_ != nullptr); return *op_; }
60 void setOperation(const class OperationPimpl& op) { op_ = &op; }
61private:
62 const class OperationPimpl* op_;
63
64 /// Map of known step counts, if dag is changed this must be cleared.
65 mutable std::map<const OperationDAGNode*, int,
67 /// Set of root nodes of DAG, must be cleared if dag is changed.
69
70};
71
72#endif
#define assert(condition)
std::set< GraphNode *, typename GraphNode::Comparator > NodeSet
Definition Graph.hh:53
OperationDAG::NodeSet endNodes_
Set of root nodes of DAG, must be cleared if dag is changed.
OperationDAG(const class OperationPimpl &op)
std::map< const OperationDAGNode *, int, OperationDAGNode::Comparator > stepMap_
Map of known step counts, if dag is changed this must be cleared.
virtual ~OperationDAG()
static OperationDAG null
const class OperationPimpl * op_
const OperationDAG::NodeSet & endNodes() const
const class OperationPimpl & operation() const
bool isTrivial() const
int stepsToRoot(const OperationDAGNode &node) const
bool isNull() const
void setOperation(const class OperationPimpl &op)