Пример #1
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);
			}
		}
Пример #2
0
		private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader)
		{
			byte[] nameBytes = sio.Bytes(reader);
			reader.IncrementOffset(nameBytes.Length);
			nameBytes = Platform4.UpdateClassName(nameBytes);
			return nameBytes;
		}
Пример #3
0
			public _IProcedure4_136(ClassMarshaller _enclosing, IntByRef processedAspectCount
				, int aspectCount, ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl
				 context)
			{
				this._enclosing = _enclosing;
				this.processedAspectCount = processedAspectCount;
				this.aspectCount = aspectCount;
				this.classMetadata = classMetadata;
				this.sio = sio;
				this.context = context;
			}
Пример #4
0
		public virtual void Defrag(ClassMetadata classMetadata, LatinStringIO sio, DefragmentContextImpl
			 context, int classIndexID)
		{
			ReadName(sio, context.SourceBuffer());
			ReadName(sio, context.TargetBuffer());
			int metaClassID = 0;
			context.WriteInt(metaClassID);
			// ancestor ID
			context.CopyID();
			context.WriteInt((classMetadata.HasClassIndex() ? IndexIDForWriting(classIndexID)
				 : 0));
			int aspectCount = context.ReadInt();
			if (aspectCount > classMetadata.DeclaredAspectCount())
			{
				throw new InvalidOperationException();
			}
			IntByRef processedAspectCount = new IntByRef(0);
			classMetadata.TraverseDeclaredAspects(new _IProcedure4_136(this, processedAspectCount
				, aspectCount, classMetadata, sio, context));
		}
Пример #5
0
		internal virtual void StringIO(LatinStringIO io)
		{
			_handlers.StringIO(io);
		}
Пример #6
0
		public void StringIO(LatinStringIO io)
		{
			_stringIO = io;
		}
Пример #7
0
		internal HandlerRegistry(ObjectContainerBase container, byte stringEncoding, GenericReflector
			 reflector)
		{
			// this is the master container and not valid
			// for TransportObjectContainer
			_handlerVersions = new HandlerVersionRegistry(this);
			_stringIO = BuiltInStringEncoding.StringIoForEncoding(stringEncoding, container.ConfigImpl
				.StringEncoding());
			_container = container;
			container._handlers = this;
			_reflector = reflector;
			_diagnosticProcessor = container.ConfigImpl.DiagnosticProcessor();
			InitClassReflectors(reflector);
			_indexes = new SharedIndexedFields();
			_virtualFields[0] = _indexes._version;
			_virtualFields[1] = _indexes._uUID;
			_virtualFields[2] = _indexes._commitTimestamp;
			RegisterBuiltinHandlers();
			RegisterPlatformTypes();
			InitArrayHandlers();
			Platform4.RegisterPlatformHandlers(container);
		}
Пример #8
0
		public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
			 sio, DefragmentContextImpl context)
		{
			context.ReadByte();
			base.Defrag(classMetadata, aspect, sio, context);
		}
Пример #9
0
		public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
			 sio, DefragmentContextImpl context)
		{
			context.IncrementStringOffset(sio);
			if (!(aspect is FieldMetadata))
			{
				return;
			}
			if (((FieldMetadata)aspect).IsVirtual())
			{
				return;
			}
			// handler ID
			context.CopyID();
			// skip primitive/array/narray attributes
			context.IncrementOffset(1);
		}
		public abstract void Defrag(ClassMetadata arg1, ClassAspect arg2, LatinStringIO arg3
			, DefragmentContextImpl arg4);
Пример #11
0
		private void IncrementStringOffset(LatinStringIO sio, ByteArrayBuffer buffer)
		{
			sio.ReadLengthAndString(buffer);
		}
Пример #12
0
		public void IncrementStringOffset(LatinStringIO sio)
		{
			IncrementStringOffset(sio, _source);
			IncrementStringOffset(sio, _target);
		}
Пример #13
0
		private static byte[] BytesToSendFor(string message)
		{
			LatinStringIO io = new LatinStringIO();
			int marshalledStringLength = io.Length(message);
			ByteArrayBuffer buffer = new ByteArrayBuffer(marshalledStringLength + Const4.IntLength);

			buffer.WriteInt(marshalledStringLength);

			io.WriteLengthAndString(buffer, message);
			buffer.Seek(0);
			return buffer.ReadBytes(buffer.Length());
		}
Пример #14
0
		private static string ReadString(ISocket4 socket)
		{
			ByteArrayBuffer buffer = ReadBufferFrom(socket, Const4.IntLength);
			int marshalledStringSize = buffer.ReadInt();

			ByteArrayBuffer marshalledString = ReadBufferFrom(socket, marshalledStringSize);
			LatinStringIO io = new LatinStringIO();
			return io.ReadLengthAndString(marshalledString);
		}