blob: b10112ab6f276ae203d9a474111cd8c0ac5c794a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* This code generated by:
* Author : thomas
* Date : Tue Jul 1 2003
*/
#ifndef CODEACCESSORMETHOD_H
#define CODEACCESSORMETHOD_H
#include <tqstring.h>
#include "codemethodblock.h"
class CodeClassField;
class CodeAccessorMethod : public CodeMethodBlock
{
friend class CodeClassField;
Q_OBJECT
public:
// some types of accessor methods that are possible:
// "GET" is to retrieve single-valued (primative or Object) fields
// "SET" is to set single-valued (primative or Object) fields
// "ADD" is to add a value to a multiple-valued field of either primative or Object items
// "REMOVE" is to remove a value to a multiple-valued field of either primative or Object items
// "LIST" is to retrive the entire list of items in a multiple-valued field
enum AccessorType {GET=0, SET, ADD, REMOVE, LIST};
// Constructors/Destructors
//
/**
* Constructors
*/
CodeAccessorMethod ( CodeClassField * field );
/**
* Empty Destructor
*/
virtual ~CodeAccessorMethod ( );
/**
* Get the value of m_parentclassfield
* @return the value of m_parentclassfield
*/
CodeClassField * getParentClassField ( );
/** return the type of accessor method this is
*/
AccessorType getType( );
/** Set the type of accessor method this is
*/
void setType ( AccessorType type);
/** Utility method to get the value of the parent object of the parent classifield.
*/
// virtual UMLObject * getParentObject();
bool parentIsAttribute();
/**
* Save the XMI representation of this object
*/
virtual void saveToXMI ( TQDomDocument & doc, TQDomElement & root );
/**
* load params from the appropriate XMI element node.
*/
virtual void loadFromXMI ( TQDomElement & root );
/** set the class attributes from a passed object
*/
virtual void setAttributesFromObject (TextBlock * obj);
protected:
virtual void release ();
/** set attributes of the node that represents this class
* in the XMI document.
*/
virtual void setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement);
/** set the class attributes of this object from
* the passed element node.
*/
virtual void setAttributesFromNode ( TQDomElement & element);
virtual void updateMethodDeclaration() = 0;
virtual void updateContent() = 0;
// a method so the parent code classfield can force code block to release
void forceRelease ();
private:
CodeClassField * m_parentclassfield;
AccessorType m_accessorType;
void initFields(CodeClassField * parentCF );
};
#endif // CODEACCESSORMETHOD_H
|