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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
|
#include "UmlBaseAttribute.h"
#include "UmlAttribute.h"
#include "UmlClass.h"
#include "UmlOperation.h"
#include "UmlCom.h"
UmlAttribute * UmlBaseAttribute::create(UmlClass * parent, const char * s)
{
return (UmlAttribute *) parent->create_(anAttribute, s);
}
anItemKind UmlBaseAttribute::kind() {
return anAttribute;
}
bool UmlBaseAttribute::isReadOnly() {
read_if_needed_();
return _read_only;
}
bool UmlBaseAttribute::set_isReadOnly(bool y) {
return set_it_(_read_only, y, setIsReadOnlyCmd);
}
const QCString & UmlBaseAttribute::defaultValue() {
read_if_needed_();
return _default_value;
}
bool UmlBaseAttribute::set_DefaultValue(const char * s) {
return set_it_(_default_value, s, setDefaultValueCmd);
}
const UmlTypeSpec & UmlBaseAttribute::type() {
read_if_needed_();
return _type;
}
bool UmlBaseAttribute::set_Type(const UmlTypeSpec & t) {
return set_it_(_type, t, setTypeCmd);
}
UmlOperation * UmlBaseAttribute::getOperation() {
read_if_needed_();
return _get_oper;
}
bool UmlBaseAttribute::addGetOperation() {
UmlCom::send_cmd(_identifier, addGetOperCmd);
if (UmlCom::read_bool()) {
reread_children_if_needed_();
return TRUE;
}
else
return FALSE;
}
UmlOperation * UmlBaseAttribute::setOperation() {
read_if_needed_();
return _set_oper;
}
bool UmlBaseAttribute::addSetOperation() {
UmlCom::send_cmd(_identifier, addSetOperCmd);
if (UmlCom::read_bool()) {
reread_children_if_needed_();
return TRUE;
}
else
return FALSE;
}
#ifdef WITHCPP
bool UmlBaseAttribute::isCppMutable() {
read_if_needed_();
return _cpp_mutable;
}
bool UmlBaseAttribute::set_isCppMutable(bool y) {
return set_it_(_cpp_mutable, y, setIsCppMutableCmd);
}
#endif
#ifdef WITHJAVA
bool UmlBaseAttribute::isJavaTransient() {
read_if_needed_();
return _java_transient;
}
bool UmlBaseAttribute::set_isJavaTransient(bool y) {
return set_it_(_java_transient, y, setIsJavaTransientCmd);
}
#endif
#ifdef WITHIDL
QCString UmlBaseAttribute::idlCase() {
read_if_needed_();
return (_idl_case != 0) ? _idl_case->name() : _idl_explicit_case;
}
bool UmlBaseAttribute::set_IdlCase(UmlAttribute * a) {
UmlCom::send_cmd(_identifier, setIdlCaseCmd, a->_identifier, "");
if (UmlCom::read_bool()) {
_idl_case = a;
_idl_explicit_case = 0;
return TRUE;
}
else
return FALSE;
}
bool UmlBaseAttribute::set_IdlCase(const char * s) {
UmlCom::send_cmd(_identifier, setIdlCaseCmd, (void *) 0, s);
if (UmlCom::read_bool()) {
_idl_case = 0;
_idl_explicit_case = s;
return TRUE;
}
else
return FALSE;
}
#endif
void UmlBaseAttribute::unload(bool rec, bool del) {
_type.explicit_type = 0;
_default_value = 0;
#ifdef WITHIDL
_idl_explicit_case = 0;
#endif
UmlBaseClassMember::unload(rec, del);
}
void UmlBaseAttribute::read_uml_() {
UmlBaseClassMember::read_uml_();
_type.type = (UmlClass *) UmlBaseItem::read_();
if (_type.type == 0)
_type.explicit_type = UmlCom::read_string();
_default_value = UmlCom::read_string();
_read_only = UmlCom::read_bool();
_get_oper = (UmlOperation *) UmlBaseItem::read_();
_set_oper = (UmlOperation *) UmlBaseItem::read_();
}
#ifdef WITHCPP
void UmlBaseAttribute::read_cpp_() {
UmlBaseClassMember::read_cpp_();
_cpp_mutable = UmlCom::read_bool();
}
#endif
#ifdef WITHJAVA
void UmlBaseAttribute::read_java_() {
UmlBaseClassMember::read_java_();
_java_transient = UmlCom::read_bool();
}
#endif
#ifdef WITHIDL
void UmlBaseAttribute::read_idl_() {
UmlBaseClassItem::read_idl_();
_idl_case = (UmlAttribute *) UmlBaseItem::read_();
if (_idl_case == 0)
_idl_explicit_case = UmlCom::read_string();
}
#endif
|