KPlato::Relation Class Reference

#include <kptrelation.h>

Inherited by KPlato::ProxyRelation.

Inheritance diagram for KPlato::Relation:

[legend]
List of all members.

Public Types

enum  Type { None, FinishStart, FinishFinish, StartStart }
enum  Result { SUCCESS = 0l, HASCHILDREN = 1l, NOTIMPL = 2l }

Public Member Functions

 Relation (Node *parent, Node *child, Type type, Duration lag)
 Relation (Node *parent=0, Node *child=0, Type type=FinishStart)
 Relation (Relation *rel)
virtual ~Relation ()
void setType (Type)
Type type () const
const Durationlag () const
void setLag (Duration lag)
Nodeparent () const
Nodechild () const
bool load (QDomElement &element, Project &project)
void save (QDomElement &element) const
void printDebug (QByteArray indent)

Protected Attributes

Nodem_parent
Nodem_child
Type m_type
Duration m_lag

Private Attributes

QString m_parentId

Detailed Description

The relation class couples a 2 nodes together which are dependent on each other. If for example you have a project to build a house, the node that represents the adding of the roof is dependent on the node that represents the building of the walls. The roof can't be put up if the walls are not there yet. We actually have a number of relationtypes so this relation can be used in different manners.

Definition at line 44 of file kptrelation.h.


Member Enumeration Documentation

enum KPlato::Relation::Type

Enumerator:
None 
FinishStart 
FinishFinish 
StartStart 

Definition at line 46 of file kptrelation.h.

enum KPlato::Relation::Result

Enumerator:
SUCCESS 
HASCHILDREN 
NOTIMPL 

Definition at line 77 of file kptrelation.h.


Constructor & Destructor Documentation

KPlato::Relation::Relation ( Node parent,
Node child,
Type  type,
Duration  lag 
)

Definition at line 33 of file kptrelation.cc.

References child(), lag(), m_child, m_lag, m_parent, m_type, and parent().

KPlato::Relation::Relation ( Node parent = 0,
Node child = 0,
Type  type = FinishStart 
)

Definition at line 41 of file kptrelation.cc.

References child(), m_child, m_lag, m_parent, m_type, and parent().

KPlato::Relation::Relation ( Relation rel  ) 

Definition at line 49 of file kptrelation.cc.

References child(), lag(), m_child, m_lag, m_parent, m_type, parent(), and type().

KPlato::Relation::~Relation (  )  [virtual]

When deleted the relation will remove itself from the parent- and child nodes lists

Definition at line 57 of file kptrelation.cc.

References m_child, m_parent, KPlato::Node::takeDependChildNode(), and KPlato::Node::takeDependParentNode().


Member Function Documentation

void KPlato::Relation::setType ( Type   ) 

Definition at line 65 of file kptrelation.cc.

References m_type.

Referenced by KPlato::ModifyRelationTypeCmd::execute(), and KPlato::ModifyRelationTypeCmd::unexecute().

Type KPlato::Relation::type (  )  const [inline]

Definition at line 59 of file kptrelation.h.

References m_type.

Referenced by KPlato::Task::addChildProxyRelation(), KPlato::Task::addParentProxyRelation(), KPlato::AddRelationDialog::AddRelationDialog(), KPlato::ModifyRelationDialog::buildCommand(), KPlato::Task::calculatePredeccessors(), KPlato::Task::calculateSuccessors(), KPlato::GanttViewEventItem::insertRelations(), KPlato::GanttViewTaskItem::insertRelations(), KPlato::GanttViewSummaryItem::insertRelations(), KPlato::Task::isEndNode(), KPlato::Task::isStartNode(), KPlato::ModifyRelationTypeCmd::ModifyRelationTypeCmd(), Relation(), save(), KPlato::Task::schedulePredeccessors(), KPlato::Task::scheduleSuccessors(), KPlato::AddRelationDialog::slotFinishFinishToggled(), KPlato::AddRelationDialog::slotFinishStartToggled(), KPlato::AddRelationDialog::slotStartStartToggled(), and KPlato::AddRelationDialog::typeClicked().

const Duration& KPlato::Relation::lag (  )  const [inline]

returns the lag. The lag of a relation is the time it takes between the parent starting/stopping and the start of the child.

Definition at line 65 of file kptrelation.h.

References m_lag.

Referenced by KPlato::Task::addChildProxyRelation(), KPlato::Task::addParentProxyRelation(), KPlato::AddRelationDialog::AddRelationDialog(), KPlato::ModifyRelationDialog::buildCommand(), KPlato::Task::calculatePredeccessors(), KPlato::Task::calculateSuccessors(), KPlato::GanttViewEventItem::insertRelations(), KPlato::GanttViewTaskItem::insertRelations(), KPlato::GanttViewSummaryItem::insertRelations(), KPlato::ModifyRelationLagCmd::ModifyRelationLagCmd(), Relation(), KPlato::Task::schedulePredeccessors(), KPlato::Task::scheduleSuccessors(), and setLag().

void KPlato::Relation::setLag ( Duration  lag  )  [inline]

Definition at line 66 of file kptrelation.h.

References lag(), and m_lag.

Referenced by KPlato::ModifyRelationLagCmd::execute(), and KPlato::ModifyRelationLagCmd::unexecute().

Node* KPlato::Relation::parent (  )  const [inline]

Returns:
The parent dependent node.

Definition at line 71 of file kptrelation.h.

References m_parent.

Referenced by KPlato::Task::addParentProxyRelations(), KPlato::AddRelationCmd::AddRelationCmd(), KPlato::AddRelationDialog::AddRelationDialog(), KPlato::Task::calcCriticalPath(), KPlato::Task::calculatePredeccessors(), KPlato::DeleteRelationCmd::DeleteRelationCmd(), KPlato::DeleteRelationCmd::execute(), KPlato::AddRelationCmd::execute(), KPlato::Project::legalParents(), KPlato::ModifyRelationLagCmd::ModifyRelationLagCmd(), KPlato::ModifyRelationTypeCmd::ModifyRelationTypeCmd(), Relation(), KPlato::Task::schedulePredeccessors(), KPlato::DeleteRelationCmd::unexecute(), and KPlato::AddRelationCmd::unexecute().

Node* KPlato::Relation::child (  )  const [inline]

Returns:
The child dependent node.

Definition at line 75 of file kptrelation.h.

References m_child.

Referenced by KPlato::Task::addChildProxyRelations(), KPlato::AddRelationDialog::AddRelationDialog(), KPlato::Task::calcCriticalPath(), KPlato::Task::calculateSuccessors(), KPlato::DeleteRelationCmd::execute(), KPlato::AddRelationCmd::execute(), KPlato::GanttViewEventItem::insertRelations(), KPlato::GanttViewTaskItem::insertRelations(), KPlato::GanttViewSummaryItem::insertRelations(), KPlato::Project::legalChildren(), Relation(), KPlato::Task::scheduleSuccessors(), KPlato::DeleteRelationCmd::unexecute(), and KPlato::AddRelationCmd::unexecute().

bool KPlato::Relation::load ( QDomElement &  element,
Project project 
)

Definition at line 70 of file kptrelation.cc.

References KPlato::Node::addDependChildNode(), KPlato::Node::addDependParentNode(), KPlato::Project::findNode(), FinishFinish, FinishStart, KPlato::Duration::fromString(), KPlato::Node::legalToLink(), m_child, m_lag, m_parent, m_type, KPlato::Node::name(), StartStart, and KPlato::Node::takeDependChildNode().

void KPlato::Relation::save ( QDomElement &  element  )  const

Definition at line 117 of file kptrelation.cc.

References FinishFinish, FinishStart, KPlato::Node::id(), m_child, m_lag, m_parent, m_type, StartStart, KPlato::Duration::toString(), and type().

void KPlato::Relation::printDebug ( QByteArray  indent  ) 

Definition at line 140 of file kptrelation.cc.

References m_child, m_parent, m_type, and KPlato::Node::name().


Member Data Documentation

Node* KPlato::Relation::m_parent [protected]

Definition at line 87 of file kptrelation.h.

Referenced by load(), parent(), printDebug(), Relation(), save(), KPlato::ProxyRelation::~ProxyRelation(), and ~Relation().

Node* KPlato::Relation::m_child [protected]

Definition at line 88 of file kptrelation.h.

Referenced by child(), load(), printDebug(), Relation(), save(), KPlato::ProxyRelation::~ProxyRelation(), and ~Relation().

Type KPlato::Relation::m_type [protected]

Definition at line 89 of file kptrelation.h.

Referenced by load(), printDebug(), Relation(), save(), setType(), and type().

Duration KPlato::Relation::m_lag [protected]

Definition at line 90 of file kptrelation.h.

Referenced by lag(), load(), Relation(), save(), and setLag().

QString KPlato::Relation::m_parentId [private]

Definition at line 93 of file kptrelation.h.


The documentation for this class was generated from the following files:
Generated on Wed Nov 22 23:21:50 2006 for KPlato by  doxygen 1.5.1-p1