LabModel FilterGraph::formatLabModel () { LabModel lab; lab.uid = Uuid().toString().toUTF8(); for (int i = 0; i < graph.getNumNodes(); ++i) { FilterModel x = formatFilterModel(graph.getNode(i)); x.lab = lab.uid; x.filterId = Uuid().toString().toUTF8(); lab.filterList.push_back(x); } for (int i = 0; i < graph.getNumConnections(); ++i) { ConnectionModel conn; const AudioProcessorGraph::Connection* const fc = graph.getConnection(i); conn.uid = Uuid().toString().toUTF8(); conn.srcFilter = (int) fc->sourceNodeId; conn.srcChannel = fc->sourceChannelIndex; conn.dstFilter = (int) fc->destNodeId; conn.dstChannel = fc->destChannelIndex; lab.connectionList.push_back(conn); } return lab; }
// ----------------------------------------------------------------------------- // CUpnpDeviceImplementation::StopDeviceL // ----------------------------------------------------------------------------- // void CUpnpDeviceImplementation::StopDeviceL( TStopMode aMode ) { SaveDescriptionStoreL(); if( aMode == EStopSilent ) { RemoveLocalDeviceL( Uuid(), ETrue ); } else { RemoveLocalDeviceL( Uuid(), EFalse ); } StopHttpServer(); }
ComponentSignalInstance::ComponentSignalInstance(Circuit& circuit, ComponentInstance& cmpInstance, const XmlDomElement& domElement) throw (Exception) : QObject(nullptr), mCircuit(circuit), mComponentInstance(cmpInstance), mComponentSignal(nullptr), mNetSignal(nullptr), mAddedToCircuit(false) { // read attributes Uuid compSignalUuid = domElement.getAttribute<Uuid>("comp_signal", true); mComponentSignal = mComponentInstance.getLibComponent().getSignalByUuid(compSignalUuid); if(!mComponentSignal) { throw RuntimeError(__FILE__, __LINE__, compSignalUuid.toStr(), QString( tr("Invalid component signal UUID: \"%1\"")).arg(compSignalUuid.toStr())); } Uuid netsignalUuid = domElement.getAttribute<Uuid>("netsignal", false, Uuid()); if (!netsignalUuid.isNull()) { mNetSignal = mCircuit.getNetSignalByUuid(netsignalUuid); if(!mNetSignal) { throw RuntimeError(__FILE__, __LINE__, netsignalUuid.toStr(), QString(tr("Invalid netsignal UUID: \"%1\"")).arg(netsignalUuid.toStr())); } } init(); }
XmlDomElement* ComponentSignalInstance::serializeToXmlDomElement() const throw (Exception) { if (!checkAttributesValidity()) throw LogicError(__FILE__, __LINE__); QScopedPointer<XmlDomElement> root(new XmlDomElement("map")); root->setAttribute("comp_signal", mComponentSignal->getUuid()); root->setAttribute("netsignal", mNetSignal ? mNetSignal->getUuid() : Uuid()); return root.take(); }
CtrlrPanelCanvasLayer::CtrlrPanelCanvasLayer(CtrlrPanelCanvas &_owner) : layerTree(Ids::uiPanelCanvasLayer), owner(_owner), mousePass(false) { layerTree.addListener (this); int64 data = Time::getCurrentTime().getHighResolutionTicks(); setProperty (Ids::uiPanelCanvasLayerName, "New layer"); setProperty (Ids::uiPanelCanvasLayerUid, Uuid ((const uint8 *)&data).toString()); setProperty (Ids::uiPanelCanvasLayerColour, "0x000000"); setProperty (Ids::uiPanelCanvasLayerVisibility, true); setProperty (Ids::uiPanelCanvasLayerIndex, 0); owner.getCanvasTree().addChild (layerTree, -1, 0); }
void Entry::setIcon(int iconNumber) { Q_ASSERT(iconNumber >= 0); if (m_data.iconNumber != iconNumber || !m_data.customIcon.isNull()) { m_data.iconNumber = iconNumber; m_data.customIcon = Uuid(); Q_EMIT modified(); emitDataChanged(); } }
void Group::setIcon(int iconNumber) { Q_ASSERT(iconNumber >= 0); if (m_data.iconNumber != iconNumber || !m_data.customIcon.isNull()) { m_data.iconNumber = iconNumber; m_data.customIcon = Uuid(); updateTimeinfo(); Q_EMIT modified(); Q_EMIT dataChanged(this); } }
void Cluster::memberUpdate(Lock& l) { // Ignore config changes while we are joining. if (state < CATCHUP) return; QPID_LOG(info, *this << " member update: " << map); size_t aliveCount = map.aliveCount(); assert(map.isAlive(self)); failoverExchange->updateUrls(getUrls(l)); // Mark store clean if I am the only broker, dirty otherwise. if (store.hasStore()) { if (aliveCount == 1) { if (store.getState() != STORE_STATE_CLEAN_STORE) { QPID_LOG(notice, *this << "Sole member of cluster, marking store clean."); store.clean(Uuid(true)); } } else { if (store.getState() != STORE_STATE_DIRTY_STORE) { QPID_LOG(notice, "Running in a cluster, marking store dirty."); store.dirty(); } } } // If I am the last member standing, set queue policies. if (aliveCount == 1 && lastAliveCount > 1 && state >= CATCHUP) { QPID_LOG(notice, *this << " last broker standing, update queue policies"); lastBroker = true; broker.getQueues().updateQueueClusterState(true); } else if (aliveCount > 1 && lastBroker) { QPID_LOG(notice, *this << " last broker standing joined by " << aliveCount-1 << " replicas, updating queue policies."); lastBroker = false; broker.getQueues().updateQueueClusterState(false); } lastAliveCount = aliveCount; // Close connections belonging to members that have left the cluster. ConnectionMap::iterator i = connections.begin(); while (i != connections.end()) { ConnectionMap::iterator j = i++; MemberId m = j->second->getId().getMember(); if (m != self && !map.isMember(m)) { j->second->close(); erase(j->second->getId(), l); } } }
// ----------------------------------------------------------------------------- // CUpnpDeviceImplementation::AddLocalDeviceL // ----------------------------------------------------------------------------- // void CUpnpDeviceImplementation::AddLocalDeviceL() { GenerateUdnsL(this); SaveDescriptionStoreL(); const TPtrC8 uuid = Uuid(); const TPtrC8 device = DeviceType(); const TDesC8& url = DescriptionUrl(); iDispatcher->AddLocalDeviceL( uuid, device, url, ServiceTypesL(), iIsRootDevice ); delete iPath; iPath = NULL; iPath = DescriptionUrl().AllocL(); }
juced_ImageComponent::juced_ImageComponent() : ImageComponent () { setName("ImageComponent"); setProperty(Attributes::objectType, Modules::ImageComponent.toString()); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::image, ""); setProperty(Attributes::className, "ImageComponent"); setProperty(Attributes::toolName, "juced_ImageComponent"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
juced_ComboBox::juced_ComboBox() : ComboBox () { setText("Combo Box", false); setName("Box"); setProperty(Attributes::objectType, Modules::ComboBox.toString()); setProperty(Attributes::text, getText()); //setProperty(Attributes::font, getFont().toString()); setProperty(Attributes::backgroundColour, findColour(backgroundColourId).toDisplayString(true)); setProperty(Attributes::textColour, findColour(textColourId).toDisplayString(true)); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::itemList, ""); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::className, "ComboBox"); setProperty(Attributes::toolName, "juced_ComboBox"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
void CtrlrLuaMethodEditor::restoreState(const ValueTree &savedState) { restoreProperties (savedState, componentTree, nullptr); ScopedPointer <XmlElement> treeState(XmlDocument::parse (savedState.getProperty(Ids::luaMethodEditor).toString().upToLastOccurrenceOf(";", false, true))); if (treeState) { methodTree->restoreOpennessState (*treeState, true); } StringArray openedMethods; openedMethods.addTokens (savedState.getProperty(Ids::luaMethodEditor).toString().fromLastOccurrenceOf(";", false, true), ":", String::empty); for (int i=0; i<openedMethods.size(); i++) { setEditedMethod (Uuid (openedMethods[i])); } updateTabs(); }
void UnplacedComponentsDock::on_btnAddAll_clicked() { if (!mBoard) return; beginUndoCmdGroup(); for (int i = 0; i < mUi->lstUnplacedComponents->count(); i++) { Uuid componentUuid(mUi->lstUnplacedComponents->item(i)->data(Qt::UserRole).toString()); Q_ASSERT(componentUuid.isNull() == false); ComponentInstance* component = mProject.getCircuit().getComponentInstanceByUuid(componentUuid); if (component) { QList<Uuid> devices = mProjectEditor.getWorkspace().getLibrary(). getDevicesOfComponent(component->getLibComponent().getUuid()).toList(); if (devices.count() > 0) addNextDeviceToCmdGroup(*component, devices.first(), Uuid()); } } commitUndoCmdGroup(); updateComponentsList(); }
juced_BubbleMessageComponent::juced_BubbleMessageComponent() : BubbleMessageComponent () { //setText("Text label", false); //setName("Label"); setProperty(Attributes::objectType, Modules::BubbleComponent.toString()); //setProperty(Attributes::text, getText()); //setProperty(Attributes::font, getFont().toString()); setProperty(Attributes::backgroundColour, findColour(backgroundColourId).toDisplayString(true)); //setProperty(Attributes::textColour, findColour(textColourId).toDisplayString(true)); //setProperty(Attributes::showEditor, false); //setProperty(Attributes::editable, false); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::className, "BubbleMessageComponent"); setProperty(Attributes::toolName, "juced_BubbleMessageComponent"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
void StoreStatus::load() { if (dataDir.empty()) { throw Exception(QPID_MSG("No data-dir: When a store is loaded together with clustering, --data-dir must be specified.")); } try { fs::path dir = fs::path(dataDir, fs::native)/SUBDIR; create_directory(dir); fs::path file = dir/STORE_STATUS; if (fs::exists(file)) { string data = readFile(file); istringstream is(data); is.exceptions(std::ios::badbit | std::ios::failbit); is >> ws >> clusterId >> ws >> shutdownId; if (!clusterId) throw Exception(QPID_MSG("Invalid cluster store state, no cluster-id")); if (shutdownId) state = STORE_STATE_CLEAN_STORE; else state = STORE_STATE_DIRTY_STORE; } else { // Starting from empty store clusterId = Uuid(true); save(); state = STORE_STATE_EMPTY_STORE; } }
Uuid Uuid::null() noexcept { return Uuid ((const uint8*) nullptr); }
Uuid Uuid::fromBase64(const QString& str) { QByteArray data = QByteArray::fromBase64(str.toLatin1()); return Uuid(data); }
Uuid Uuid::fromHex(const QString& str) { QByteArray data = QByteArray::fromHex(str.toAscii()); return Uuid(data); }
/// reads Uuid Uuid ReadUuid() { std::array<unsigned char, 16> aData; ReadBlock(&aData[0], 16); return Uuid(&aData[0]); }
ASSERT_EQ(param.uuid, ipc->GetGuid()); auto values = GetParam().values; unsigned int index = 0; ASSERT_EQ(values.size(), ipc->GetNumArguments()); for (auto it = values.begin(); it != values.end(); ++it) { ASSERT_EQ(*it, ipc->Get<int32_t>(index)); ASSERT_TRUE(ipc->IsInt(index)); ASSERT_FALSE(ipc->IsString(index)); index++; } } INSTANTIATE_TEST_CASE_P(Default_int32, MyoddOsInt32Test, testing::Values( test_int32_t{ Uuid(),{ 0 } }, test_int32_t{ Uuid(),{ 42 } }, test_int32_t{ Uuid(),{ 100 } }, test_int32_t{ Uuid(),{ std::numeric_limits<int32_t>::max() } }, test_int32_t{ Uuid(),{ std::numeric_limits<int32_t>::min() } } )); INSTANTIATE_TEST_CASE_P(Multiple_int32Values, MyoddOsInt32Test, testing::Values( test_int32_t{ Uuid(),{ 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 } }, test_int32_t{ Uuid(),{ 0, -1, 2, -3, 4, -4, 3, -2, 1, 0 } }, test_int32_t{ Uuid(),{ std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::min() } }, test_int32_t{ Uuid(),{ std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max() } } ));
void Object::generateObjectId() { objectId_ = Uuid(); }
void CtrlrLuaMethodEditor::itemDoubleClicked (const MouseEvent &e, ValueTree &item) { setEditedMethod (Uuid(item.getProperty(Ids::uuid).toString())); }
bool Object::hasObjectId() const { if (objectId_ != Uuid("00000000-0000-0000-0000-000000000000")) return true; return false; }
ASSERT_EQ(param.uuid, ipc->GetGuid()); auto values = GetParam().values; unsigned int index = 0; ASSERT_EQ(values.size(), ipc->GetNumArguments()); for (auto it = values.begin(); it != values.end(); ++it) { ASSERT_TRUE( IsValid( *it, index )); index++; } } INSTANTIATE_TEST_CASE_P(Default_Varied, MyoddOsVariedTest, testing::Values( test_varied{ Uuid(),{{ Int32, L"", "", 0, 0 },{ Int64, L"","", 0, 0 },{ Int32, L"","", 0, 0 }} }, test_varied{ Uuid(),{{ Int32, L"", "", std::numeric_limits<int32_t>::min(), 0 }, { Int64, L"", "", 0, std::numeric_limits<int64_t>::max() }, { Int32, L"", "", std::numeric_limits<int32_t>::min(), 0 }, } }, test_varied{ Uuid(),{{ Int32, L"", "", std::numeric_limits<int32_t>::max(), 0 }, { Int64, L"", "", 0, std::numeric_limits<int64_t>::min() }, { Int32, L"", "", std::numeric_limits<int32_t>::max(), 0 }, } }, test_varied{ Uuid(),{{ String, L"Hello", "", 0, 0 }, { Int64, L"", "", 0, std::numeric_limits<int64_t>::max() }, { Int32, L"", "", std::numeric_limits<int32_t>::min(), 0 }, { Int64, L"", "", 0, std::numeric_limits<int64_t>::min() }, { StringAscii, L"", "Hello", 0, 0 },
void Cluster::stopFullCluster(Lock& ) { QPID_LOG(notice, *this << " shutting down cluster " << name); mcast.mcastControl(ClusterShutdownBody(ProtocolVersion(), Uuid(true)), self); }
/** * Generate a v4 random UUID * * @return Randomly generated v4 UUID */ Uuid generate_random_uuid() { CassUuid uuid; cass_uuid_gen_random(get(), &uuid); return Uuid(uuid); }
Uuid Uuid::random() { return Uuid(randomGen()->randomArray(Length)); }