当前位置: 首页>>代码示例>>C#>>正文


C# NeoDatis.GetObjectId方法代码示例

本文整理汇总了C#中NeoDatis.GetObjectId方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.GetObjectId方法的具体用法?C# NeoDatis.GetObjectId怎么用?C# NeoDatis.GetObjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeoDatis的用法示例。


在下文中一共展示了NeoDatis.GetObjectId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultIdManager

		/// <param name="objectWriter">The object writer</param>
		/// <param name="objectReader">The object reader</param>
		/// <param name="currentBlockIdPosition">The position of the current block</param>
		/// <param name="currentBlockIdNumber">The number of the current block</param>
		/// <param name="currentMaxId">Maximum Database id</param>
		public DefaultIdManager(NeoDatis.Odb.Core.Layers.Layer3.IObjectWriter objectWriter
			, NeoDatis.Odb.Core.Layers.Layer3.IObjectReader objectReader, long currentBlockIdPosition
			, int currentBlockIdNumber, NeoDatis.Odb.OID currentMaxId)
		{
			this.provider = NeoDatis.Odb.OdbConfiguration.GetCoreProvider();
			this.objectWriter = objectWriter;
			this.objectReader = objectReader;
			this.session = objectWriter.GetSession();
			this.currentBlockIdPosition = currentBlockIdPosition;
			this.currentBlockIdNumber = currentBlockIdNumber;
			this.maxId = provider.GetObjectOID((long)currentBlockIdNumber * NeoDatis.Odb.OdbConfiguration
				.GetNB_IDS_PER_BLOCK(), 0);
			this.nextId = provider.GetObjectOID(currentMaxId.GetObjectId() + 1, 0);
			lastIds = new NeoDatis.Odb.OID[IdBufferSize];
			for (int i = 0; i < IdBufferSize; i++)
			{
				lastIds[i] = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.NullObjectId;
			}
			lastIdPositions = new long[IdBufferSize];
			lastIdIndex = 0;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:26,代码来源:DefaultIdManager.cs

示例2: ExternalObjectOID

		public ExternalObjectOID(NeoDatis.Odb.OID oid, NeoDatis.Odb.DatabaseId databaseId
			) : base(oid.GetObjectId())
		{
			this.databaseId = databaseId;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:5,代码来源:ExternalObjectOID.cs

示例3: WriteOid

		// fsi.writeLong(oid.getObjectId(), writeInTransaction, label,
		// writeAction);
		public virtual void WriteOid(NeoDatis.Odb.OID oid, bool writeInTransaction, string
			 label, int writeAction)
		{
			if (oid == null)
			{
				fsi.WriteLong(-1, writeInTransaction, label, writeAction);
			}
			else
			{
				fsi.WriteLong(oid.GetObjectId(), writeInTransaction, label, writeAction);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:14,代码来源:AbstractObjectWriter.cs

示例4: EncodeOid

		public virtual void EncodeOid(NeoDatis.Odb.OID oid, byte[] bytes, int offset)
		{
			if (oid == null)
			{
				byteArrayConverter.LongToByteArray(-1, bytes, offset);
			}
			else
			{
				// fsi.writeLong(-1, writeInTransaction, label, writeAction);
				byteArrayConverter.LongToByteArray(oid.GetObjectId(), bytes, offset);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:12,代码来源:AbstractObjectWriter.cs

示例5: AssociateIdToObject

		/// <summary>Associate an object OID to its position</summary>
		/// <param name="idType">The type : can be object or class</param>
		/// <param name="idStatus">The status of the OID</param>
		/// <param name="currentBlockIdPosition">The current OID block position</param>
		/// <param name="oid">The OID</param>
		/// <param name="objectPosition">The position</param>
		/// <param name="writeInTransaction">To indicate if write must be executed in transaction
		/// 	</param>
		/// <returns>@</returns>
		public virtual long AssociateIdToObject(byte idType, byte idStatus, long currentBlockIdPosition
			, NeoDatis.Odb.OID oid, long objectPosition, bool writeInTransaction)
		{
			// Update the max id of the current block
			fsi.SetWritePosition(currentBlockIdPosition + NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
				.BlockIdOffsetForMaxId, writeInTransaction);
			fsi.WriteLong(oid.GetObjectId(), writeInTransaction, "id block max id update", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.PointerWriteAction);
			long l1 = (oid.GetObjectId() - 1) % NeoDatis.Odb.OdbConfiguration.GetNB_IDS_PER_BLOCK
				();
			long l2 = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.BlockIdOffsetForStartOfRepetition;
			long idPosition = currentBlockIdPosition + NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant
				.BlockIdOffsetForStartOfRepetition + (l1) * NeoDatis.Odb.OdbConfiguration.GetID_BLOCK_REPETITION_SIZE
				();
			// go to the next id position
			fsi.SetWritePosition(idPosition, writeInTransaction);
			// id type
			fsi.WriteByte(idType, writeInTransaction, "id type");
			// id
			fsi.WriteLong(oid.GetObjectId(), writeInTransaction, "oid", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.PointerWriteAction);
			// id status
			fsi.WriteByte(idStatus, writeInTransaction, "id status");
			// object position
			fsi.WriteLong(objectPosition, writeInTransaction, "obj pos", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.PointerWriteAction);
			return idPosition;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:37,代码来源:AbstractObjectWriter.cs

示例6: UpdateObjectReference

		/// <summary>
		/// <pre>
		/// Class User{
		/// private String name;
		/// private Function function;
		/// }
		/// When an object of type User is stored, it stores a reference to its function object.
		/// </summary>
		/// <remarks>
		/// <pre>
		/// Class User{
		/// private String name;
		/// private Function function;
		/// }
		/// When an object of type User is stored, it stores a reference to its function object.
		/// If the function is set to another, the pointer to the function object must be changed.
		/// for example, it was pointing to a function at the position 1407, the 1407 value is stored while
		/// writing the USer object, let's say at the position 528. To make the user point to another function object (which exist at the position 1890)
		/// The position 528 must be updated to 1890.
		/// </pre>
		/// </remarks>
		/// <param name="positionWhereTheReferenceIsStored"></param>
		/// <param name="newOid"></param>
		/// <></>
		public virtual void UpdateObjectReference(long positionWhereTheReferenceIsStored, 
			NeoDatis.Odb.OID newOid, bool writeInTransaction)
		{
			long position = positionWhereTheReferenceIsStored;
			if (position < 0)
			{
				throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.NegativePosition
					.AddParameter(position));
			}
			fsi.SetWritePosition(position, writeInTransaction);
			// Ids are always stored as negative value to differ from a position!
			long oid = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.NullObjectIdId;
			if (newOid != null)
			{
				oid = -newOid.GetObjectId();
			}
			fsi.WriteLong(oid, writeInTransaction, "object reference", NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction
				.PointerWriteAction);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:43,代码来源:AbstractObjectWriter.cs

示例7: MarkAsAPointerTo

		/// <summary>Writes a pointer block : A pointer block is like a goto.</summary>
		/// <remarks>
		/// Writes a pointer block : A pointer block is like a goto. It can be used
		/// for example when an instance has been updated. To enable all the
		/// references to it to be updated, we just create o pointer at the place of
		/// the updated instance. When searching for the instance, if the block type
		/// is POINTER, then the position will be set to the pointer position
		/// </remarks>
		/// <param name="currentPosition"></param>
		/// <param name="newObjectPosition"></param>
		/// <></>
		protected virtual void MarkAsAPointerTo(NeoDatis.Odb.OID oid, long currentPosition
			, long newObjectPosition)
		{
			throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.FoundPointer
				.AddParameter(oid.GetObjectId()).AddParameter(newObjectPosition));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:17,代码来源:AbstractObjectWriter.cs

示例8: WriteNonNativeNullObjectHeader

		protected virtual void WriteNonNativeNullObjectHeader(NeoDatis.Odb.OID classInfoId
			, bool writeInTransaction)
		{
			// Block size
			fsi.WriteInt(NonNativeHeaderBlockSize, writeInTransaction, "block size");
			// Block type
			fsi.WriteByte(NeoDatis.Odb.Impl.Core.Layers.Layer3.Block.BlockTypes.BlockTypeNonNativeNullObject
				, writeInTransaction);
			// class info id
			fsi.WriteLong(classInfoId.GetObjectId(), writeInTransaction, "null non native obj class info position"
				, NeoDatis.Odb.Impl.Core.Transaction.DefaultWriteAction.DataWriteAction);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:12,代码来源:AbstractObjectWriter.cs


注:本文中的NeoDatis.GetObjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。