Example #1
0
        public ObjectReferenceTable(Database.Schema schema, SnapshotObjectDataFormatter formatter, CachedSnapshot snapshot, ManagedData crawledData, ObjectData obj, ObjectMetaType metaType)
            : base(schema, formatter, snapshot, crawledData, metaType)
        {
            m_Object     = obj;
            m_References = ObjectConnection.GetAllObjectConnectingTo(snapshot, obj);
#if DEBUG_VALIDATION
            int toUnifiedIndex = m_Object.GetUnifiedObjectIndex(snapshot);
            var toManagedIndex = snapshot.UnifiedObjectIndexToManagedObjectIndex(toUnifiedIndex);

            for (int k = 0; k != m_References.Length; ++k)
            {
                var oFrom = m_References[k];

                switch (oFrom.dataType)
                {
                case ObjectDataType.ReferenceArray:
                case ObjectDataType.ReferenceObject:
                case ObjectDataType.Value:
                    if (oFrom.m_Parent != null)
                    {
                        oFrom = oFrom.m_Parent.obj;
                    }
                    break;
                }

                bool connectionFound = false;
                switch (oFrom.dataType)
                {
                case ObjectDataType.Global:
                {
                    if (snapshot.HasGlobalConnection(toManagedIndex))
                    {
                        connectionFound = true;
                    }
                }
                break;

                case ObjectDataType.Type:
                {
                    if (snapshot.HasManagedTypeConnection(oFrom.managedTypeIndex, toManagedIndex))
                    {
                        connectionFound = true;
                    }
                }
                break;

                case ObjectDataType.Array:
                case ObjectDataType.BoxedValue:
                case ObjectDataType.Object:
                {
                    if (snapshot.HasObjectConnection(oFrom.GetUnifiedObjectIndex(snapshot), toUnifiedIndex))
                    {
                        connectionFound = true;
                        break;
                    }
                }
                break;

                case ObjectDataType.NativeObject:
                {
                    if (snapshot.HasObjectConnection(oFrom.GetUnifiedObjectIndex(snapshot), toUnifiedIndex))
                    {
                        connectionFound = true;
                        break;
                    }
                }
                break;
                }
                if (!connectionFound)
                {
                    UnityEngine.Debug.LogError("Connection not found, index =" + k);
                }
            }
#endif
            InitObjectList();
        }
Example #2
0
 public Table(Schema schema)
 {
     this.Schema = schema;
 }