MineLink
 All Data Structures Functions Variables Pages
delphos::Precedence Class Reference

Implements a precedence as an explicit set of arcs between blocks. Provides utility functions. More...

#include <precs.h>

Inheritance diagram for delphos::Precedence:
Inheritance graph
Collaboration diagram for delphos::Precedence:
Collaboration graph

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...
 
- Public Member Functions inherited from delphos::BlockModelEntity
 BlockModelEntity (delphos::BlockModel &bm)
 Creates a new block instance associated to a given block model. More...
 
delphos::BlockModelGetBlockModel ()
 Retrieves the block model to which the entity is associated. More...
 
const delphos::BlockModelGetBlockModel () const
 Retrieves the block model to which the entity is associated. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

delphos::Precedence::Precedence ( BlockModel bm)

Creates a new precedence with no arcs.

Parameters
bmThe block model to which the precedence object is associated.

Member Function Documentation

void delphos::Precedence::AddArc ( const delphos::Arc new_arc)

Adds a new arc to the precedence.

Parameters
new_arcThe 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.

Parameters
firstThe index of the predecessor block
secondThe 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.

Parameters
indexThe 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.

Returns
The amount of arcs currently in the instance.
Arc delphos::Precedence::operator[] ( const delphos::BlockIndexType &  index) const

Retrieves the Arc instance with given index.

Parameters
indexThe 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.

Deprecated:
See Precedence::GetSize() .
Returns
The amount of arcs currently in the instance.

The documentation for this class was generated from the following files: