umbrello API Documentation

UMLOperation Class Reference

This class represents an operation in the UML model. More...

#include <operation.h>

Inheritance diagram for UMLOperation:

UMLClassifierListItem UMLObject List of all members.

Public Member Functions

 UMLOperation (const UMLClassifier *parent, const QString &name, Uml::IDType id=Uml::id_None, Uml::Visibility s=Uml::Visibility::Public, UMLObject *rt=0)
 Constructs an UMLOperation.
 UMLOperation (const UMLClassifier *parent)
 Constructs an UMLOperation.
virtual ~UMLOperation ()
 destructor
bool operator== (UMLOperation &rhs)
 Overloaded '==' operator.
virtual void copyInto (UMLOperation *rhs) const
 Copy the internal presentation of this object into the new object.
virtual UMLObjectclone () const
 Make a clone of this object.
void setType (UMLObject *type)
 Reimplement method from UMLClassifierListItem.
void moveParmLeft (UMLAttribute *a)
 Move a parameter one position to the left.
void moveParmRight (UMLAttribute *a)
 Move a parameter one position to the right.
void removeParm (UMLAttribute *a, bool emitModifiedSignal=true)
 Remove a parameter from the operation.
UMLAttributeList getParmList ()
 Returns a list of parameters.
UMLAttributefindParm (const QString &name)
 Finds a parameter of the operation.
QString toString (Uml::Signature_Type sig=Uml::st_NoSig)
 Returns a string representation of the operation.
void addParm (UMLAttribute *parameter, int position=-1)
 Add a parameter to the operation.
bool resolveRef ()
 Calls resolveRef() on all parameters.
QString getUniqueParameterName ()
 Returns an unused parameter name for a new parameter.
bool showPropertiesDialog (QWidget *parent)
 Display the properties configuration dialog for the template.
bool isConstructorOperation ()
 Returns whether this operation is a constructor.
bool isDestructorOperation ()
 Returns whether this operation is a destructor.
bool isLifeOperation ()
 Shortcut for (isConstructorOperation() || isDestructorOperation()).
void setConst (bool b)
 Sets whether this operation is a query (C++ "const".).
bool getConst () const
 Returns whether this operation is a query (C++ "const".).
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 Saves to the <UML:Operation> XMI element.

Protected Member Functions

bool load (QDomElement &element)
 Loads a <UML:Operation> XMI element.

Detailed Description

This class represents an operation in the UML model.

Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 25 of file operation.h.


Constructor & Destructor Documentation

UMLOperation::UMLOperation const UMLClassifier parent,
const QString &  name,
Uml::IDType  id = Uml::id_None,
Uml::Visibility  s = Uml::Visibility::Public,
UMLObject rt = 0
 

Constructs an UMLOperation.

Not intended for general use: The operation is not tied in with umbrello's Qt signalling for object creation. If you want to create an Operation use the method in UMLDoc instead.

Parameters:
parent The parent to this operation.
name The name of the operation.
id The id of the operation.
s The visibility of the operation.
rt The return type of the operation.

Definition at line 28 of file operation.cpp.

Referenced by clone().

UMLOperation::UMLOperation const UMLClassifier parent  ) 
 

Constructs an UMLOperation.

Not intended for general use: The operation is not tied in with umbrello's Qt signalling for object creation. If you want to create an Operation use the method in UMLDoc instead.

Parameters:
parent The parent to this operation.

Definition at line 42 of file operation.cpp.

UMLOperation::~UMLOperation  )  [virtual]
 

destructor

Definition at line 49 of file operation.cpp.


Member Function Documentation

bool UMLOperation::operator== UMLOperation rhs  ) 
 

Overloaded '==' operator.

Definition at line 193 of file operation.cpp.

References UMLClassifierListItem::getTypeName(), and UMLObject::operator==().

void UMLOperation::copyInto UMLOperation rhs  )  const [virtual]
 

Copy the internal presentation of this object into the new object.

Definition at line 212 of file operation.cpp.

References UMLAttributeList::copyInto(), and UMLClassifierListItem::copyInto().

Referenced by clone().

UMLObject * UMLOperation::clone  )  const [virtual]
 

Make a clone of this object.

Implements UMLClassifierListItem.

Definition at line 219 of file operation.cpp.

References clone(), copyInto(), and UMLOperation().

Referenced by clone().

void UMLOperation::setType UMLObject type  )  [virtual]
 

Reimplement method from UMLClassifierListItem.

Parameters:
type Pointer to the type object.

Reimplemented from UMLClassifierListItem.

Definition at line 52 of file operation.cpp.

References UMLClassifierListItem::setType().

Referenced by UMLOperationDialog::apply(), UMLListView::createChildUMLObject(), UMLListView::moveObject(), UMLListViewItem::okRename(), and FloatingTextWidget::showOpDlg().

void UMLOperation::moveParmLeft UMLAttribute a  ) 
 

Move a parameter one position to the left.

Parameters:
a The parameter to move.

Definition at line 58 of file operation.cpp.

References UMLObject::getName(), and UMLObject::modified().

void UMLOperation::moveParmRight UMLAttribute a  ) 
 

Move a parameter one position to the right.

Parameters:
a The parameter to move.

Definition at line 78 of file operation.cpp.

References UMLObject::modified().

void UMLOperation::removeParm UMLAttribute a,
bool  emitModifiedSignal = true
 

Remove a parameter from the operation.

Parameters:
a The parameter to remove.
emitModifiedSignal Whether to emit the "modified" signal which creates an entry in the Undo stack for the removal. Default: true.

Definition at line 99 of file operation.cpp.

References UMLObject::modified().

Referenced by UMLListViewItem::okRename().

UMLAttributeList UMLOperation::getParmList  )  [inline]
 

Returns a list of parameters.

Returns:
A list of the parameters in the operation.

Definition at line 113 of file operation.h.

Referenced by UMLOperationDialog::apply(), UMLClassifier::checkOperationSignature(), UMLClassifier::createOperation(), CodeGenerator::findObjectsRelated(), UMLClassifier::findOperation(), Import_Utils::insertMethod(), UMLListView::moveObject(), UMLListViewItem::okRename(), and UMLOperationDialog::setupDialog().

UMLAttribute * UMLOperation::findParm const QString &  name  ) 
 

Finds a parameter of the operation.

Parameters:
name The parameter name to search for.
Returns:
The found parameter, 0 if not found.

Definition at line 115 of file operation.cpp.

References UMLObject::getName().

Referenced by getUniqueParameterName().

QString UMLOperation::toString Uml::Signature_Type  sig = Uml::st_NoSig  )  [virtual]
 

Returns a string representation of the operation.

Parameters:
sig What type of operation string to show.
Returns:
The string representation of the operation.

Reimplemented from UMLClassifierListItem.

Definition at line 124 of file operation.cpp.

References UMLApp::getActiveLanguage(), UMLObject::getFullyQualifiedName(), UMLObject::getName(), UMLClassifierListItem::getType(), UMLObject::getUMLPackage(), and UMLAttribute::toString().

Referenced by UMLListView::createChildUMLObject(), LinkWidget::getOperationText(), UMLClassifier::getOpList(), MessageWidget::getSeqNumAndOp(), and UMLListViewItem::okRename().

void UMLOperation::addParm UMLAttribute parameter,
int  position = -1
 

Add a parameter to the operation.

Parameters:
parameter The parameter to add.
position The position in the parameter list. If position = -1 the parameter will be appended to the list.

Definition at line 175 of file operation.cpp.

References UMLObject::emitModified(), and UMLObject::modified().

Referenced by UMLClassifier::createOperation(), UMLListView::moveObject(), and UMLListViewItem::okRename().

bool UMLOperation::resolveRef  )  [virtual]
 

Calls resolveRef() on all parameters.

Needs to be called after all UML objects are loaded from file.

Returns:
True for success.

Reimplemented from UMLObject.

Definition at line 228 of file operation.cpp.

References UMLObject::resolveRef().

QString UMLOperation::getUniqueParameterName  ) 
 

Returns an unused parameter name for a new parameter.

Definition at line 184 of file operation.cpp.

References findParm().

bool UMLOperation::showPropertiesDialog QWidget *  parent  )  [virtual]
 

Display the properties configuration dialog for the template.

Implements UMLClassifierListItem.

Definition at line 282 of file operation.cpp.

bool UMLOperation::isConstructorOperation  ) 
 

Returns whether this operation is a constructor.

Returns:
True if this operation is a constructor.

Definition at line 239 of file operation.cpp.

References UMLObject::getName(), and UMLObject::getStereotype().

Referenced by isLifeOperation().

bool UMLOperation::isDestructorOperation  ) 
 

Returns whether this operation is a destructor.

Returns:
True if this operation is a destructor.

Definition at line 254 of file operation.cpp.

References UMLObject::getName(), and UMLObject::getStereotype().

Referenced by isLifeOperation().

bool UMLOperation::isLifeOperation  ) 
 

Shortcut for (isConstructorOperation() || isDestructorOperation()).

Returns:
True if this operation is a constructor or destructor.

Definition at line 270 of file operation.cpp.

References isConstructorOperation(), and isDestructorOperation().

void UMLOperation::setConst bool  b  ) 
 

Sets whether this operation is a query (C++ "const".).

Definition at line 274 of file operation.cpp.

Referenced by UMLOperationDialog::apply().

bool UMLOperation::getConst  )  const
 

Returns whether this operation is a query (C++ "const".).

Definition at line 278 of file operation.cpp.

Referenced by UMLOperationDialog::setupDialog().

void UMLOperation::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Saves to the <UML:Operation> XMI element.

Implements UMLObject.

Definition at line 287 of file operation.cpp.

References UMLObject::getID(), UMLAttribute::getParmKind(), UMLClassifierListItem::getType(), UMLClassifierListItem::getTypeName(), and UMLObject::save().

bool UMLOperation::load QDomElement &  element  )  [protected, virtual]
 

Loads a <UML:Operation> XMI element.

Reimplemented from UMLObject.

Definition at line 332 of file operation.cpp.

References UMLObject::loadFromXMI(), and UMLAttribute::setParmKind().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:07 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003