Example #1
0
 private ITypeHandler4 CorrectHandlerVersion(IDefragmentContext context, ITypeHandler4
                                             handler, ArrayInfo info)
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = ClassMetadata(context, info
                                                                          );
     return(HandlerRegistry.CorrectHandlerVersion(context, handler, classMetadata));
 }
Example #2
0
 public override int InstanceCount(ClassMetadata clazz, Transaction trans)
 {
     lock (Lock())
     {
         return clazz.IndexEntryCount(trans);
     }
 }
		public virtual IActivationDepth ActivationDepthFor(ClassMetadata classMetadata, ActivationMode
			 mode)
		{
			Record(new MethodCall("activationDepthFor", new object[] { classMetadata, mode })
				);
			return _delegate.ActivationDepthFor(classMetadata, mode);
		}
Example #4
0
        internal virtual void Analyze(Transaction trans)
        {
            _ref = trans.ReferenceForObject(_obj);
            if (_ref != null)
            {
                _classMetadata = _ref.ClassMetadata();
                return;
            }
            IReflectClass claxx = _container.Reflector().ForObject(_obj);

            if (claxx == null)
            {
                NotStorable(_obj, claxx);
                return;
            }
            if (!DetectClassMetadata(trans, claxx))
            {
                return;
            }
            if (IsValueType(_classMetadata))
            {
                NotStorable(_obj, _classMetadata.ClassReflector(), " Value types can only be stored embedded in parent objects."
                            );
            }
        }
Example #5
0
		/// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		public void ProcessObjectSlot(DefragmentServicesImpl services, ClassMetadata classMetadata
			, int id)
		{
			ByteArrayBuffer sourceBuffer = services.SourceBufferByID(id);
			DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_43(this, services
				), sourceBuffer);
		}
Example #6
0
        public override Db4objects.Db4o.Internal.ClassMetadata ClassMetadata()
        {
            if (_classMetadata != null)
            {
                return(_classMetadata);
            }
            Read();
            if (_bytes == null)
            {
                return(null);
            }
            Seek(0);
            ObjectContainerBase stream       = Container();
            ObjectHeader        objectHeader = new ObjectHeader(stream, _bytes);

            _classMetadata = objectHeader.ClassMetadata();
            if (_classMetadata != null)
            {
                if (stream._handlers.IclassCompare.IsAssignableFrom(_classMetadata.ClassReflector
                                                                        ()))
                {
                    ReadThis(false);
                }
            }
            return(_classMetadata);
        }
Example #7
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 private DatabaseIdentityIDAndUUID ReadDatabaseIdentityIDAndUUID
     (ObjectContainerBase container, ClassMetadata classMetadata, Slot oldSlot, bool
         checkClass)
 {
     if (DTrace.enabled)
     {
         DTrace.RereadOldUuid.LogLength(oldSlot.Address(), oldSlot.Length());
     }
     var reader = container.DecryptedBufferByAddress(oldSlot.Address(), oldSlot
         .Length());
     if (checkClass)
     {
         var realClass = ClassMetadata.ReadClass(container, reader);
         if (realClass != classMetadata)
         {
             return null;
         }
     }
     if (classMetadata.SeekToField(container.Transaction, reader, this) == HandlerVersion
         .Invalid)
     {
         return null;
     }
     return new DatabaseIdentityIDAndUUID(reader.ReadInt(), reader.ReadLong
         ());
 }
		public ModifiedAspectTraversalStrategy(ClassMetadata classMetadata, IList ancestors
			)
		{
			_classDiffs = new ArrayList();
			_classDiffs.Add(new HierarchyAnalyzer.Same(classMetadata));
			Sharpen.Collections.AddAll(_classDiffs, ancestors);
		}
Example #9
0
        public static Sharpen.Util.ISet BuildHierarchy(ClassMetadataRepository repository
                                                       )
        {
            ClassMetadataIterator classIter = repository.Iterator();
            IDictionary           nodes     = new Hashtable();

            Sharpen.Util.ISet roots = new HashSet();
            while (classIter.MoveNext())
            {
                Db4objects.Db4o.Internal.ClassMetadata clazz = classIter.CurrentClass();
                Db4objects.Db4o.Filestats.ClassNode    node  = new Db4objects.Db4o.Filestats.ClassNode
                                                                   (clazz);
                nodes[clazz.GetName()] = node;
                if (clazz.GetAncestor() == null)
                {
                    roots.Add(node);
                }
            }
            for (IEnumerator nodeIter = nodes.Values.GetEnumerator(); nodeIter.MoveNext();)
            {
                Db4objects.Db4o.Filestats.ClassNode node = ((Db4objects.Db4o.Filestats.ClassNode)
                                                            nodeIter.Current);
                Db4objects.Db4o.Internal.ClassMetadata ancestor = node.ClassMetadata().GetAncestor
                                                                      ();
                if (ancestor != null)
                {
                    ((Db4objects.Db4o.Filestats.ClassNode)nodes[ancestor.GetName()]).AddSubClass(node
                                                                                                 );
                }
            }
            return(roots);
        }
Example #10
0
        private void CascadeActivation(IActivationContext context)
        {
            IActivationDepth depth = context.Depth();

            if (!depth.RequiresActivation())
            {
                return;
            }
            if (depth.Mode().IsDeactivate())
            {
                Container().StillToDeactivate(_transaction, context.TargetObject(), depth, false);
            }
            else
            {
                // FIXME: [TA] do we really need to check for isValueType here?
                Db4objects.Db4o.Internal.ClassMetadata classMetadata = context.ClassMetadata();
                if (classMetadata.IsStruct())
                {
                    classMetadata.CascadeActivation(context);
                }
                else
                {
                    Container().StillToActivate(context);
                }
            }
        }
Example #11
0
		internal virtual void Process(ClassMetadata newClassMetadata)
		{
			if (_pending.Contains(newClassMetadata))
			{
				return;
			}
			ClassMetadata ancestor = newClassMetadata.GetAncestor();
			if (ancestor != null)
			{
				Process(ancestor);
			}
			_pending.Add(newClassMetadata);
			_members.Add(newClassMetadata);
			if (_running)
			{
				return;
			}
			_running = true;
			try
			{
				CheckInits();
				_pending = new Collection4();
			}
			finally
			{
				_running = false;
			}
		}
Example #12
0
		internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
			 a_field, bool isTopLevel)
		{
			// Transaction necessary as reference to stream
			// collection of all constraints
			// possible class information
			// possible field information
			// current executing constraint, only set where needed
			_result = new QueryResultCandidates(this);
			_isTopLevel = isTopLevel;
			i_trans = a_trans;
			_classMetadata = a_classMetadata;
			_field = a_field;
			if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
				.GetHandler() is StandardReferenceTypeHandler))
			{
				return;
			}
			ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
				()).ClassMetadata();
			if (_classMetadata == null)
			{
				_classMetadata = yc;
			}
			else
			{
				yc = _classMetadata.GetHigherOrCommonHierarchy(yc);
				if (yc != null)
				{
					_classMetadata = yc;
				}
			}
		}
Example #13
0
		internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
			 a_field)
		{
			// Transaction necessary as reference to stream
			// root of the QCandidate tree
			// collection of all constraints
			// possible class information
			// possible field information
			// current executing constraint, only set where needed
			i_trans = a_trans;
			i_classMetadata = a_classMetadata;
			_field = a_field;
			if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
				.GetHandler() is StandardReferenceTypeHandler))
			{
				return;
			}
			ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
				()).ClassMetadata();
			if (i_classMetadata == null)
			{
				i_classMetadata = yc;
			}
			else
			{
				yc = i_classMetadata.GetHigherOrCommonHierarchy(yc);
				if (yc != null)
				{
					i_classMetadata = yc;
				}
			}
		}
Example #14
0
		public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
			 sio, DefragmentContextImpl context)
		{
			base.Defrag(classMetadata, aspect, sio, context);
			if (!(aspect is FieldMetadata))
			{
				return;
			}
			FieldMetadata field = (FieldMetadata)aspect;
			if (field.IsVirtual())
			{
				return;
			}
			if (field.HasIndex())
			{
				BTree index = field.GetIndex(context.SystemTrans());
				int targetIndexID = context.CopyID();
				if (targetIndexID != 0)
				{
					index.DefragBTree(context.Services());
				}
			}
			else
			{
				context.WriteInt(0);
			}
		}
Example #15
0
		public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
			, ByteArrayBuffer writer)
		{
			writer.WriteShortString(trans, aspect.GetName());
			if (!(aspect is FieldMetadata))
			{
				return;
			}
			FieldMetadata field = (FieldMetadata)aspect;
			field.Alive();
			if (field.IsVirtual())
			{
				return;
			}
			ITypeHandler4 handler = field.GetHandler();
			if (handler is StandardReferenceTypeHandler)
			{
				// TODO: ensure there is a test case, to make this happen 
				if (((StandardReferenceTypeHandler)handler).ClassMetadata().GetID() == 0)
				{
					trans.Container().NeedsUpdate(clazz);
				}
			}
			writer.WriteInt(field.FieldTypeID());
			BitMap4 bitmap = new BitMap4(3);
			bitmap.Set(0, field.IsPrimitive());
			bitmap.Set(1, Handlers4.HandlesArray(handler));
			bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
			// keep the order
			writer.WriteByte(bitmap.GetByte(0));
		}
Example #16
0
			public _IProcedure4_39(ClassMarshaller _enclosing, Transaction trans, ClassMetadata
				 clazz, ByteArrayBuffer writer)
			{
				this._enclosing = _enclosing;
				this.trans = trans;
				this.clazz = clazz;
				this.writer = writer;
			}
Example #17
0
 public MsgD GetWriter(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata
     , int param, ByteArrayBuffer buffer)
 {
     return GetWriter(trans, pointer, buffer, new[]
     {
         classMetadata.GetID(), param
     });
 }
Example #18
0
		public WriteUpdateProcessor(LocalTransaction transaction, int id, ClassMetadata clazz
			, ArrayType typeInfo)
		{
			_transaction = transaction;
			_id = id;
			_clazz = clazz;
			_typeInfo = typeInfo;
		}
            protected override int InternalDeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata
                                                               classMetadata)
            {
                int aspectCount = classMetadata._aspects.Length;

                context.WriteDeclaredAspectCount(aspectCount);
                return(aspectCount);
            }
 public Diff(Db4objects.Db4o.Internal.ClassMetadata classMetadata)
 {
     if (classMetadata == null)
     {
         throw new ArgumentNullException();
     }
     _classMetadata = classMetadata;
 }
		private void RegisterClassMetadataById(ClassMetadata clazz)
		{
			if (clazz.GetID() == 0)
			{
				clazz.Write(_systemTransaction);
			}
			_classMetadataByID.Put(clazz.GetID(), clazz);
		}
Example #22
0
		public virtual IUpdateDepth Adjust(ClassMetadata clazz)
		{
			if (clazz.CascadesOnDeleteOrUpdate())
			{
				return AdjustDepthToBorders().Descend();
			}
			return Descend();
		}
Example #23
0
			public Diff(Db4objects.Db4o.Internal.ClassMetadata classMetadata)
			{
				if (classMetadata == null)
				{
					throw new ArgumentNullException();
				}
				_classMetadata = classMetadata;
			}
Example #24
0
 private ITypeHandler4 TypeHandlerFor(IInternalCandidate candidate)
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = candidate.ClassMetadata();
     if (classMetadata != null)
     {
         return(classMetadata.TypeHandler());
     }
     return(null);
 }
		public override IActivationDepth Descend(ClassMetadata metadata)
		{
			if (_depth < 1)
			{
				return this;
			}
			return new Db4objects.Db4o.Internal.Activation.FixedActivationDepth(_depth - 1, _mode
				);
		}
Example #26
0
 public override Db4objects.Db4o.Internal.ClassMetadata ClassMetadata()
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = _reference.ClassMetadata();
     if (classMetadata == null)
     {
         throw new InvalidOperationException();
     }
     return(classMetadata);
 }
Example #27
0
		public TypeHandlerAspect(ClassMetadata classMetadata, ITypeHandler4 typeHandler)
		{
			if (Handlers4.IsValueType(typeHandler))
			{
				throw new InvalidOperationException();
			}
			_ownerMetadata = classMetadata;
			_typeHandler = typeHandler;
		}
Example #28
0
		public StoredClassImpl(Transaction transaction, ClassMetadata classMetadata)
		{
			if (classMetadata == null)
			{
				throw new ArgumentException();
			}
			_transaction = transaction;
			_classMetadata = classMetadata;
		}
Example #29
0
		public MsgD GetWriter(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata
			, ByteArrayBuffer buffer)
		{
			if (classMetadata == null)
			{
				return GetWriter(trans, pointer, buffer, new int[] { 0 });
			}
			return GetWriter(trans, pointer, buffer, new int[] { classMetadata.GetID() });
		}
Example #30
0
		private int ConfiguredActivationDepth(ClassMetadata metadata)
		{
			Config4Class config = metadata.ConfigOrAncestorConfig();
			if (config != null && _mode.IsActivate())
			{
				return config.AdjustActivationDepth(_depth);
			}
			return _depth;
		}
Example #31
0
		public override IActivationDepth Descend(ClassMetadata metadata)
		{
			if (null == metadata)
			{
				return new Db4objects.Db4o.Internal.Activation.LegacyActivationDepth(_depth - 1, 
					_mode);
			}
			return new Db4objects.Db4o.Internal.Activation.LegacyActivationDepth(DescendDepth
				(metadata), _mode);
		}
Example #32
0
		private int DescendDepth(ClassMetadata metadata)
		{
			int depth = ConfiguredActivationDepth(metadata) - 1;
			if (metadata.IsStruct())
			{
				// 	We also have to instantiate structs completely every time.
				return Math.Max(1, depth);
			}
			return depth;
		}
		protected override void ReadIndex(ObjectContainerBase stream, ClassMetadata clazz
			, ByteArrayBuffer reader)
		{
			int indexID = reader.ReadInt();
			if (indexID == 0)
			{
				return;
			}
			clazz.Index().Read(stream, indexID);
		}
Example #34
0
		/// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		public void ProcessClass(DefragmentServicesImpl services, ClassMetadata classMetadata
			, int id, int classIndexID)
		{
			if (services.MappedID(id, -1) == -1)
			{
				Sharpen.Runtime.Err.WriteLine("MAPPING NOT FOUND: " + id);
			}
			DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_34(classMetadata
				, classIndexID));
		}
		public HierarchyAnalyzer(ClassMetadata storedClass, IReflectClass runtimeClass)
		{
			if (storedClass == null || runtimeClass == null)
			{
				throw new ArgumentNullException();
			}
			_storedClass = storedClass;
			_runtimeClass = runtimeClass;
			_objectClass = runtimeClass.Reflector().ForClass(typeof(object));
		}
		public virtual bool RebuildIndexForClass(LocalObjectContainer container, ClassMetadata
			 classMetadata)
		{
			long[] ids = classMetadata.GetIDs();
			for (int i = 0; i < ids.Length; i++)
			{
				RebuildIndexForObject(container, (int)ids[i]);
			}
			return ids.Length > 0;
		}
		private void AssertClassHandler()
		{
			int id1 = StoreItem();
			int id2 = StoreItem();
			int smallerID = Math.Min(id1, id2);
			int biggerID = Math.Max(id1, id2);
			ClassMetadata classMetadata = new ClassMetadata(Container(), Reflector().ForClass
				(typeof(Comparable4TestCase.Item)));
			AssertHandlerComparison((IComparable4)classMetadata.TypeHandler(), smallerID, biggerID
				);
		}
Example #38
0
		public virtual void Write(Transaction trans, ClassMetadata clazz, ByteArrayBuffer
			 writer)
		{
			writer.WriteShortString(trans, clazz.NameToWrite());
			int intFormerlyKnownAsMetaClassID = 0;
			writer.WriteInt(intFormerlyKnownAsMetaClassID);
			writer.WriteIDOf(trans, clazz._ancestor);
			WriteIndex(trans, clazz, writer);
			writer.WriteInt(clazz.DeclaredAspectCount());
			clazz.TraverseDeclaredAspects(new _IProcedure4_39(this, trans, clazz, writer));
		}
Example #39
0
 private ITypeHandler4 TypeHandlerFor(Db4objects.Db4o.Internal.Query.Processor.QCandidate
                                      candidate)
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = candidate.ReadClassMetadata
                                                                ();
     if (classMetadata != null)
     {
         return(classMetadata.TypeHandler());
     }
     return(null);
 }
 public override IPreparedComparison PrepareComparison(ObjectContainerBase container
                                                       , object constraint)
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = ClassMetadata();
     if (classMetadata == null)
     {
         return(null);
     }
     return(classMetadata.PrepareComparison(container.Transaction.Context(), constraint
                                            ));
 }
		public override IReflectClass ClassReflector(IReflector reflector, ClassMetadata 
			classMetadata, bool isPrimitive)
		{
			IReflectClass primitiveClaxx = Handlers4.PrimitiveClassReflector(classMetadata, reflector
				);
			if (primitiveClaxx != null)
			{
				return primitiveClaxx;
			}
			return base.ClassReflector(reflector, classMetadata, isPrimitive);
		}
Example #42
0
        internal void Store(Db4objects.Db4o.Internal.Transaction trans, Db4objects.Db4o.Internal.ClassMetadata
                            classMetadata, object obj)
        {
            _object = obj;
            _class  = classMetadata;
            int id = trans.Container().IdForNewUserObject(trans);

            SetID(id);
            // will be ended in continueset()
            BeginProcessing();
            BitTrue(Const4.Continue);
        }
Example #43
0
 public virtual void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata
                                   )
 {
     if (_class == classMetadata)
     {
         return;
     }
     if (_class != null)
     {
         throw new InvalidOperationException("Object types aren't supposed to change!");
     }
     _class = classMetadata;
 }
Example #44
0
 private FieldMetadata FieldMetadataFrom(QField qField, Db4objects.Db4o.Internal.ClassMetadata
     type)
 {
     FieldMetadata existingField = qField.GetFieldMetadata();
     if (existingField != null)
     {
         return existingField;
     }
     FieldMetadata field = type.FieldMetadataForName(qField.Name());
     if (field != null)
     {
         field.Alive();
     }
     return field;
 }
Example #45
0
        private ObjectHeader(ObjectContainerBase container, Db4objects.Db4o.Internal.ClassMetadata
                             classMetadata, IReadWriteBuffer reader)
        {
            int classID = reader.ReadInt();

            _marshallerFamily = ReadMarshallerFamily(reader, classID);
            classID           = NormalizeID(classID);
            _classMetadata    = (classMetadata != null ? classMetadata : container.ClassMetadataForID
                                     (classID));
            // This check has been added to cope with defragment in debug mode: SlotDefragment#setIdentity()
            // will trigger calling this constructor with a source db class metadata and a target db stream,
            // thus _classMetadata==null. There may be a better solution, since this call is just meant to
            // skip the object header.
            _headerAttributes = SlotFormat().ReadHeaderAttributes((ByteArrayBuffer)reader);
        }
Example #46
0
        public virtual void CascadeActivationToChild(object obj)
        {
            if (obj == null)
            {
                return;
            }
            IActivationContext cascadingContext = ForObject(obj);

            Db4objects.Db4o.Internal.ClassMetadata classMetadata = cascadingContext.ClassMetadata
                                                                       ();
            if (classMetadata == null || !classMetadata.HasIdentity())
            {
                return;
            }
            CascadeActivation(cascadingContext.Descend());
        }
Example #47
0
        internal virtual IPreparedComparison PrepareComparison(ObjectContainerBase container
                                                               , object constraint)
        {
            IContext context = container.Transaction.Context();

            if (_fieldMetadata != null)
            {
                return(_fieldMetadata.PrepareComparison(context, constraint));
            }
            if (_classMetadata != null)
            {
                return(_classMetadata.PrepareComparison(context, constraint));
            }
            IReflector reflector = container.Reflector();

            Db4objects.Db4o.Internal.ClassMetadata classMetadata = null;
            if (_bytes != null)
            {
                classMetadata = container.ProduceClassMetadata(reflector.ForObject(constraint));
            }
            else
            {
                if (_member != null)
                {
                    classMetadata = container.ClassMetadataForReflectClass(reflector.ForObject(_member
                                                                                               ));
                }
            }
            if (classMetadata != null)
            {
                if (_member != null && _member.GetType().IsArray)
                {
                    ITypeHandler4 arrayElementTypehandler = classMetadata.TypeHandler();
                    if (reflector.Array().IsNDimensional(MemberClass()))
                    {
                        MultidimensionalArrayHandler mah = new MultidimensionalArrayHandler(arrayElementTypehandler
                                                                                            , false);
                        return(mah.PrepareComparison(context, _member));
                    }
                    ArrayHandler ya = new ArrayHandler(arrayElementTypehandler, false);
                    return(ya.PrepareComparison(context, _member));
                }
                return(classMetadata.PrepareComparison(context, constraint));
            }
            return(null);
        }
Example #48
0
        protected void Analyze(ObjectContainerBase container, object obj, ArrayInfo info)
        {
            // TODO: Move as much analysis as possible to ReflectArray#analyze()
            ArrayReflector(container).Analyze(obj, info);
            IReflectClass claxx = ComponentType(container, obj);

            Db4objects.Db4o.Internal.ClassMetadata classMetadata = container.ProduceClassMetadata
                                                                       (claxx);
            bool primitive = IsPrimitive(container.Reflector(), claxx, classMetadata);

            if (primitive)
            {
                claxx = classMetadata.ClassReflector();
            }
            info.Primitive(primitive);
            info.ReflectClass(claxx);
            AnalyzeDimensions(container, obj, info);
        }
Example #49
0
 private void CheckInstanceOfCompare()
 {
     if (_member is ICompare)
     {
         _member = ((ICompare)_member).Compare();
         LocalObjectContainer stream = Container();
         _classMetadata = stream.ClassMetadataForReflectClass(stream.Reflector().ForObject
                                                                  (_member));
         _key = stream.GetID(Transaction(), _member);
         if (_key == 0)
         {
             SetBytes(null);
         }
         else
         {
             SetBytes(stream.ReadBufferById(Transaction(), _key));
         }
     }
 }
Example #50
0
 internal virtual Db4objects.Db4o.Internal.ClassMetadata ReadClassMetadata()
 {
     if (_classMetadata == null)
     {
         Read();
         if (_bytes != null)
         {
             Seek(0);
             ObjectContainerBase stream = Container();
             ObjectHeader objectHeader = new ObjectHeader(stream, _bytes);
             _classMetadata = objectHeader.ClassMetadata();
             if (_classMetadata != null)
             {
                 if (stream._handlers.IclassCompare.IsAssignableFrom(_classMetadata.ClassReflector
                     ()))
                 {
                     ReadThis(false);
                 }
             }
         }
     }
     return _classMetadata;
 }
Example #51
0
 private bool DetectClassMetadata(Transaction trans, IReflectClass claxx)
 {
     _classMetadata = _container.GetActiveClassMetadata(claxx);
     if (_classMetadata != null)
     {
         if (!_classMetadata.IsStorable())
         {
             NotStorable(_obj, claxx);
             return(false);
         }
         return(true);
     }
     _classMetadata = _container.ProduceClassMetadata(claxx);
     if (_classMetadata == null || !_classMetadata.IsStorable())
     {
         NotStorable(_obj, claxx);
         return(false);
     }
     // The following may return a reference if the object is held
     // in a static variable somewhere ( often: Enums) that gets
     // stored or associated on initialization of the ClassMetadata.
     _ref = trans.ReferenceForObject(_obj);
     return(true);
 }
Example #52
0
 public ObjectReference(Db4objects.Db4o.Internal.ClassMetadata classMetadata, int
                        id) : this(id)
 {
     _class = classMetadata;
 }
Example #53
0
 protected IReflectClass ClassReflector(IReflector reflector, Db4objects.Db4o.Internal.ClassMetadata
                                        classMetadata, bool isPrimitive)
 {
     return(_versionHelper.ClassReflector(reflector, classMetadata, isPrimitive));
 }
Example #54
0
 protected bool IsPrimitive(IReflector reflector, IReflectClass claxx, Db4objects.Db4o.Internal.ClassMetadata
                            classMetadata)
 {
     return(_versionHelper.IsPrimitive(reflector, claxx, classMetadata));
 }
Example #55
0
 public ClassNode(Db4objects.Db4o.Internal.ClassMetadata clazz)
 {
     _clazz = clazz;
 }
Example #56
0
 public ObjectHeader(Db4objects.Db4o.Internal.ClassMetadata classMetadata, IReadWriteBuffer
                     reader) : this(null, classMetadata, reader)
 {
 }
Example #57
0
 public virtual void ClassMetadata(Db4objects.Db4o.Internal.ClassMetadata classMetadata
                                   )
 {
     _classMetadata = classMetadata;
 }
 public StandardReferenceTypeHandler(Db4objects.Db4o.Internal.ClassMetadata classMetadata
                                     )
 {
     ClassMetadata(classMetadata);
 }
 public virtual void ClassMetadata(ClassMetadata classMetadata)
 {
     _classMetadata = classMetadata;
 }
 protected override int InternalDeclaredAspectCount(Db4objects.Db4o.Internal.ClassMetadata
                                                    classMetadata)
 {
     return(context.ReadInt());
 }