当前位置: 首页>>代码示例>>C++>>正文


C++ Profile类代码示例

本文整理汇总了C++中Profile的典型用法代码示例。如果您正苦于以下问题:C++ Profile类的具体用法?C++ Profile怎么用?C++ Profile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Profile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updatePulseObject

void Card::update(const pa_card_info *info)
{
    updatePulseObject(info);

    QString infoName = QString::fromUtf8(info->name);
    if (m_name != infoName) {
        m_name = infoName;
        emit nameChanged();
    }

    qDeleteAll(m_profiles);
    m_profiles.clear();
    for (auto **it = info->profiles2; it && *it != nullptr; ++it) {
        Profile *profile = new Profile(this);
        profile->setInfo(*it);
        m_profiles.append(profile);
        if (info->active_profile2 == *it) {
            m_activeProfileIndex = m_profiles.length() - 1;
        }
    }
    emit profilesChanged();
    emit activeProfileIndexChanged();

    qDeleteAll(m_ports);
    m_ports.clear();
    for (auto **it = info->ports; it && *it != nullptr; ++it) {
        CardPort *port = new CardPort(this);
        port->update(*it);
        m_ports.append(port);
    }
    emit portsChanged();
}
开发者ID:KDE,项目名称:plasma-pa,代码行数:32,代码来源:card.cpp

示例2: QVariant

QVariant ProfileList::data ( const QModelIndex & index, int role ) const
{
    //qDebug() << "Qml asking for entry " << index.row();

    if( _profiles == 0 )
        return QVariant();
    if (!index.isValid())
        return QVariant(); // Return Null variant if index is invalid
    if (index.row() > (_profiles->count()) )
        return QVariant();

    Profile *dobj = _profiles->values().at(index.row());

    if( dobj )
    {
        //qDebug() << "Bitrate: " << dobj->getBitrate()
                // << "Name: " << dobj->getName()
                // << "Id: " << dobj->getId();

        switch (role) {
        case Qt::DisplayRole: // The default display role now displays the first name as well
        case IdRole:
            return QVariant::fromValue(dobj->getId());
        case NameRole:
            return QVariant::fromValue(dobj->getName());
        default:
            return QVariant();
        }
    } else {
        return QVariant();
    }

}
开发者ID:andyleadbetter,项目名称:qtknots,代码行数:33,代码来源:knotsdeclarative.cpp

示例3: compute_sinc_cos

//tabulates (sin(qr)/qr - cos(qr))/r^2 over the range of qs of the profile
//and up to max_distance for r.
void DerivativeCalculator::compute_sinc_cos(Float pr_resolution,
                                            Float max_distance,
                                            const Profile& model_profile,
                                std::vector<Floats>& output_values) const
{
  //can be input
  unsigned int nr=algebra::get_rounded(max_distance/pr_resolution) + 1;
  output_values.clear();
  unsigned int profile_size = std::min(model_profile.size(),
                                       exp_profile_.size());
  Floats r_size(nr, 0.0);
  output_values.insert(output_values.begin(),
                       profile_size, r_size);
  for(unsigned int iq = 0; iq<profile_size; iq++) {
    Float q = model_profile.get_q(iq);
    for (unsigned int ir=0; ir<nr; ir++) {
      Float r = pr_resolution * ir;
      Float qr = q * r;
      if(fabs(qr) < 1.0e-16) {
        output_values[iq][ir] = 0;
      } else {
        output_values[iq][ir] = (boost::math::sinc_pi(qr) - cos(qr)) /square(r);
      }
    }
  }
}
开发者ID:andreyto,项目名称:imp-fork-proddl,代码行数:28,代码来源:DerivativeCalculator.cpp

示例4: ThrowException

Handle<Value> HoneydConfigBinding::GetPortSet(const Arguments& args)
{
	HandleScope scope;
	HoneydConfigBinding* obj = ObjectWrap::Unwrap<HoneydConfigBinding>(args.This());

	if(args.Length() != 2)
	{
		return ThrowException(Exception::TypeError(String::New("Must be invoked with 2 parameters")));
	}

	std::string profileName = cvv8::CastFromJS<string>(args[0]);
	int portSetIndex = cvv8::CastFromJS<int>(args[1]);

	Profile *profile = obj->m_conf->GetProfile(profileName);
	if(profile == NULL)
	{
		return scope.Close( Null() );
	}
	PortSet *portSet = profile->GetPortSet(portSetIndex);
	if(portSet == NULL)
	{
		return scope.Close( Null() );
	}

	return scope.Close( HoneydNodeJs::WrapPortSet( portSet ));
}
开发者ID:ajayk1205,项目名称:Nova,代码行数:26,代码来源:HoneydConfigBinding.cpp

示例5: DontTryToCreate

void MFolderFromProfile::DontTryToCreate()
{
   if ( m_profile->HasEntry(MP_FOLDER_TRY_CREATE) )
   {
      m_profile->DeleteEntry(MP_FOLDER_TRY_CREATE);
   }
}
开发者ID:mark711,项目名称:mahogany,代码行数:7,代码来源:MFolder.cpp

示例6: store

void Profile::store(profile_ptr p, ostream& os) { 
    
    // get profile ptr
    Profile *istore = p.get();
    
    if (!p) {
        cerr << "Can't store empty profile pointer" << endl;
        return;
    }
    
    
    // update stores
    istore->update_stores();
    
    // clear loaded instances
    istore->unload_instances();
    
    try {
        boost::archive::text_oarchive oa(os);
        oa << istore;
        
    } catch (exception& e) {
        cerr << e.what() << endl;
    }
}
开发者ID:oliverguenther,项目名称:broadmask-npapi,代码行数:25,代码来源:Profile.cpp

示例7:

void Pulsar::RemoveBaseline::Each::transform (Archive* archive)
{
  const unsigned nsub = archive->get_nsubint();
  const unsigned nchan = archive->get_nchan();
  const unsigned npol = archive->get_npol();

  bool pscrunch = (archive->get_state() == Signal::Coherence ||
		   archive->get_state() == Signal::PPQQ);

  for (unsigned isub=0; isub < nsub; isub++)
  {
    Integration* subint = archive->get_Integration (isub);
    for (unsigned ichan=0; ichan < nchan; ichan++)
    {
      Reference::To<Profile> profile = subint->get_Profile (0,ichan);
      if (pscrunch)
      {
	profile = profile->clone();
	profile->sum (subint->get_Profile (1,ichan));
      }

      Reference::To<PhaseWeight> baseline = profile->baseline();

      for (unsigned ipol=0; ipol < npol; ipol++)
      {
	Profile* p = subint->get_Profile(ipol, ichan);
	baseline->set_Profile (p);
	p->offset (-baseline->get_mean().val);
      }
    }
  }
};
开发者ID:lbaehren,项目名称:lofarsoft,代码行数:32,代码来源:RemoveBaseline.C

示例8: Profile

Profile *Profiles::processProfile(Profile *parent, pugi::xml_node config)
{
	std::string name = config.attribute("name").value();

	if (name.empty()) {
		throw std::runtime_error("Missing profile name");
	}
	
	/* Create new profile */
	Profile *profile = new Profile(name);
	profile->setParent(parent);
	profile->setNode(config);

	pugi::xpath_node_set profiles = config.select_nodes("profile");
	pugi::xpath_node_set channels = config.select_nodes("channel");

	for (auto& node: channels) {
		Channel *channel = processChannel(profile, node.node());
		profile->addChannel(channel, true);
	}

	for (auto& node: profiles) {
		Profile *child = processProfile(profile, node.node());
		profile->addProfile(child, true);
	}

	return profile;
}
开发者ID:ADTRAN,项目名称:ipfixcol,代码行数:28,代码来源:Profiles.cpp

示例9: setProfile

 void
 setProfile(const Profile& profile)
 {
   m_name = profile.get("name");
   m_institution = profile.get("institution");
   m_profile = profile;
 }
开发者ID:bruinfish,项目名称:ChronoChat,代码行数:7,代码来源:contact.hpp

示例10: setUpdatesEnabled

void TargetView::repopulateList()
{
	// Prevent ugly repaints
	setUpdatesEnabled(false);

	// Clear existing list
	for(int i = 0; i < m_panes.count(); i++)
		delete m_panes.at(i);
	m_panes.clear();

	// Repopulate list
	Profile *profile = App->getProfile();
	TargetList targets = profile->getTargets();
	for(int i = 0; i < targets.count(); i++) {
		Target *target = targets.at(i);
		TargetPane *pane = new TargetPane(target, this);
		target->setupTargetPane(pane);
		m_panes.append(pane);
		m_layout.addWidget(pane);
		connect(pane, &TargetPane::rightClicked,
			this, &TargetView::targetPaneRightClicked,
			Qt::UniqueConnection);
	}

	// HACK: This must be delayed in order to actually do anything
	QTimer::singleShot(10, this, SLOT(enableUpdatesTimeout()));
}
开发者ID:andrejsavikin,项目名称:mishira,代码行数:27,代码来源:targetview.cpp

示例11: normalX

void Mesh::getPointBasic(std::vector<qglviewer::Vec*>* points)
{
    FloorVertex* floorVertexTmp = floorPlan;

    float normalX(0.0f);
    float normalY(0.0f);

    for(unsigned int i(0); i < floorPlanSize; ++i) {

        Profile* profile = floorVertexTmp->getProfile();
        if (profile != 0) {
           Vertex* pVertex = profile->getProfileVertex();
            while(pVertex != 0)
            {
                float w = pVertex->getX();
                float z = pVertex->getY();

                //float x = floorVertexTmp->getX()* (1.0f - w) + centerX * w;
                //float y = floorVertexTmp->getY()* (1.0f - w) + centerY * w;

                floorVertexTmp->getNormal(normalX, normalY);
                float x = floorVertexTmp->getX() + (-normalX) * w;
                float y = floorVertexTmp->getY() + (-normalY) * w;

                points->push_back(new qglviewer::Vec(x, y, z));
                pVertex = pVertex->getNeighbor2();
            }
        }
        floorVertexTmp = (FloorVertex*)floorVertexTmp->getNeighbor2();
    }
}
开发者ID:NicolasMaitre,项目名称:Master-semester-project,代码行数:31,代码来源:Mesh.cpp

示例12: store_active

void ProfileManager::store_active() {
    Profile *p = active_profile.get();
    
    // Store only if active
    if (p)
        store_profile(p->profilename(), active_profile);    
}
开发者ID:oliverguenther,项目名称:broadmask-npapi,代码行数:7,代码来源:ProfileManager.cpp

示例13: XMLWriter

void ProfileDB::dumpProfilesXML(vector<Profile*> profiles,
        map<string, Profile*> profileMappings, string profileName) {
	ostringstream output;
	XMLWriter writer = XMLWriter(&output);
	writer.start();
	writer.startTag("db");
	writer.setAttr("version", "1.0");
	writer.setAttr("id", "main");

	string line;

	if (profiles.size() > 0) {
		for (size_t i = 0; i < profiles.size(); i++) {
			Profile* profile = profiles.at(i);
			if (profile) {
				profile->toXML(writer, fIncludeCapabilities);
			}
		}
		if (fOutputMappings) {
			dumpProfileMappings(&writer, profileMappings);
		}
	} else {
		writer.startTag("error");
		writer.text(string("Could find no matching profile for ") + profileName);
		writer.endTag();
	}

	writer.endTag();

	printf("%s", output.str().c_str());
}
开发者ID:Ginox,项目名称:MoSync,代码行数:31,代码来源:profiledb.cpp

示例14: getProfiles

void ProfileDB::listCapabilities(string statePattern) {
	vector<Profile*> profiles;
	set<string> aggregateCapabilities;
	getProfiles("*", profiles);
	for (size_t i = 0; i < profiles.size(); i++) {
		Profile* profile = profiles.at(i);
		set<string> capabilities = profile->getCapabilities();
		for (set<string>::iterator capabilityIt = capabilities.begin(); capabilityIt
		        != capabilities.end(); capabilityIt++) {
			Capability capability = profile->getCapability(*capabilityIt);
			if (capability.matchCapability(statePattern)) {
				aggregateCapabilities.insert(*capabilityIt);
			}
		}
	}

	ostringstream output;
	XMLWriter writer = XMLWriter(&output);
	writer.start();
	writer.startTag("db");
	writer.setAttr("version", "1.0");
	writer.setAttr("id", "main");
	for (set<string>::iterator capabilityIt = aggregateCapabilities.begin(); capabilityIt
	        != aggregateCapabilities.end(); capabilityIt++) {
		writer.startTag(ELEMENT_CAPABILITY);
		writer.setAttr(ATTR_NAME, *capabilityIt);
		writer.endTag();
	}
	writer.endTag();
	writer.end();
	writer.dump();
}
开发者ID:Ginox,项目名称:MoSync,代码行数:32,代码来源:profiledb.cpp

示例15: on_latestMultimediaButton_clicked

void DashboardGUI::on_latestMultimediaButton_clicked()
{
    // clear the previous list
    ui->latestInfoListWidget->clear();

    // pull data from the database and display in a list
    Profile *currentProfile = accountController->getUser()->getProfile();
    Scrapbook *myScrapbook = currentProfile->getScrapbook();
    std::vector<Multimedia*> allMulti = myScrapbook->getAllMedia();
    for(int i = 0; i < 5; i++){
        if(i == allMulti.size()){
            return;
        }
        Multimedia *media = allMulti.at(i);
        QString title = media->getTitle();
        QString description = media->getDescription();
        QString content = media->getContent();
        QString newLabel = "PHOTO \n" +
                title + "\n" +
                "@" + media->getAuthorUsername() + "\n" +
                description + "\n";
        QListWidgetItem *newMedia = new QListWidgetItem(QIcon(content), newLabel, ui->latestInfoListWidget);
        ui->latestInfoListWidget->addItem(newMedia);
        ui->latestInfoListWidget->setIconSize(QSize(125,125));
    }

}
开发者ID:HuyLafa,项目名称:RocketBook,代码行数:27,代码来源:dashboardgui.cpp


注:本文中的Profile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。