## MrpRelation

MrpRelation — represents a task predecessor relation in the project.

## Synopsis

    #include <libplanner/planner.h>

                        MrpRelationPriv;
    struct              MrpRelation;
    enum                MrpRelationType;
    MrpTask *           mrp_relation_get_predecessor        (MrpRelation *relation);
    MrpTask *           mrp_relation_get_successor          (MrpRelation *relation);
    gint                mrp_relation_get_lag                (MrpRelation *relation);
    MrpRelationType     mrp_relation_get_relation_type      (MrpRelation *relation);

## Description

A predecessor relation is used to affect the scheduling of a task relative another task. A relation may have a lag time associated to it, so that a task can be scheduled to start after another task has finished, plus a lag time.

## Details

### MrpRelationPriv

    typedef struct _MrpRelationPriv MrpRelationPriv;

A private struct for internal use only. The definition of this structure is not publically available.

### struct MrpRelation

    struct MrpRelation {
    	MrpObject        parent;
    	MrpRelationPriv *priv;
    };

Object representing a predecessor relation between two tasks.

### enum MrpRelationType

    typedef enum {
    	MRP_RELATION_NONE = 0, /* unset */
    	MRP_RELATION_FS,       /* finish-to-start */
    	MRP_RELATION_FF,       /* finish-to-finish */
    	MRP_RELATION_SS,       /* start-to-start */
    	MRP_RELATION_SF        /* start-to-finish */
    } MrpRelationType;

The type of relation.

`MRP_RELATION_NONE` | invalid relation type (unset)
`MRP_RELATION_FS` | finish to start
`MRP_RELATION_FF` | finish to finish (unimplemented)
`MRP_RELATION_SS` | start to start (unimplemented)
`MRP_RELATION_SF` | start to finish (unimplemented)

### mrp_relation_get_predecessor ()

    MrpTask *           mrp_relation_get_predecessor        (MrpRelation *relation);

Retrieves the predecessor of `relation`.

`relation` : | an MrpRelation
Returns : | the predecessor task.

### mrp_relation_get_successor ()

    MrpTask *           mrp_relation_get_successor          (MrpRelation *relation);

Retrieves the successor of `relation`.

`relation` : | an MrpRelation
Returns : | the successor task.

### mrp_relation_get_lag ()

    gint                mrp_relation_get_lag                (MrpRelation *relation);

Retrieves the lag between the predecessor and successor in `relation`.

`relation` : | an MrpRelation
Returns : | Lag time in seconds.

### mrp_relation_get_relation_type ()

    MrpRelationType     mrp_relation_get_relation_type      (MrpRelation *relation);

Retrieves the relation type of `relation`.

`relation` : | an MrpRelation
Returns : | the MrpRelationType of the relation.