本文整理汇总了C++中GetSource函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSource函数的具体用法?C++ GetSource怎么用?C++ GetSource使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSource函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetReferenceCount
int mitk::BaseData::GetExternalReferenceCount() const
{
if(m_CalculatingExternalReferenceCount==false) //this is only needed because a smart-pointer to m_Outputs (private!!) must be created by calling GetOutputs.
{
m_CalculatingExternalReferenceCount = true;
m_ExternalReferenceCount = -1;
int realReferenceCount = GetReferenceCount();
if(GetSource().IsNull())
{
m_ExternalReferenceCount = realReferenceCount;
m_CalculatingExternalReferenceCount = false;
return m_ExternalReferenceCount;
}
mitk::BaseProcess::DataObjectPointerArray outputs = m_SmartSourcePointer->GetOutputs();
unsigned int idx;
for (idx = 0; idx < outputs.size(); ++idx)
{
//references of outputs that are not referenced from someone else (reference additional to the reference from this BaseProcess object) are interpreted as non-existent
if(outputs[idx]==this)
--realReferenceCount;
}
m_ExternalReferenceCount = realReferenceCount;
if(m_ExternalReferenceCount<0)
m_ExternalReferenceCount=0;
m_CalculatingExternalReferenceCount = false;
}
else
return -1;
return m_ExternalReferenceCount;
}
示例2: sizeof
DataItem& DataItem::CreateAndInsert(ItemPointer ptr)
{
auto x = RawItem::Get<Header>(ptr);
auto& ret = x.ritem.SplitCreate<DataItem>(
ptr.offset, x.t, x.ritem.GetSize() - ptr.offset - sizeof(Header));
if (x.t.length > 0)
ret.MoveNextToChild(x.t.length);
NEPTOOLS_ASSERT(ret.GetSize() == sizeof(Header) + x.t.length);
// hack
if (!ret.GetChildren().empty())
{
auto child = dynamic_cast<RawItem*>(&ret.GetChildren().front());
if (child && child->GetSize() > sizeof(Gbnl::Header))
{
char buf[4];
child->GetSource().Pread(child->GetSize() - sizeof(Gbnl::Header), buf, 4);
if (memcmp(buf, "GBNL", 4) == 0)
GbnlItem::CreateAndInsert({child, 0});
}
}
return ret;
}
示例3: Stop
void LoopingSound::InternalUpdate() {
if (fadingOut and GetCurrentGain() == 0.0f) {
Stop();
}
if (not fadingOut) {
if (leadingSample) {
if (GetSource().IsStopped()) {
SetupLoopingSound(GetSource());
GetSource().Play();
leadingSample = nullptr;
}
}
SetSoundGain(effectsVolume.Get());
}
}
示例4: link
void HostileReference::updateOnlineStatus()
{
bool online = 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 || !getTarget()->ToPlayer()->IsGameMaster())
&& !getTarget()->IsInFlight()
&& getTarget()->IsInMap(GetSourceUnit())
&& getTarget()->InSamePhase(GetSourceUnit())
)
{
Creature* creature = GetSourceUnit()->ToCreature();
online = getTarget()->isInAccessiblePlaceFor(creature);
if (!online)
{
if (creature->IsWithinCombatRange(getTarget(), creature->m_CombatDistance))
online = true; // not accessible but stays online
}
}
setOnlineOfflineState(online);
}
示例5: GetScriptContext
void RegexPattern::Finalize(bool isShutdown)
{
if(isShutdown)
return;
const auto scriptContext = GetScriptContext();
if(!scriptContext)
return;
#if DBG
if(!isLiteral && !scriptContext->IsClosed())
{
const auto source = GetSource();
RegexPattern *p;
Assert(
!GetScriptContext()->GetDynamicRegexMap()->TryGetValue(
RegexKey(source.GetBuffer(), source.GetLength(), GetFlags()),
&p) ||
p != this);
}
#endif
if(isShallowClone)
return;
rep.unified.program->FreeBody(scriptContext->RegexAllocator());
}
示例6: InternalUpdate
void OneShotSound::InternalUpdate() {
if (GetSource().IsStopped()) {
Stop();
return;
}
SetSoundGain(effectsVolume.Get());
}
示例7: Rect
Rect
Image::GetCoverageBounds ()
{
// FIXME: SL3 final only supports PixelFormatPbgra32 which makes this optimization
// obsolete - unless we keep an "has_alpha" flag with each image ?!?
return Rect ();
#if FALSE
ImageSource *source = GetSource ();
if (!source || source->GetPixelFormat () == PixelFormatPbgra32)
return Rect ();
Stretch stretch = GetStretch ();
if (stretch == StretchFill || stretch == StretchUniformToFill)
return bounds;
cairo_matrix_t matrix;
Rect image = Rect (0, 0, source->GetPixelWidth (), source->GetPixelHeight ());
Rect paint = Rect (0, 0, GetActualWidth (), GetActualHeight ());
image_brush_compute_pattern_matrix (&matrix,
paint.width, paint.height,
image.width, image.height, stretch,
AlignmentXCenter, AlignmentYCenter, NULL, NULL);
cairo_matrix_invert (&matrix);
cairo_matrix_multiply (&matrix, &matrix, &absolute_xform);
image = image.Transform (&matrix);
image = image.Intersection (bounds);
return image;
#endif
}
示例8: GetDownloaderPolicy
void
MediaBase::SetAllowDownloads (bool allow)
{
const char *uri;
Downloader *dl;
if ((allow_downloads && allow) || (!allow_downloads && !allow))
return;
if (allow && IsAttached () && source_changed) {
source_changed = false;
if ((uri = GetSource ()) && *uri) {
if (!(dl = GetDeployment ()->CreateDownloader ())) {
// we're shutting down
return;
}
dl->Open ("GET", uri, GetDownloaderPolicy (uri));
SetSource (dl, "");
dl->unref ();
}
}
allow_downloads = allow;
}
示例9: GetSource
void
Image::ImageFailed (ImageErrorEventArgs *args)
{
BitmapSource *source = (BitmapSource*) GetSource ();
if (source->Is (Type::BITMAPIMAGE)) {
source->RemoveHandler (BitmapImage::DownloadProgressEvent, download_progress, this);
source->RemoveHandler (BitmapImage::ImageOpenedEvent, image_opened, this);
source->RemoveHandler (BitmapImage::ImageFailedEvent, image_failed, this);
}
source->RemoveHandler (BitmapSource::PixelDataChangedEvent, source_pixel_data_changed, this);
InvalidateArrange ();
InvalidateMeasure ();
UpdateBounds ();
Invalidate ();
args = new ImageErrorEventArgs (this, *(MoonError*)args->GetMoonError ());
if (HasHandlers (ImageFailedEvent)) {
Emit (ImageFailedEvent, args);
} else {
GetDeployment ()->GetSurface ()->EmitError (args);
}
}
示例10: xsNew
/**
* \brief Returns the source.
*
* \return The source as CString.
*/
CString CBibList::GetSource()
{
xString* src = xsNew();
GetSource(src);
CString res = CString(xsValue(src));
xsDelete(src);
return res;
}
示例11: EnumImageProperties
virtual std::vector<unsigned int> EnumImageProperties() const override
{
cdHSource hSource = GetSource();
ImagePropertyAccess p(hSource);
return p.EnumImageProperties();
}
示例12: GetSource
/* virtual */ NS_IMETHODIMP
TVSourceListener::NotifyChannelScanStopped(const nsAString& aTunerId,
const nsAString& aSourceType)
{
RefPtr<TVSource> source = GetSource(aTunerId, aSourceType);
source->NotifyChannelScanStopped();
return NS_OK;
}
示例13: I_SoundIsPlaying
int I_SoundIsPlaying(int handle)
{
sndsource_t *src = GetSource(handle);
if(!initOk || !src) return false;
if(src->source == NULL) return false;
return I2_IsSourcePlaying(src);
}
示例14: GetSource
//------------------------------------------------------------------------------
bool CBOMRecognizerFilter::Read( unsigned long& ulUnitsRead, unsigned long ulUnitsToRead )
{
bool bResult = false;
//Switch on whether recognition has taken place
if( m_bRecognized )
{
bResult = GetSource()->Read( ulUnitsRead, ulUnitsToRead );
}
else
{
bResult = GetSource()->Read( ulUnitsRead, sculBOMBytes );
RecognizeBOM();
}
return bResult;
}
示例15: xsNew
void CField::SaveToFile(CFile *file)
{
if (!m_Value.IsEmpty()) {
xString* str = xsNew();
GetSource(str);
file->Write(xsValue(str), xsLen(str));
xsDelete(str);
}
}