Example #1
0
void DryadSubGraphVertex::Initialize(UInt32 numberOfInputChannels,
                                     UInt32 numberOfOutputChannels)
{
    DrError err;

    DryadMetaData* metaData = GetMetaData();

    if (metaData == NULL)
    {
        ReportError(DryadError_VertexInitialization,
                    "No MetaData In Start Command");
        return;
    }

    DryadMetaDataRef graphData;
    err = metaData->LookUpMetaData(DryadTag_GraphDescription, &graphData);
    if (err != DrError_OK)
    {
        ReportError(DryadError_VertexInitialization,
                    "No GraphDescription Tag");
        return;
    }

    ReadVertices(graphData);

    if (NoError() == false)
    {
        return;
    }

    ReadEdges(graphData);
}
Example #2
0
void avtGraviTFilter::LoadBoundingBoxes(int & numBoundingBox, double ** lower, double ** upper)
{
    avtIntervalTree * tree = GetMetaData()->GetSpatialExtents();
    numBoundingBox = tree->GetNLeaves();

    *lower = new double[numBoundingBox * 3];
    *upper = new double[numBoundingBox * 3];

    double * lowerPtr = *lower;
    double * upperPtr = *upper;

    for (int i = 0; i < numBoundingBox; i++)
    {
        double bBox[6];
        tree->GetLeafExtents(i, bBox);

        lowerPtr[0] = bBox[0];
        lowerPtr[1] = bBox[2];
        lowerPtr[2] = bBox[4];

        upperPtr[0] = bBox[1];
        upperPtr[1] = bBox[3];
        upperPtr[2] = bBox[5];

        lowerPtr += 3;
        upperPtr += 3;
    }
}
void FProfilerSession::UpdateAggregatedStats( const uint32 FrameIndex )
{
	static FTotalTimeAndCount TimeAndCount( 0.0f, 0 );
	PROFILER_SCOPE_LOG_TIME( TEXT( "2 FProfilerSession::UpdateAggregatedStats" ), &TimeAndCount );

	const FIntPoint& IndicesForFrame = DataProvider->GetSamplesIndicesForFrame( FrameIndex );
	const uint32 SampleStartIndex = IndicesForFrame.X;
	const uint32 SampleEndIndex = IndicesForFrame.Y;

	const FProfilerSampleArray& Collection = DataProvider->GetCollection();

	for( uint32 SampleIndex = SampleStartIndex; SampleIndex < SampleEndIndex; SampleIndex++ )
	{
		const FProfilerSample& ProfilerSample = Collection[ SampleIndex ];
		
		const uint32 StatID = ProfilerSample.StatID();
		FProfilerAggregatedStat* AggregatedStat = AggregatedStats.Find( StatID );
		if( !AggregatedStat )
		{
			const FProfilerStat& ProfilerStat = GetMetaData()->GetStatByID( StatID );
			AggregatedStat = &AggregatedStats.Add( ProfilerSample.StatID(), FProfilerAggregatedStat( ProfilerStat.Name(), ProfilerStat.OwningGroup().Name(), ProfilerSample.Type() ) );
		}
		(*AggregatedStat) += ProfilerSample;
	}

	for( auto It = AggregatedStats.CreateIterator(); It; ++It )
	{
		FProfilerAggregatedStat& AggregatedStat = It.Value();
		AggregatedStat.Advance();
	}

	// @TODO: Create map for stats TMap<uint32, TArray<uint32> >; StatID -> Sample indices for faster lookup in data providers
}
 virtual void AddDetails(mozilla::dom::ProfileTimelineMarker& aMarker) override
 {
   if (GetMetaData() == TRACING_INTERVAL_START) {
     aMarker.mType.Construct(GetCause());
     aMarker.mEventPhase.Construct(mPhase);
   }
 }
Example #5
0
char const*  CMyContextBase::GetTypeString(void)const
{
	if (GetMetaData()->GetTaskDef()->GetDefaultLanguage() == 0)
		return GetBaseInfo()->EngTypeString;
	else
		return GetBaseInfo()->RusTypeString;
}
Example #6
0
int main(int argc,char* argv[])
{
DWORD dwEntryPoint,dwSize;
void *Data;
hPLUGININSTANCE hInsts;
StartUpProc StartUp;

	printf("\nPrague module loader ver 0.1\n");
	if(argc<2)
	{
		printf(Usage);
		return 1;
	}

	hInsts = LoadPlugin(argv[1], &dwEntryPoint);
	if(hInsts)
	{
		printf("Load Plugin OK\n");
		StartUp=(StartUpProc)dwEntryPoint;
//		StartUp();
	}
	else
		printf("Load Plugin Failed\n");

	if(errOK==GetMetaData(argv[1], &Data,&dwSize))
		printf("GetMetaData OK\n");
	else
		printf("GetMetaData Failed\n");
	UnloadPlugin(hInsts);
	return 0;
}
Example #7
0
 virtual void AddDetails(JSContext* aCx,
                         mozilla::dom::ProfileTimelineMarker& aMarker) override
 {
   if (GetMetaData() == TRACING_INTERVAL_START) {
     aMarker.mRestyleHint.Construct(mRestyleHint);
   }
 }
Example #8
0
void
ProfilerMarkerTracing::StreamPayload(SpliceableJSONWriter& aWriter,
                                     UniqueStacks& aUniqueStacks)
{
  streamCommonProps("tracing", aWriter, aUniqueStacks);

  if (GetCategory()) {
    aWriter.StringProperty("category", GetCategory());
  }
  if (GetMetaData() != TRACING_DEFAULT) {
    if (GetMetaData() == TRACING_INTERVAL_START) {
      aWriter.StringProperty("interval", "start");
    } else if (GetMetaData() == TRACING_INTERVAL_END) {
      aWriter.StringProperty("interval", "end");
    }
  }
}
void FProfilerSession::PopulateHierarchy_Recurrent
( 
	const FProfilerCycleGraph& ParentGraph, 
	const double ParentStartTimeMS, 
	const double ParentDurationMS,
	const uint32 ParentSampleIndex 
)
{
	const FProfilerStatMetaDataRef MetaData = GetMetaData();
	const uint32& ThreadID = MetaData->ThreadIDtoStatID.FindChecked( ParentGraph.ThreadId );

	const uint32 SampleIndex = DataProvider->AddHierarchicalSample
	( 
		ThreadID, 
		MetaData->GetStatByID(ParentGraph.StatId).OwningGroup().ID(), 
		ParentGraph.StatId, 
		ParentStartTimeMS, ParentDurationMS, 
		ParentGraph.CallsPerFrame, 
		ParentSampleIndex 
	);

	double ChildStartTimeMS = ParentStartTimeMS;
	double ChildrenDurationMS = 0.0f;

	for( int32 DataIndex = 0; DataIndex < ParentGraph.Children.Num(); DataIndex++ )
	{
		const FProfilerCycleGraph& ChildCyclesCounter = ParentGraph.Children[DataIndex];
		const double ChildDurationMS = MetaData->ConvertCyclesToMS( ChildCyclesCounter.Value );

		if (ChildDurationMS > 0.0)
		{
			PopulateHierarchy_Recurrent( ChildCyclesCounter, ChildStartTimeMS, ChildDurationMS, SampleIndex );
		}
		ChildStartTimeMS += ChildDurationMS;
		ChildrenDurationMS += ChildDurationMS;
	}

	const double SelfTimeMS = ParentDurationMS - ChildrenDurationMS;
	if( SelfTimeMS > 0.0f && ParentGraph.Children.Num() > 0 )
	{
		const FName& ParentStatName = MetaData->GetStatByID( ParentGraph.StatId ).Name();
		const FName& ParentGroupName = MetaData->GetStatByID( ParentGraph.StatId ).OwningGroup().Name();

		// Create a fake stat that represents this profiler sample's exclusive time.
		// This is required if we want to create correct combined event graphs later.
		DataProvider->AddHierarchicalSample
		(
			ThreadID,
			MetaData->GetStatByID(0).OwningGroup().ID(),
			0, // @see FProfilerStatMetaData.Update, 0 means "Self"
			ChildStartTimeMS, 
			SelfTimeMS,
			1,
			SampleIndex
		);
	}
}
Example #10
0
void
ProfilerMarkerTracing::streamPayloadImp(JSStreamWriter& b)
{
  b.BeginObject();
    streamCommonProps("tracing", b);

    if (GetCategory()) {
      b.NameValue("category", GetCategory());
    }
    if (GetMetaData() != TRACING_DEFAULT) {
      if (GetMetaData() == TRACING_INTERVAL_START) {
        b.NameValue("interval", "start");
      } else if (GetMetaData() == TRACING_INTERVAL_END) {
        b.NameValue("interval", "end");
      }
    }
  b.EndObject();
}
Example #11
0
void CIFXMetaData::DeleteAllSubattributes(U32 uIndex)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	tmpMD->Subattributes.Clear();
}
Example #12
0
void CIFXMetaData::GetSubattributesCountX(U32 uIndex, U32& rCountSubattributes)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	rCountSubattributes = tmpMD->Subattributes.GetNumberElements();
}
Example #13
0
void CIFXMetaData::SetPersistenceX(U32 uIndex, BOOL value)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);

	tmpMD->Persistence = value;
}
Example #14
0
const char*
AVFormatReader::Copyright()
{
	if (fCopyright.Length() <= 0) {
		BMessage message;
		if (GetMetaData(&message) == B_OK)
			message.FindString("copyright", &fCopyright);
	}
	return fCopyright.String();
}
Example #15
0
void CIFXMetaData::SetAttributeX(U32 uIndex, const IFXMetaDataAttribute& rAttribute)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);

	tmpMD->Attribute = rAttribute;
}
Example #16
0
void CIFXMetaData::GetKeyX(U32 uIndex, IFXString& rOutKey)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);
	
	rOutKey = tmpMD->Key;
}
Example #17
0
typename Builder::Object
ProfilerMarkerTracing::preparePayloadImp(Builder& b)
{
  typename Builder::RootedObject data(b.context(), b.CreateObject());
  prepareCommonProps("tracing", b, data);

  if (GetCategory()) {
    b.DefineProperty(data, "category", GetCategory());
  }
  if (GetMetaData() != TRACING_DEFAULT) {
    if (GetMetaData() == TRACING_INTERVAL_START) {
      b.DefineProperty(data, "interval", "start");
    } else if (GetMetaData() == TRACING_INTERVAL_END) {
      b.DefineProperty(data, "interval", "end");
    }
  }

  return data;
}
Example #18
0
void CIFXMetaData::GetSubattributeNameX(U32 uIndex, U32 uSubattributeIndex, IFXString& rSubattributeName)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT( uSubattributeIndex < tmpMD->Subattributes.GetNumberElements(), IFX_E_OUT_OF_METADATA );

	rSubattributeName = tmpMD->Subattributes.GetElement(uSubattributeIndex).Name;
}
Example #19
0
void CIFXMetaData::DeleteSubattributeX(U32 uIndex, U32 uSubattributeIndex)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT( uSubattributeIndex < tmpMD->Subattributes.GetNumberElements(), IFX_E_OUT_OF_METADATA );

	tmpMD->Subattributes.DeleteElement(uSubattributeIndex);
}
Example #20
0
void CIFXMetaData::GetStringX(U32 uIndex, IFXString& rValue)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT(
		(tmpMD->Attribute & IFXMETADATAATTRIBUTE_BINARY) == 0,
		IFX_E_NO_STRING_METADATA);

	rValue = (IFXString*)tmpMD->pBuffer;
}
Example #21
0
void CIFXMetaData::GetBinaryX(U32 uIndex, U8* pDataBuffer)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT(
		tmpMD->Attribute & IFXMETADATAATTRIBUTE_BINARY,
		IFX_E_NO_BINARY_METADATA );

	memcpy(pDataBuffer, tmpMD->pBuffer, tmpMD->Size);
}
Example #22
0
void CIFXMetaData::GetBinarySizeX(U32 uIndex, U32& rSize)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD;
	tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT(
		tmpMD->Attribute & IFXMETADATAATTRIBUTE_BINARY,
		IFX_E_NO_BINARY_METADATA );

	rSize = tmpMD->Size;
}
Example #23
0
void CIFXMetaData::GetSubattributeValueX(U32 uIndex, U32 uSubattributeIndex, IFXString*& pSubattributeValue)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );
	IFXCHECKX_RESULT( pSubattributeValue, IFX_E_INVALID_POINTER );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	IFXCHECKX_RESULT( uSubattributeIndex < tmpMD->Subattributes.GetNumberElements(), IFX_E_OUT_OF_METADATA );

	IFXMetaDataSubattribute& sa = tmpMD->Subattributes.GetElement(uSubattributeIndex);
	if (sa.NoValue)
		pSubattributeValue = NULL;
	else
		*pSubattributeValue = sa.Value;
}
Example #24
0
IFXRESULT CIFXMetaData::GetSubattributeIndex(U32 uIndex, const IFXString& rSubattributeName, U32& rSubattributeIndex)
{
	if (m_uMDCount == 0) return IFX_E_NO_METADATA;
	if (uIndex >= m_uMDCount) return IFX_E_OUT_OF_METADATA;

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	U32 l = tmpMD->Subattributes.GetNumberElements();
	U32 i;
	for ( i = 0; i < l; i++)
		if (tmpMD->Subattributes.GetElement(i).Name == rSubattributeName) {
			rSubattributeIndex = i;
			return IFX_OK;
		}

	return IFX_E_NO_METADATA;
}
Example #25
0
void CIFXMetaData::SetSubattributeValueX(U32 uIndex, const IFXString& rSubattributeName, const IFXString* pSubattributeValue)
{
	IFXCHECKX_RESULT( m_uMDCount != 0, IFX_E_NO_METADATA );
	IFXCHECKX_RESULT( uIndex < m_uMDCount, IFX_E_OUT_OF_METADATA );

	IFXMetaDataContainer* tmpMD = GetMetaData(uIndex);

	if (IsSubattributeExists(tmpMD->Subattributes, rSubattributeName)) {
		IFXMetaDataSubattribute* pSA = GetSubattribute(tmpMD->Subattributes, rSubattributeName);
		pSA->NoValue = (pSubattributeValue == NULL);
		pSA->Value = (pSubattributeValue == NULL) ? L"" : *pSubattributeValue;
	} else {
		IFXMetaDataSubattribute& sa = tmpMD->Subattributes.CreateNewElement();
		sa.Name = rSubattributeName;
		sa.NoValue = (pSubattributeValue == NULL);
		sa.Value = (pSubattributeValue == NULL) ? L"" : *pSubattributeValue;
	}
}
Example #26
0
wxString OTLResultSet::GetFieldAsString(int nField)
{
  ResultSetMetaData *metaData = GetMetaData();
  wxString Result;
  switch(metaData->GetColumnType(nField))
  {
  case ResultSetMetaData::COLUMN_INTEGER:
    {
      long lValue = GetResultLong(nField);
      Result = wxString::Format(wxT("%u"),lValue);
      break;
    }
  case ResultSetMetaData::COLUMN_DOUBLE:
    {
      double dValue = GetResultDouble(nField);
      Result = wxString::Format(wxT("%f"),dValue);
      break;
    }
  case ResultSetMetaData::COLUMN_DATE:
    {
      wxDateTime dateValue = GetResultDate(nField);
      if (dateValue.IsValid())
        Result = dateValue.Format();
      else
        Result = _("Invalid Date");
      break;
    }
  case ResultSetMetaData::COLUMN_STRING:
    {
      std::string strV;
      m_readIt.get(nField,strV);
      Result = ConvertFromUnicodeStream(strV.c_str());
      break;
    }
  default:
    Result = wxT("");
    break;
  }

  this->CloseMetaData(metaData);
  wxPrintf(_("Result as string: '%s'\n"), Result.c_str());
  return Result;
}
avtContract_p
avtLineoutFilter::ModifyContract(avtContract_p in_contract)
{
    avtContract_p rv;
    const char *opLineout = "operators/Lineout/";
    if (strncmp(pipelineVariable, opLineout, strlen(opLineout)) == 0)
    {
        const char *var = pipelineVariable + strlen(opLineout);
        avtDataRequest_p dr = new avtDataRequest(in_contract->GetDataRequest(), var);
        rv = new avtContract(in_contract, dr);
    }
    else
    {
        rv = new avtContract(in_contract);
    }

    useOriginalCells = false;
    if (!GetInput()->GetInfo().GetValidity().GetZonesPreserved())
    {
        rv->GetDataRequest()->TurnZoneNumbersOn();
        useOriginalCells = true;
        return rv;
    }

    //
    // Get the interval tree.
    //
    avtIntervalTree *it = GetMetaData()->GetSpatialExtents();
    if (it == NULL)
    {
        return rv;
    }

    double rayDir[3] = {point2[0]-point1[0], point2[1]-point1[1], 
                        point2[2]-point1[2]};   

    intVector domains;
    it->GetElementsList(point1, rayDir, domains);
    rv->GetDataRequest()->GetRestriction()->RestrictDomains(domains);

    return rv;
}
Example #28
0
avtContract_p
avtIsovolumeFilter::ModifyContract(avtContract_p in_spec)
{
    avtContract_p spec = new avtContract(in_spec);

    const char *varname = NULL;
    if (atts.GetVariable() != "default")
        varname = atts.GetVariable().c_str();
    else
        varname = in_spec->GetDataRequest()->GetVariable();

    //
    // We will need the ghost zones so that we can interpolate along domain
    // boundaries and get no cracks in our isosurface.
    //
    avtDataAttributes &in_atts = GetInput()->GetInfo().GetAttributes();
    bool skipGhost = false;
    if (in_atts.ValidVariable(varname) &&
        in_atts.GetCentering(varname) == AVT_NODECENT)
        skipGhost = true;
    if (!skipGhost)
        spec->GetDataRequest()->SetDesiredGhostDataType(GHOST_ZONE_DATA);

    std::string iso_var(atts.GetVariable());
    if (iso_var == "default")
        iso_var = in_spec->GetDataRequest()->GetVariable();

    avtIntervalTree *it = GetMetaData()->GetDataExtents(iso_var.c_str());
    if (it != NULL)
    {
        double min = atts.GetLbound();
        double max = atts.GetUbound();
        std::vector<int> dl;
        it->GetElementsListFromRange(&min, &max, dl);
        spec->GetDataRequest()->GetRestriction()->RestrictDomains(dl);
    }

    return spec;
}
Example #29
0
avtContract_p
avtTubeFilter::ModifyContract(avtContract_p c)
{
    avtContract_p spec = new avtContract(c);
    if (atts.GetScaleByVarFlag() == false &&
        atts.GetTubeRadiusType() == TubeAttributes::FractionOfBBox)
    {
        avtIntervalTree *it = GetMetaData()->GetSpatialExtents();
        if (it == NULL)
            spec->NoStreaming();
    }
    if (atts.GetScaleByVarFlag())
    { 
        std::string v = atts.GetScaleVariable();
        if (!v.empty() && v != "default")
        {
            avtDataRequest_p dataRequest = spec->GetDataRequest();
            dataRequest->AddSecondaryVariable(v.c_str());
        }
    }
        
    return spec;
}
Example #30
0
void
avtTubeFilter::PreExecute(void)
{
    if (atts.GetScaleByVarFlag() == true)
        return;
    if (atts.GetTubeRadiusType() == TubeAttributes::Absolute)
    {
        scaleFactor = atts.GetRadiusAbsolute();
    }
    else
    {
        int dim = GetInput()->GetInfo().GetAttributes().GetSpatialDimension();
        double bbox[6];
        avtIntervalTree *it = GetMetaData()->GetSpatialExtents();
        if (it != NULL)
            it->GetExtents(bbox);
        else
            GetSpatialExtents(bbox);

        int numReal = 0;
        double volume = 1.0;
        for (int i = 0 ; i < dim ; i++)
        {
            if (bbox[2*i] != bbox[2*i+1])
            {
                numReal++;
                volume *= (bbox[2*i+1]-bbox[2*i]);
            }
        }
        if (volume < 0)
            volume *= -1.;
        if (numReal > 0)
            scaleFactor = pow(volume, 1.0/numReal)*atts.GetRadiusFractionBBox();
        else
            scaleFactor = 1*atts.GetRadiusFractionBBox();
    }
}