MineLink
 All Data Structures Functions Variables Pages
precs.h
1 #ifndef __PRECS_H__
2 #define __PRECS_H__
3 
4 #include <vector>
5 #include "arcs.h"
6 #include "../bm/blockmodel.h"
7 
8 using std::vector;
9 
10 namespace delphos{
11 
22 class Precedence : public BlockModelEntity {
23 protected:
24  vector< Arc > * arcs;
25 
26 private:
27  void init();
28 
29 public:
35  Precedence(BlockModel & bm);
36 
41 
45  virtual ~Precedence();
46 
58  Arc operator [] (const delphos::BlockIndexType & index) const;
59 
70  Arc GetArc(const delphos::BlockIndexType & index) const;
71 
77  void AddArc(const delphos::Arc & new_arc);
78 
86  void AddArc(const delphos::BlockIndexType & first, const delphos::BlockIndexType & second);
87 
93  void Clear();
94 
102  const delphos::BlockIndexType Size() const;
103 
111  const delphos::BlockIndexType GetSize() const;
112 };
113 }
114 #endif
115 
Precedence(BlockModel &bm)
Creates a new precedence with no arcs.
Definition: precs.cpp:4
const delphos::BlockIndexType GetSize() const
Returns the size (number of arcs) in the precedence.
Definition: precs.cpp:27
Arc operator[](const delphos::BlockIndexType &index) const
Retrieves the Arc instance with given index.
Definition: precs.cpp:15
void Clear()
Deletes all arcs.
Definition: precs.cpp:31
void AddArc(const delphos::Arc &new_arc)
Adds a new arc to the precedence.
Definition: precs.cpp:39
Abstracts a container of blocks as a table with arbitrary number of attributes that can be accessed b...
Definition: blockmodel.h:62
Implements a precedence as an explicit set of arcs between blocks. Provides utility functions...
Definition: precs.h:22
virtual ~Precedence()
Destructor.
Definition: precs.cpp:47
A class that abstracts a relation between two indexes that represent two block ids.
Definition: arcs.h:21
const delphos::BlockIndexType Size() const
Returns the size (number of arcs) in the precedence.
Definition: precs.cpp:23
A base class for object associated to a given block model.
Definition: blockmodel.h:1356
Arc GetArc(const delphos::BlockIndexType &index) const
Retrieves the Arc instance with given index.
Definition: precs.cpp:19