本文整理汇总了C++中Participant类的典型用法代码示例。如果您正苦于以下问题:C++ Participant类的具体用法?C++ Participant怎么用?C++ Participant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Participant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParticipantStatistics
MultiConf::ParticipantStatistics* MultiConf::GetParticipantStatistic(int partId)
{
//Create statistics map
ParticipantStatistics *stats = new ParticipantStatistics();
//Lock
participantsLock.IncUse();
//Find participant
Participant* part = GetParticipant(partId);
//Check participant
if (part)
{
//Append
(*stats)["audio"] = part->GetStatistics(MediaFrame::Audio);
(*stats)["video"] = part->GetStatistics(MediaFrame::Video);
(*stats)["text"] = part->GetStatistics(MediaFrame::Text);
}
//Unlock
participantsLock.DecUse();
//Return stats
return stats;
}
示例2: ConsumeParticipantOutputToken
/********************************************************
* ConsumeBroadcastToken
* Check and consume a token for conference watcher
********************************************************/
Participant* MultiConf::ConsumeParticipantOutputToken(const std::wstring &token)
{
//Check token
ParticipantTokens::iterator it = outputTokens.find(token);
//Check we found one
if (it==outputTokens.end())
//Broadcast not found
return NULL;
//Get participant id
int partId = it->second;
//Remove token
outputTokens.erase(it);
//Get it
Participants::iterator itPart = participants.find(partId);
//Check if not found
if (itPart==participants.end())
//Not found
return NULL;
//Get it
Participant* part = itPart->second;
//Asert correct tipe
if (part->GetType()!=Participant::RTMP)
//Esit
return NULL;
//return it
return part;
}
示例3: Log
/************************
* SetAudioCodec
* SetAudioCodec
*************************/
int MultiConf::SetAudioCodec(int id,int codec)
{
int ret = 0;
Log("-SetAudioCodec [%d]\n",id);
//Use list
participantsLock.IncUse();
//Get the participant
Participant *part = GetParticipant(id);
//Check particpant
if (part)
//Set video codec
ret = part->SetAudioCodec((AudioCodec::Type)codec);
if (!m_GroupAudio.IsInited())
{
m_GroupAudio.SetAudioCodec((AudioCodec::Type)codec);
}
//Unlock
participantsLock.DecUse();
//Exit
return ret;
}
示例4: catch
std::shared_ptr<XmlNode> DptfStatus::getArbitratorXmlForLoadedParticipants()
{
auto root = XmlNode::createRoot();
root->addChild(XmlNode::createComment("format_id=" + ArbitratorStatusFormatId.toString()));
auto arbitratorRoot = XmlNode::createWrapperElement("arbitrator_status");
auto participantIndexList = m_participantManager->getParticipantIndexes();
auto numberOfUniqueDomains = 0;
for (auto participantIndex = participantIndexList.begin(); participantIndex != participantIndexList.end(); ++participantIndex)
{
try
{
Participant* participant = m_participantManager->getParticipantPtr(*participantIndex);
numberOfUniqueDomains = numberOfUniqueDomains + participant->getDomainCount();
}
catch (...)
{
// Participant not available
}
}
arbitratorRoot->addChild(XmlNode::createDataElement("number_of_domains", StatusFormat::friendlyValue(numberOfUniqueDomains)));
auto policyIndexes = m_policyManager->getPolicyIndexes();
for (auto policyIndex = policyIndexes.begin(); policyIndex != policyIndexes.end(); ++policyIndex)
{
try
{
Policy* policy = m_policyManager->getPolicyPtr(*policyIndex);
std::string name = policy->getName();
auto policyRoot = XmlNode::createWrapperElement("policy");
auto policyName = XmlNode::createDataElement("policy_name", name);
policyRoot->addChild(policyName);
for (auto participantIndex = participantIndexList.begin(); participantIndex != participantIndexList.end(); ++participantIndex)
{
try
{
Participant* participant = m_participantManager->getParticipantPtr(*participantIndex);
policyRoot->addChild(participant->getArbitrationXmlForPolicy(*policyIndex));
}
catch (...)
{
// Participant not available
}
}
arbitratorRoot->addChild(policyRoot);
}
catch (...)
{
// Policy not available, do not add.
}
}
root->addChild(arbitratorRoot);
return root;
}
示例5: return
// surcharge de l'operateur < pour le tri des participants lors
// de la generation du classement
bool
Participant::operator<(Participant &p) const{
// en cas de score identique, l'ordre alphabetique fait foi
if (this->getScore() == p.getScore())
return (this->getParticipantName() < p.getParticipantName());
else
return this->getScore() < p.getScore();
}
示例6: handleParticipantAdded
void MainScreen::handleParticipantAdded(Participant p)
{
QVariantMap map;
map["name"] = p.getName();
map["email"] = p.getEmail();
map["exl"] = p.getExList();
m_participants << map;
m_mainPage->setProperty("numParticipants", m_participants.size());
}
示例7: GetWinner
void Tournament::GetWinner(){
int max = -1;
Participant* winner;
for(int i = 0; i < number_of_participants; i++){
if(Participants[i]->GetPoints() > max){
max = Participants[i]->GetPoints();
winner = Participants[i];
}
}
cout << winner->GetName() << " " << winner->GetPoints() << endl;
}
示例8: slog
void RTPAudio::onGotHello(const SyncSource &src)
{
RTPEvent *event = RTPEvent::first;
slog(Slog::levelDebug) << "hello(" << src.getID() << ") ";
Participant* p = src.getParticipant();
slog() << p->getSDESItem(SDESItemTypeCNAME) << std::endl;
while(event)
{
event->gotHello(src);
event = event->next;
}
}
示例9: writeWorkItemStartingInfoMessage
void WIDptfConnectedStandbyEntry::execute(void)
{
writeWorkItemStartingInfoMessage();
// First let all policies know that we are entering connected standby
auto policyManager = getPolicyManager();
auto policyIndexes = policyManager->getPolicyIndexes();
for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
{
try
{
Policy* policy = policyManager->getPolicyPtr(*i);
policy->executeConnectedStandbyEntry();
}
catch (policy_index_invalid& ex)
{
// do nothing. No item in the policy list at this index.
}
catch (std::exception& ex)
{
writeWorkItemErrorMessagePolicy(ex, "Policy::executeConnectedStandbyEntry", *i);
}
}
// Now let all participants know
auto participantManager = getParticipantManager();
auto participantIndexList = participantManager->getParticipantIndexes();
for (auto i = participantIndexList.begin(); i != participantIndexList.end(); ++i)
{
try
{
Participant* participant = participantManager->getParticipantPtr(*i);
participant->connectedStandbyEntry();
}
catch (participant_index_invalid& ex)
{
// do nothing. No item in the participant list at this index.
}
catch (std::exception& ex)
{
writeWorkItemErrorMessageParticipant(ex, "Participant::connectedStandbyEntry", *i);
}
}
}
示例10: Error
RTMPMediaStream::Listener* MultiConf::ConsumeParticipantInputToken(const std::wstring &token)
{
//Check token
ParticipantTokens::iterator it = inputTokens.find(token);
//Check we found one
if (it==inputTokens.end())
{
//Error
Error("Participant token not found\n");
//Broadcast not found
return NULL;
}
//Get participant id
int partId = it->second;
//Remove token
inputTokens.erase(it);
//Get it
Participants::iterator itPart = participants.find(partId);
//Check if not found
if (itPart==participants.end())
{
//Error
Error("Participant not found\n");
//Broadcast not found
return NULL;
}
//Get it
Participant* part = itPart->second;
//Asert correct tipe
if (part->GetType()!=Participant::RTMP)
{
//Error
Error("Participant type not RTMP");
//Broadcast not found
return NULL;
}
//return it
return (RTMPMediaStream::Listener*)(RTMPParticipant*)part;
}
示例11: BOOST_LOG_TRIVIAL
void Battle::step_participant(Participant& participant) {
if (!participant.can_move())
return;
BOOST_LOG_TRIVIAL(trace) << "Participant " << participant;
make_move(participant);
}
示例12: GetParticipant
Participant *MultiConf::GetParticipant(int partId,Participant::Type type)
{
//Find participant
Participant *part = GetParticipant(partId);
//If no participant
if (!part)
//Exit
return NULL;
//Ensure it is from the correct type
if (part->GetType()!=type)
//Error
return (Participant *)Error("Participant is not of desired type");
//Return it
return part;
}
示例13: removeFromConference
void QtChatRoomInviteDlg::removeFromConference()
{
QList<QListWidgetItem *>selectList = _inviteListWidget->selectedItems();
QList<QListWidgetItem *>::iterator it;
for (it= selectList.begin(); it!= selectList.end(); it++ )
{
QtChatRoomListWidgetItem* item = dynamic_cast<QtChatRoomListWidgetItem *>((*it));
Participant p = item->getParticipant();
if ( !p.isAlreadyInChat() )
{
_candidates.setInvitedToChat( p, false );
}
}
updateListCtrls();
}
示例14: Participant
void ParticipantTest::testPayer()
{
int somme = 120;
Participant* crediteur = new Participant();
CPPUNIT_ASSERT(_participant->SommeBillets() == 0);
BilletManager* billetManager = new BilletManager();
billetManager->Ajouter(1, BILLET1);
billetManager->Ajouter(1, BILLET5);
billetManager->Ajouter(1, BILLET10);
billetManager->Ajouter(1, BILLET20);
billetManager->Ajouter(1, BILLET50);
billetManager->Ajouter(1, BILLET100);
billetManager->Ajouter(1, BILLET500);
_participant->Crediter(billetManager);
BilletManager* result = _participant->Payer(somme);
crediteur->Crediter(result);
CPPUNIT_ASSERT(crediteur->SommeBillets() == somme);
}
示例15: Disponibility
Participant* DialogCreateParticipant::GetGeneratedParticipant()
{
QGeoAddress adresse;
adresse.setCity(this->ui->liVille->text());
adresse.setStreet(this->ui->liRue->text() + this->ui->liComplement->text());
adresse.setPostalCode(this->ui->liCP->text());
Disponibility * dispoParticipant = new Disponibility(
adresse,
this->ui->timeEditStart->time(),
this->ui->timeEditEnd->time());
Participant *participant = new Participant(
this->ui->leFirstName->text(),
this->ui->leLastName->text(),
this->ui->checkBox->isChecked() ? this->ui->spinBox->value() : 0);
participant->AddDisponnibility(dispoParticipant);
return participant;
}