1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "Variable.h" 8 9 #include "CpuState.h" 10 #include "ObjectID.h" 11 #include "Type.h" 12 #include "ValueLocation.h" 13 14 15 Variable::Variable(ObjectID* id, const BString& name, Type* type, 16 ValueLocation* location, CpuState* state) 17 : 18 fID(id), 19 fName(name), 20 fType(type), 21 fLocation(location), 22 fCpuState(state) 23 { 24 fID->AcquireReference(); 25 fType->AcquireReference(); 26 fLocation->AcquireReference(); 27 if (fCpuState != NULL) 28 fCpuState->AcquireReference(); 29 } 30 31 32 Variable::~Variable() 33 { 34 fID->ReleaseReference(); 35 fType->ReleaseReference(); 36 fLocation->ReleaseReference(); 37 if (fCpuState != NULL) 38 fCpuState->ReleaseReference(); 39 } 40