Esempio n. 1
0
void wxMemStruct::Dump ()
{
  if (!ValidateNode()) return;

  if (m_isObject)
  {
    wxObject *obj = (wxObject *)m_actualData;

    wxString msg;
    if (m_fileName)
      msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);


    /* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it.
     * Instead, do what wxObject::Dump does.
     * What should we do long-term, eliminate Dumping? Or specify
     * that MyClass::Dump should use wxLogDebug? Ugh.
    obj->Dump(wxDebugContext::GetStream());
     */

    if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName())
      msg += obj->GetClassInfo()->GetClassName();
    else
      msg += wxT("unknown object class");

    wxString msg2;
    msg2.Printf(wxT(" at 0x%lX, size %d"), (long)GetActualData(), (int)RequestSize());
    msg += msg2;

    wxDebugContext::OutputDumpLine(msg.c_str());
  }
  else
  {
    wxString msg;
    if (m_fileName)
      msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum);

    wxString msg2;
    msg2.Printf(wxT("non-object data at 0x%lX, size %d"), (long)GetActualData(), (int)RequestSize() );
    msg += msg2;
    wxDebugContext::OutputDumpLine(msg.c_str());
  }
}
/** Performs standard validation on the graph (outputs point to inputs, no more than one connection to each input, types match on both ends, etc...) */
bool FGraphCompilerContext::ValidateGraphIsWellFormed(UEdGraph* Graph) const
{
	int32 SavedErrorCount = MessageLog.NumErrors;

	for (int32 NodeIndex = 0; NodeIndex < Graph->Nodes.Num(); ++NodeIndex)
	{
		const UEdGraphNode* Node = Graph->Nodes[NodeIndex];
		if( Node )
		{
			ValidateNode(Node);
		}
		else
		{
			// The graph has a gap in its Nodes array, probably due to a deprecated node class.  Remove the element.
			Graph->Nodes.RemoveAt(NodeIndex);
			NodeIndex--;
		}
	}

	return SavedErrorCount == MessageLog.NumErrors;
}