AggregatePort* AggregatePort::modify(std::shared_ptr<SwitchState>* state) { if (!isPublished()) { CHECK(!(*state)->isPublished()); return this; } AggregatePortMap* aggPorts = (*state)->getAggregatePorts()->modify(state); auto newAggPort = clone(); auto* ptr = newAggPort.get(); aggPorts->updateAggregatePort(std::move(newAggPort)); return ptr; }
Vlan* Vlan::modify(std::shared_ptr<SwitchState>* state) { if (!isPublished()) { CHECK(!(*state)->isPublished()); return this; } VlanMap* vlans = (*state)->getVlans()->modify(state); auto newVlan = clone(); auto* ptr = newVlan.get(); vlans->updateVlan(std::move(newVlan)); return ptr; }
AggregatePortMap* AggregatePortMap::modify( std::shared_ptr<SwitchState>* state) { if (!isPublished()) { CHECK(!(*state)->isPublished()); return this; } SwitchState::modify(state); auto newAggPorts = clone(); auto* ptr = newAggPorts.get(); (*state)->resetAggregatePorts(std::move(newAggPorts)); return ptr; }
OSDictionary * AppleLVMVolume::getVolumeProperties(void) { // make a copy assert(lvProps); OSDictionary * props = OSDictionary::withDictionary(lvProps, lvProps->getCount() + 2); if (!props) return NULL; // not from header OSString * status = NULL; if (isPublished()) { status = OSString::withCString(kAppleRAIDStatusOnline); } else { status = OSString::withCString(kAppleRAIDStatusOffline); } if (status) { props->setObject(kAppleLVMVolumeStatusKey, status); status->release(); } props->setObject(kIOBSDNameKey, getDiskName()); return props; }