- Timestamp:
- Jun 26, 2007 3:50:41 PM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/BIOSSettingsImpl.cpp
r3007 r3302 171 171 CheckComRCReturnRC (autoCaller.rc()); 172 172 173 AutoLock alock (this); 174 175 CHECK_MACHINE_MUTABILITY (mParent); 173 /* the machine needs to be mutable */ 174 Machine::AutoMutableStateDependency adep (mParent); 175 CheckComRCReturnRC (adep.rc()); 176 177 AutoLock alock (this); 176 178 177 179 mData.backup(); … … 201 203 CheckComRCReturnRC (autoCaller.rc()); 202 204 203 AutoLock alock (this); 204 205 CHECK_MACHINE_MUTABILITY (mParent); 205 /* the machine needs to be mutable */ 206 Machine::AutoMutableStateDependency adep (mParent); 207 CheckComRCReturnRC (adep.rc()); 208 209 AutoLock alock (this); 206 210 207 211 mData.backup(); … … 231 235 CheckComRCReturnRC (autoCaller.rc()); 232 236 233 AutoLock alock (this); 234 235 CHECK_MACHINE_MUTABILITY (mParent); 237 /* the machine needs to be mutable */ 238 Machine::AutoMutableStateDependency adep (mParent); 239 CheckComRCReturnRC (adep.rc()); 240 241 AutoLock alock (this); 236 242 237 243 mData.backup(); … … 264 270 CheckComRCReturnRC (autoCaller.rc()); 265 271 266 AutoLock alock (this); 267 268 CHECK_MACHINE_MUTABILITY (mParent); 272 /* the machine needs to be mutable */ 273 Machine::AutoMutableStateDependency adep (mParent); 274 CheckComRCReturnRC (adep.rc()); 275 276 AutoLock alock (this); 269 277 270 278 mData.backup(); … … 293 301 CheckComRCReturnRC (autoCaller.rc()); 294 302 295 AutoLock alock (this); 296 297 CHECK_MACHINE_MUTABILITY (mParent); 303 /* the machine needs to be mutable */ 304 Machine::AutoMutableStateDependency adep (mParent); 305 CheckComRCReturnRC (adep.rc()); 306 307 AutoLock alock (this); 298 308 299 309 mData.backup(); … … 323 333 CheckComRCReturnRC (autoCaller.rc()); 324 334 325 AutoLock alock (this); 326 327 CHECK_MACHINE_MUTABILITY (mParent); 335 /* the machine needs to be mutable */ 336 Machine::AutoMutableStateDependency adep (mParent); 337 CheckComRCReturnRC (adep.rc()); 338 339 AutoLock alock (this); 328 340 329 341 mData.backup(); … … 353 365 CheckComRCReturnRC (autoCaller.rc()); 354 366 355 AutoLock alock (this); 356 357 CHECK_MACHINE_MUTABILITY (mParent); 367 /* the machine needs to be mutable */ 368 Machine::AutoMutableStateDependency adep (mParent); 369 CheckComRCReturnRC (adep.rc()); 370 371 AutoLock alock (this); 358 372 359 373 mData.backup(); … … 383 397 CheckComRCReturnRC (autoCaller.rc()); 384 398 385 AutoLock alock (this); 386 387 CHECK_MACHINE_MUTABILITY (mParent); 399 /* the machine needs to be mutable */ 400 Machine::AutoMutableStateDependency adep (mParent); 401 CheckComRCReturnRC (adep.rc()); 402 403 AutoLock alock (this); 388 404 389 405 mData.backup(); -
trunk/src/VBox/Main/USBControllerImpl.cpp
r3007 r3302 227 227 CheckComRCReturnRC (autoCaller.rc()); 228 228 229 /* the machine needs to be mutable */ 230 Machine::AutoMutableStateDependency adep (mParent); 231 CheckComRCReturnRC (adep.rc()); 232 229 233 AutoLock alock (this); 230 231 CHECK_MACHINE_MUTABILITY (mParent);232 234 233 235 if (mData->mEnabled != aEnabled) … … 295 297 CheckComRCReturnRC (autoCaller.rc()); 296 298 299 /* the machine needs to be mutable */ 300 Machine::AutoMutableStateDependency adep (mParent); 301 CheckComRCReturnRC (adep.rc()); 302 297 303 AutoLock alock (this); 298 299 CHECK_MACHINE_MUTABILITY (mParent);300 304 301 305 ComObjPtr <USBDeviceFilter> filter; … … 319 323 320 324 /* the machine needs to be mutable */ 321 Machine::Auto StateDependency <Machine::MutableStateDep>adep (mParent);325 Machine::AutoMutableStateDependency adep (mParent); 322 326 CheckComRCReturnRC (adep.rc()); 323 327 … … 380 384 381 385 /* the machine needs to be mutable */ 382 Machine::Auto StateDependency <Machine::MutableStateDep>adep (mParent);386 Machine::AutoMutableStateDependency adep (mParent); 383 387 CheckComRCReturnRC (adep.rc()); 384 388 … … 677 681 678 682 /* we need the machine state */ 679 Machine::Auto StateDependency <Machine::MutableStateDep>adep (mParent);683 Machine::AutoMutableStateDependency adep (mParent); 680 684 AssertComRCReturn (adep.rc(), false); 681 685 … … 950 954 #else 951 955 /* we need the machine state */ 952 Machine::Auto StateDependency <Machine::MutableStateDep>adep (mParent);956 Machine::AutoMutableStateDependency adep (mParent); 953 957 AssertComRCReturnRC (adep.rc()); 954 958 -
trunk/src/VBox/Main/include/MachineImpl.h
r3001 r3302 299 299 * 300 300 * @code 301 * AutoCaller autoCaller (this); 302 * CheckComRCReturnRC (autoCaller.rc()); 303 * 301 304 * Machine::AutoStateDependency <MutableStateDep> adep (mParent); 302 305 * CheckComRCReturnRC (stateDep.rc()); … … 305 308 * ... 306 309 * @endcode 310 * 311 * Note that it is more convenient to use the following individual 312 * shortcut classes instead of using this template directly: 313 * AutoAnyStateDependency, AutoMutableStateDependency and 314 * AutoMutableOrSavedStateDependency. The usage pattern is exactly the 315 * same as above except that there is no need to specify the template 316 * argument because it is already done by the shortcut class. 307 317 * 308 318 * @param taDepType Dependecy type to manage. … … 373 383 DECLARE_CLS_NEW_DELETE_NOOP (AutoStateDependency) 374 384 }; 385 386 /** 387 * Shortcut to AutoStateDependency <AnyStateDep>. 388 * See AutoStateDependency to get the usage pattern. 389 * 390 * Accepts any machine state and guarantees the state won't change before 391 * this object is destroyed. If the machine state cannot be protected (as 392 * a result of the state change currently in progress), this instance's 393 * #rc() method will indicate a failure, and the caller is not allowed to 394 * rely on any particular machine state and should return the failed 395 * result code to the upper level. 396 */ 397 typedef AutoStateDependency <AnyStateDep> AutoAnyStateDependency; 398 399 /** 400 * Shortcut to AutoStateDependency <MutableStateDep>. 401 * See AutoStateDependency to get the usage pattern. 402 * 403 * Succeeds only if the machine state is in one of the mutable states, and 404 * guarantees the given mutable state won't change before this object is 405 * destroyed. If the machine is not mutable, this instance's #rc() method 406 * will indicate a failure, and the caller is not allowed to rely on any 407 * particular machine state and should return the failed result code to 408 * the upper level. 409 * 410 * Intended to be used within all setter methods of IMachine 411 * children objects (DVDDrive, NetworkAdapter, AudioAdapter, etc.) to 412 * provide data protection and consistency. 413 */ 414 typedef AutoStateDependency <MutableStateDep> AutoMutableStateDependency; 415 416 /** 417 * Shortcut to AutoStateDependency <MutableOrSavedStateDep>. 418 * See AutoStateDependency to get the usage pattern. 419 * 420 * Succeeds only if the machine state is in one of the mutable states, or 421 * if the machine is in the Saved state, and guarantees the given mutable 422 * state won't change before this object is destroyed. If the machine is 423 * not mutable, this instance's #rc() method will indicate a failure, and 424 * the caller is not allowed to rely on any particular machine state and 425 * should return the failed result code to the upper level. 426 * 427 * Intended to be used within setter methods of IMachine 428 * children objects that may also operate on Saved machines. 429 */ 430 typedef AutoStateDependency <MutableOrSavedStateDep> AutoMutableOrSavedStateDependency; 431 375 432 376 433 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (Machine)
Note:
See TracChangeset
for help on using the changeset viewer.