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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
|
#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) {
UmlCom::send_cmd(_identifier, setIsReadOnlyCmd, (char) y);
if (UmlCom::read_bool()) {
_read_only = y;
return TRUE;
}
else
return FALSE;
}
bool UmlBaseAttribute::isDerived() {
read_if_needed_();
return _derived;
}
bool UmlBaseAttribute::isDerivedUnion() {
read_if_needed_();
return _derived_union;
}
bool UmlBaseAttribute::set_isDerived(bool is_derived, bool is_union) {
UmlCom::send_cmd(_identifier, setDerivedCmd,
(char) (((is_derived) ? 1 : 0) + ((is_union) ? 2 : 0)));
if (UmlCom::read_bool()) {
_derived = is_derived;
_derived_union = is_union;
return TRUE;
}
else
return FALSE;
}
bool UmlBaseAttribute::isOrdered() {
read_if_needed_();
return _ordered;
}
bool UmlBaseAttribute::set_isOrdered(bool v) {
UmlCom::send_cmd(_identifier, setOrderingCmd, (char) v);
if (UmlCom::read_bool()) {
_ordered = v;
return TRUE;
}
else
return FALSE;
}
bool UmlBaseAttribute::isUnique() {
read_if_needed_();
return _unique;
}
bool UmlBaseAttribute::set_isUnique(bool v) {
UmlCom::send_cmd(_identifier, setUniqueCmd, (char) v);
if (UmlCom::read_bool()) {
_unique = v;
return TRUE;
}
else
return FALSE;
}
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);
}
const QCString & UmlBaseAttribute::multiplicity() {
read_if_needed_();
return _multiplicity;
}
bool UmlBaseAttribute::set_Multiplicity(const char * s) {
return set_it_(_multiplicity, s, setMultiplicityCmd);
}
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) {
UmlCom::send_cmd(_identifier, setIsCppMutableCmd, (char) y);
if (UmlCom::read_bool()) {
_cpp_mutable = y;
return TRUE;
}
else
return FALSE;
}
#endif
#ifdef WITHJAVA
bool UmlBaseAttribute::isJavaTransient() {
read_if_needed_();
return _java_transient;
}
bool UmlBaseAttribute::set_isJavaTransient(bool y) {
UmlCom::send_cmd(_identifier, setIsJavaTransientCmd, (char) y);
if (UmlCom::read_bool()) {
_java_transient = y;
return TRUE;
}
else
return FALSE;
}
#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);
_multiplicity = 0;
}
void UmlBaseAttribute::read_uml_() {
UmlBaseClassMember::read_uml_();
_type.type = (UmlClass *) UmlBaseItem::read_();
if (_type.type == 0)
_type.explicit_type = UmlCom::read_string();
_multiplicity = UmlCom::read_string();
_default_value = UmlCom::read_string();
_read_only = UmlCom::read_bool();
_derived = UmlCom::read_bool();
_derived_union = UmlCom::read_bool();
_ordered = UmlCom::read_bool();
_unique = 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 WITHPHP
void UmlBaseAttribute::read_php_() {
UmlBaseClassMember::read_php_();
}
#endif
#ifdef WITHPYTHON
void UmlBaseAttribute::read_python_() {
UmlBaseClassMember::read_python_();
}
#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
|