![]() |
MineLink
|
Implements a precedence as an explicit set of arcs between blocks. Provides utility functions. More...
#include <precs.h>
Public Member Functions | |
Precedence (BlockModel &bm) | |
Creates a new precedence with no arcs. More... | |
Precedence (delphos::Precedence &other) | |
Copy constructor. | |
virtual | ~Precedence () |
Destructor. | |
Arc | operator[] (const delphos::BlockIndexType &index) const |
Retrieves the Arc instance with given index. More... | |
Arc | GetArc (const delphos::BlockIndexType &index) const |
Retrieves the Arc instance with given index. More... | |
void | AddArc (const delphos::Arc &new_arc) |
Adds a new arc to the precedence. More... | |
void | AddArc (const delphos::BlockIndexType &first, const delphos::BlockIndexType &second) |
Adds a new arc to the precedence. More... | |
void | Clear () |
Deletes all arcs. More... | |
const delphos::BlockIndexType | Size () const |
Returns the size (number of arcs) in the precedence. More... | |
const delphos::BlockIndexType | GetSize () const |
Returns the size (number of arcs) in the precedence. More... | |
![]() | |
BlockModelEntity (delphos::BlockModel &bm) | |
Creates a new block instance associated to a given block model. More... | |
delphos::BlockModel & | GetBlockModel () |
Retrieves the block model to which the entity is associated. More... | |
const delphos::BlockModel & | GetBlockModel () const |
Retrieves the block model to which the entity is associated. More... | |
Implements a precedence as an explicit set of arcs between blocks. Provides utility functions.
A Precedence instance will always be binded to a BlockModel instance, because the indexes stored in the Arc instances must have meaning. As in the case of the BlockSelection class we will refer to it as the subyacent BlockModel instance.
In practice, a Precedence instance is just a container for Arc instances.
delphos::Precedence::Precedence | ( | BlockModel & | bm | ) |
Creates a new precedence with no arcs.
bm | The block model to which the precedence object is associated. |
void delphos::Precedence::AddArc | ( | const delphos::Arc & | new_arc | ) |
Adds a new arc to the precedence.
new_arc | The Arc instance to be added to the precedence. |
void delphos::Precedence::AddArc | ( | const delphos::BlockIndexType & | first, |
const delphos::BlockIndexType & | second | ||
) |
Adds a new arc to the precedence.
first | The index of the predecessor block |
second | The index of the successor block |
void delphos::Precedence::Clear | ( | ) |
Deletes all arcs.
Empties the Precedence instance. The subyacent BlockModel instance is kept.
Arc delphos::Precedence::GetArc | ( | const delphos::BlockIndexType & | index | ) | const |
Retrieves the Arc instance with given index.
index | The position (from 0 to Precedence::Size()-1) of the Arc instance to be retrieved. |
Same as
(*this)[index]
const BlockIndexType delphos::Precedence::GetSize | ( | ) | const |
Returns the size (number of arcs) in the precedence.
Arc delphos::Precedence::operator[] | ( | const delphos::BlockIndexType & | index | ) | const |
Retrieves the Arc instance with given index.
index | The position (from 0 to Precedence::GetSize()-1) of the Arc instance to be retrieved. |
Same as
this->GetArc(index)
const BlockIndexType delphos::Precedence::Size | ( | ) | const |
Returns the size (number of arcs) in the precedence.