umbrello: CodeOperation Class Reference

umbrello 2.31.0 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
CodeOperation Class Referenceabstract

`#include <codeoperation.h>`

Inheritance diagram for CodeOperation:

## Public Member Functions
| CodeOperation (ClassifierCodeDocument *doc, UMLOperation *parent, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeOperation ()
UMLOperation * | getParentOperation ()
virtual void | saveToXMI1 (QDomDocument &doc, QDomElement &root)
virtual void | loadFromXMI1 (QDomElement &root)
virtual void | setAttributesFromObject (TextBlock *obj)
virtual void | updateMethodDeclaration ()=0
virtual void | updateContent ()
Public Member Functions inherited from CodeMethodBlock
| CodeMethodBlock (ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeMethodBlock ()
virtual QString | toString () const
QString | getStartMethodText () const
QString | getEndMethodText () const
CodeDocument * | getParentDocument ()
Public Member Functions inherited from OwnedCodeBlock
| OwnedCodeBlock (UMLObject *parent)
virtual | ~OwnedCodeBlock ()
UMLObject * | getParentObject ()
Public Member Functions inherited from CodeBlockWithComments
| CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeBlockWithComments ()
void | setComment (CodeComment *object)
CodeComment * | getComment () const
void | setOverallIndentationLevel (int level)
Public Member Functions inherited from CodeBlock
| CodeBlock (CodeDocument *parent, const QString &body=QString())
virtual | ~CodeBlock ()
void | setContentType (ContentType new_var)
ContentType | contentType () const
Public Member Functions inherited from TextBlock
| TextBlock (CodeDocument *parent, const QString &text=QString())
virtual | ~TextBlock ()
void | setText (const QString &text)
QString | getText () const
void | appendText (const QString &text)
void | setTag (const QString &value)
QString | getTag () const
CodeDocument * | getParentDocument () const
void | setWriteOutText (bool write)
bool | getWriteOutText () const
void | setIndentationLevel (int level)
int | getIndentationLevel () const
QString | getIndentationString (int level=0) const
virtual QString | unformatText (const QString &text, const QString &indent=QString())
bool | canDelete () const
virtual QString | getNewEditorLine (int amount=0)
virtual int | firstEditableLine ()
virtual int | lastEditableLine ()

## Static Public Member Functions
static QString | findTag (UMLOperation *op)
Static Public Member Functions inherited from CodeBlock
static QString | enumToString (const ContentType &val)
Static Public Member Functions inherited from TextBlock
static QString | getIndentation ()
static QString | getNewLineEndingChars ()
static QString | formatMultiLineText (const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true)
static QString | encodeText (const QString &text, const QString &endLine)
static QString | decodeText (const QString &text, const QString &endLine)

## Protected Member Functions
virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement)
virtual void | setAttributesFromNode (QDomElement &element)
Protected Member Functions inherited from CodeMethodBlock
virtual void | release ()
void | setStartMethodText (const QString &value)
void | setEndMethodText (const QString &value)
Protected Member Functions inherited from TextBlock
void | setCanDelete (bool canDelete)

## Private Member Functions
void | init (UMLOperation *parentOp)

## Additional Inherited Members
Public Types inherited from CodeBlock
enum | ContentType { AutoGenerated =0, UserGenerated }
Public Slots inherited from CodeMethodBlock
virtual void | syncToParent ()
Public Slots inherited from OwnedCodeBlock
virtual void | syncToParent ()

## Constructor & Destructor Documentation

## ◆ CodeOperation()

CodeOperation::CodeOperation | ( | ClassifierCodeDocument * | doc,
|  | UMLOperation * | parent,
|  | const QString & | body = `QString()`,
|  | const QString & | comment = `QString()`
| ) |  |

Constructors

## ◆ ~CodeOperation()

CodeOperation::~CodeOperation | ( |  | ) |
| virtual

Empty Destructor

## Member Function Documentation

## ◆ findTag()

QString CodeOperation::findTag | ( | UMLOperation * | op | ) |
| static

Find the value of the tag that this operation would have.

## ◆ getParentOperation()

UMLOperation * CodeOperation::getParentOperation | ( |  | ) |

Add a Parameter object to the m_parameterVector List

Remove a Parameter object from m_parameterVector List

Get the list of Parameter objects held by m_parameterVector

Returns
  QList<CodeParameter*> list of Parameter objects held by m_parameterVector

## ◆ init()

void CodeOperation::init | ( | UMLOperation * | parentOp | ) |
| private

## ◆ loadFromXMI1()

void CodeOperation::loadFromXMI1 | ( | QDomElement & | root | ) |
| virtual

Load params from the appropriate XMI element node.

Reimplemented from CodeBlockWithComments.

## ◆ saveToXMI1()

void CodeOperation::saveToXMI1 | ( | QDomDocument & | doc,
|  | QDomElement & | root
| ) |  |
| virtual

Save the XMI representation of this object.

Reimplemented from CodeBlockWithComments.

## ◆ setAttributesFromNode()

void CodeOperation::setAttributesFromNode | ( | QDomElement & | element | ) |
| protectedvirtual

Set the class attributes of this object from the passed element node.

Reimplemented from CodeMethodBlock.

## ◆ setAttributesFromObject()

void CodeOperation::setAttributesFromObject | ( | TextBlock * | obj | ) |
| virtual

Set the class attributes from a passed object.

Reimplemented from CodeMethodBlock.

## ◆ setAttributesOnNode()

void CodeOperation::setAttributesOnNode | ( | QDomDocument & | doc,
|  | QDomElement & | elem
| ) |  |
| protectedvirtual

Set attributes of the node that represents this class in the XMI document.

Reimplemented from CodeMethodBlock.

## ◆ updateContent()

void CodeOperation::updateContent | ( |  | ) |
| virtual

This is the method called from within syncToparent() to update the *body* of the method. It is only called if the method is Auto-generated.

Implements CodeMethodBlock.

Reimplemented in CPPSourceCodeOperation, and CPPHeaderCodeOperation.

## ◆ updateMethodDeclaration()

virtual void CodeOperation::updateMethodDeclaration | ( |  | ) |
| pure virtual

This is the method called from within syncToparent(). To update the start and end Method text. It is called whether or not the method is Auto or User generated.

Implements CodeMethodBlock.

Implemented in RubyCodeOperation, DCodeOperation, JavaCodeOperation, CPPHeaderCodeOperation, and CPPSourceCodeOperation.

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

- umbrello/codegenerators/codeoperation.h
- umbrello/codegenerators/codeoperation.cpp