本文整理汇总了C++中getSource函数的典型用法代码示例。如果您正苦于以下问题:C++ getSource函数的具体用法?C++ getSource怎么用?C++ getSource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSource函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateOnlineStatus
void HostileReference::addThreat(float fModThreat)
{
iThreat += fModThreat;
// the threat is changed. Source and target unit have to be available
// if the link was cut before relink it again
if (!isOnline())
updateOnlineStatus();
if (fModThreat != 0.0f)
{
ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, fModThreat);
fireStatusChanged(event);
}
if (isValid() && fModThreat >= 0.0f)
{
Unit* victim_owner = getTarget()->GetCharmerOrOwner();
if (victim_owner && victim_owner->isAlive())
getSource()->addThreat(victim_owner, 0.0f); // create a threat to the owner of a pet, if the pet attacks
}
}
示例2: throw
void OpenALRenderableSource::attachALBuffers()
throw(Exception)
{
if (!alBuffersAttached) {
SharedPtr<Sound> sound = getSource()->getSound();
if (!sound->isLoaded())
sound->load();
assert(!sound->isStreaming() && "OpenALRenderableSource can only handle streaming sounds");
// Attachment to a simple sound, just assign the AL buffer to this AL source
ALBufferHandle alBuffer = dynamic_cast<OpenALSimpleSound*>(sound.get())->getAlBuffer();
ALSourceHandle alSource = getALSource();
alSourcei(alSource, AL_BUFFER, alBuffer);
alBuffersAttached = true;
checkAlError();
}
}
示例3: getPath
/* getPath */
void getPath(ListRef L, GraphRef G, int u){
int w;
makeEmpty(L);
if(getSource(G) == 0){
printf("Graph Error: calling getPath() on graph without running BFS \n");
exit(1);
}
if(G->color[u] == 1){
return;
}
else{
insertFront(L, u);
w = u;
while(G->distance[w] > 0){
insertFront(L, G->parent[w]);
w = G->parent[w];
}
}
}
示例4: source_group
bool SourceHDF5::deleteSource(const string &name_or_id) {
boost::optional<H5Group> g = source_group();
bool deleted = false;
if(g) {
// call deleteSource on sources to trigger recursive call to all sub-sources
if (hasSource(name_or_id)) {
// get instance of source about to get deleted
Source source = getSource(name_or_id);
// loop through all child sources and call deleteSource on them
for(auto &child : source.sources()) {
source.deleteSource(child.id());
}
// if hasSource is true then source_group always exists
deleted = g->removeAllLinks(source.name());
}
}
return deleted;
}
示例5: VlcStream
OutputVlcStream::OutputVlcStream(Encre<libvlc_instance_t>* encre) : VlcStream(encre), m_videoSource(""), m_soundSource("")
{
std::string media;
bool sound = false;
if (!getSource() || (m_videoSource == "" && m_soundSource == ""))
throw "exception to catch in the instance of encre"; //TODO : a better exception
if (m_videoSource != "" && m_soundSource == "")
media = m_videoSource;
else if (m_videoSource == "" && m_soundSource != "")
media = m_soundSource;
else
{
media = m_videoSource;
sound = true;
}
m_media = libvlc_media_new_location(m_encre->getData(), media.c_str());
if (sound)
setOptions(m_soundSource);
}
示例6: qt_static_metacall
int ODataObjectModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 18)
qt_static_metacall(this, _c, _id, _a);
_id -= 18;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = getSource(); break;
case 1: *reinterpret_cast< QVariant*>(_v) = getModel(); break;
}
_id -= 2;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setSource(*reinterpret_cast< QString*>(_v)); break;
case 1: setModel(*reinterpret_cast< QVariant*>(_v)); break;
}
_id -= 2;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
示例7: main
int main(int argc, char* argv[]){
if( argc != 2 ){
printf("Usage: %s output\n", argv[0]);
exit(1);
}
FILE *out;
out = fopen(argv[1], "w");
GraphRef G = newGraph(10);
ListRef path = newList();
int i;
for( i = 1; i<= 9; i++){
addEdge(G, i, i+1);
}
printGraph(out, G);
BFS(G, 1);
fprintf(out, "Source of G is %d\n", getSource(G));
fprintf(out, "Order of G is %d\n", getOrder(G));
fprintf(out, "BFS called on Graph G with 1 as the source\n");
getPath(path, G, 10);
fprintf(out, "The path from 1 to 10 is:");
printList(out, path);
fprintf(out, "Parent of 10: %d\n", getParent(G, 10));
fprintf(out, "Parent of 2: %d\n", getParent(G, 2));
int dist = getDist(G, 1);
fprintf(out, "Distance from 1 to 1 is %d\n", dist);
fprintf(out, "Distance from 1 to 7 is %d\n", getDist(G, 7));
freeList(&path);
fclose(out);
return(0);
}
示例8: getName
DECLARE_EXPORT void Skill::writeElement(XMLOutput *o, const Keyword& tag, mode m) const
{
// Write a reference
if (m == REFERENCE)
{
o->writeElement(tag, Tags::tag_name, getName());
return;
}
// Write the head
if (m != NOHEAD && m != NOHEADTAIL)
o->BeginObject(tag, Tags::tag_name, XMLEscape(getName()));
// Write source field
o->writeElement(Tags::tag_source, getSource());
// Write the custom fields
PythonDictionary::write(o, getDict());
// Write the tail
if (m != NOHEADTAIL && m != NOTAIL) o->EndObject(tag);
}
示例9: parameters
void Style::recalculate(float z) {
for (const auto& source : sources) {
source->enabled = false;
}
zoomHistory.update(z, data.getAnimationTime());
StyleCalculationParameters parameters(z,
data.getAnimationTime(),
zoomHistory,
data.getDefaultFadeDuration());
for (const auto& layer : layers) {
hasPendingTransitions |= layer->recalculate(parameters);
Source* source = getSource(layer->source);
if (source && layer->needsRendering()) {
source->enabled = true;
if (!source->loaded && !source->isLoading()) source->load();
}
}
}
示例10: getFrameID
*/
void TransferRequest::print( ATP_TransferRequest_t * frame ){
Log.Debug("TransferRequest object:"CR);
if ( getFrameType(frame) == ATP_TRANSFER_REQUEST ) Log.Debug("type: ATP_TRANSFER_REQUEST"CR );
if ( getFrameType(frame) == ATP_CHUNK_REQUEST ) Log.Debug( "type: ATP_CHUNK_REQUEST"CR );
if ( getFrameType(frame) == ATP_CHUNK_RESPONSE ) Log.Debug("type: ATP_CHUNK_RESPONSE"CR );
Log.Debug("frameID: %s"CR, getFrameID(frame));
Log.Debug("frameType: %d"CR, getFrameType(frame));
Log.Debug("meshAddress: %l"CR, getMeshAddress(frame));
Log.Debug("datetime: %l"CR, getDatetime(frame));
Log.Debug("atpID: %l"CR, getAtpID(frame));
Log.Debug("version: %d"CR, getVersion(frame));
Log.Debug("topchunk: %d"CR, getTopChunk(frame));
Log.Debug("chunkcount: %d"CR, getChunkCount(frame));
if ( getStatus(frame) == ATP_IDLE ) Log.Debug( "status: ATP_IDLE"CR );
if ( getStatus(frame) == ATP_SUCCESS ) Log.Debug( "status: ATP_SUCCESS"CR );
if ( getStatus(frame) == ATP_FAILED_DURING_TRANSIT ) Log.Debug("status: ATP_FAILED_DURING_TRANSIT"CR );
if ( getStatus(frame) == ATP_FAILED_CHECKSUM ) Log.Debug( "status: ATP_FAILED_CHECKSUM"CR );
if ( getStatus(frame) == ATP_FAILED_ENCRYPTION ) Log.Debug( "status: ATP_FAILED_ENCRYPTION"CR );
if ( getStatus(frame) == ATP_FAILED_COMPRESSION ) Log.Debug("status: ATP_FAILED_COMPRESSION"CR );
if ( getStatus(frame) == ATP_UNSENT ) Log.Debug( "status: ATP_UNSENT"CR );
if ( getStatus(frame) == ATP_SENT ) Log.Debug( "status: ATP_SENT"CR );
if ( getStatus(frame) == ATP_RECEIVED ) Log.Debug( "status: ATP_RECEIVED"CR );
if ( getStatus(frame) == ATP_WORKING ) Log.Debug( "status: ATP_WORKING"CR );
Log.Debug("size: %l"CR, getSize(frame));
Log.Debug("expires: %l"CR, getExpires(frame));
Log.Debug("descriptor: %s"CR, getDescriptor(frame));
Log.Debug("source: %l"CR, getSource(frame));
Log.Debug("destination: %l"CR, getDestination(frame));
Log.Debug("fileName: %s"CR, getFileName(frame));
if ( getBuffer(frame) != 0 ){
Log.Debug("buffer: %s"CR, getBuffer(frame));
}
示例11: lock
void Style::recalculate(float z, TimePoint now) {
uv::writelock lock(mtx);
for (const auto& source : sources) {
source->enabled = false;
}
zoomHistory.update(z, now);
for (const auto& layer : layers) {
layer->updateProperties(z, now, zoomHistory);
if (!layer->bucket) {
continue;
}
util::ptr<Source> source = getSource(layer->bucket->source);
if (!source) {
continue;
}
source->enabled = true;
}
}
示例12: fieldsEqual
bool
Message::operator==(const Message& other) const
{
if (getId() != other.getId())
return false;
if (getTimeStamp() != other.getTimeStamp())
return false;
if (getSource() != other.getSource())
return false;
if (getSourceEntity() != other.getSourceEntity())
return false;
if (getDestination() != other.getDestination())
return false;
if (getDestinationEntity() != other.getDestinationEntity())
return false;
return fieldsEqual(other);
}
示例13: lock
void Style::recalculate(float z) {
uv::writelock lock(mtx);
for (const auto& source : sources) {
source->enabled = false;
}
zoomHistory.update(z, data.getAnimationTime());
for (const auto& layer : layers) {
layer->updateProperties(z, data.getAnimationTime(), zoomHistory);
if (!layer->bucket) {
continue;
}
Source* source = getSource(layer->bucket->source);
if (!source) {
continue;
}
source->enabled = true;
}
}
示例14: link
void HostileReference::updateOnlineStatus()
{
bool online = false;
bool accessible = false;
if (!isValid())
{
if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()))
{
link(target, getSource());
}
}
// only check for online status if
// ref is valid
// target is no player or not gamemaster
// target is not in flight
if (isValid() &&
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
!getTarget()->IsTaxiFlying()))
{
Creature* creature = (Creature*) getSourceUnit();
online = getTarget()->isInAccessablePlaceFor(creature);
if (!online)
{
if (creature->AI()->canReachByRangeAttack(getTarget()))
{
online = true; // not accessable but stays online
}
}
else
{
accessible = true;
}
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
}
示例15: InformationMessage
void SoundEmitter::changeParentSource()
{
InformationMessage("Sound", "SoundEmitter::changeParent : enter") ;
Model::SoundEnvironnement* env = getObject()->getParent<Model::SoundEnvironnement>() ;
if (env)
{
SoundEnvironnement* envView = env->getView<SoundEnvironnement>(m_viewpoint) ;
if (envView)
{
ALuint auxEffectSlot = envView->getAuxEffectSlot() ;
//SoundEnvironnement has changed
if (auxEffectSlot != m_auxEffectSlot)
{
m_auxEffectSlot = auxEffectSlot;
// @todo see filter parameter for occlusion , exclusion case
EFX::applyEffectToSource(getSource(), m_auxEffectSlot) ;
InformationMessage("Sound", "update add reverb") ;
}
else
{
InformationMessage("Sound", "same reverb") ;
}
}
else
{
InformationMessage("Sound", "no envView") ;
}
}
else
{
InformationMessage("Sound", "no environment") ;
}
InformationMessage("Sound", "SoundEmitter::changeParent : leaving") ;
}