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


C# ObjectUUID类代码示例

本文整理汇总了C#中ObjectUUID的典型用法代码示例。如果您正苦于以下问题:C# ObjectUUID类的具体用法?C# ObjectUUID怎么用?C# ObjectUUID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: INode

        /// <summary>
        /// This will create an (mostly) empty INode
        /// </summary>
        public INode()
        {
            // Members of AGraphStructure
            _StructureVersion             = actualStructureVersion;
            _IntegrityCheckValue          = null;
            _EncryptionParameters         = null;
            ObjectUUID                    = new ObjectUUID();
            _INodePositions               = new List<ExtendedPosition>();
            _ObjectLocatorReference       = null;

            // Common attributes
            _CreationTime                 = TimestampNonce.Ticks;
            _LastAccessTime               = _CreationTime;
            _LastModificationTime         = _CreationTime;
            _DeletionTime                 = UInt64.MinValue;

            // Object Safety and Security
            _IntegrityCheckAlgorithm      = IntegrityCheckTypes.NULLAlgorithm;
            _EncryptionAlgorithm          = SymmetricEncryptionTypes.NULLAlgorithm;

            // ObjectLocatorPositions
            _ObjectLocatorLength          = 0;
            _ObjectLocatorCopies          = FSConstants.ObjectLocatorsCopies;
            _ObjectLocatorPositions       = new List<ExtendedPosition>();

            // Mark INode dirty
            isDirty                       = true;
        }
开发者ID:TheByte,项目名称:sones,代码行数:31,代码来源:INode.cs

示例2: ShowDBObject

        /// <summary>
        /// Writes an DBObject into log
        /// </summary>
        /// <param name="myObjectUUID">The UUID of the Object</param>
        /// <param name="myTypeManager">The corresponding type manager</param>
        /// <param name="myTypeAttribute">The type attribute</param>
        public static void ShowDBObject(ObjectUUID myObjectUUID, DBTypeManager myTypeManager, TypeAttribute myTypeAttribute, DBObjectCache myObjectCache)
        {
            var currentDBObject = myObjectCache.LoadDBObjectStream(myTypeAttribute.GetRelatedType(myTypeManager), myObjectUUID);

            if (currentDBObject.Failed())
                throw new NotImplementedException();
        }
开发者ID:TheByte,项目名称:sones,代码行数:13,代码来源:PathViewer.cs

示例3: Add

 public override void Add(ObjectUUID myValue, TypeUUID typeOfDBObjects, params ADBBaseObject[] myParameters)
 {
     if (!_ObjectUUIDs.ContainsKey(myValue))
     {
         _ObjectUUIDs.Add(myValue, new Reference(myValue, typeOfDBObjects));
     }
 }
开发者ID:ipbi,项目名称:sones,代码行数:7,代码来源:EdgeTypeSetOfReferences.cs

示例4: AddBackwardEdgesToNode

        public void AddBackwardEdgesToNode(LevelKey myPath, ObjectUUID myObjectUUID, EdgeKey backwardDestination, Dictionary<ObjectUUID, ADBBaseObject> validUUIDs)
        {
            lock (_Content)
            {
                if (_Content.ContainsKey(myPath))
                {
                    //the level exists
                    if (_Content[myPath].Nodes.ContainsKey(myObjectUUID))
                    {

                        //Node exists
                        _Content[myPath].Nodes[myObjectUUID].AddBackwardEdges(backwardDestination, validUUIDs);

                    }
                    else
                    {
                        //Node does not exist
                        throw new GraphDBException(new Error_ExpressionGraphInternal(new System.Diagnostics.StackTrace(true), "The node does not exist in this LevelKey."));
                    }
                }
                else
                {
                    //LevelKey does not exist
                    throw new GraphDBException(new Error_ExpressionGraphInternal(new System.Diagnostics.StackTrace(true), "The LevelKey does not exist in this ExpressionLevel."));
                }
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:27,代码来源:ExpressionLevel.cs

示例5: RemoveBackwardEdges

        protected Exceptional RemoveBackwardEdges(TypeUUID myTypeUUID, Dictionary<AttributeUUID, object> myUserdefinedAttributes, ObjectUUID myObjectUUIDReference, DBContext myDBContext)
        {
            #region get type that carries the attributes

            var aType = myDBContext.DBTypeManager.GetTypeByUUID(myTypeUUID);

            #endregion

            #region process attributes

            foreach (var aUserDefinedAttribute in myUserdefinedAttributes)
            {

                #region Data

                GraphDBType typeOFAttribute = null;
                TypeAttribute attributesOfType = null;

                #endregion

                #region get GraphType of Attribute

                attributesOfType = aType.Attributes[aUserDefinedAttribute.Key];

                typeOFAttribute = myDBContext.DBTypeManager.GetTypeByUUID(attributesOfType.DBTypeUUID);

                #endregion

                IEnumerable<Exceptional<DBObjectStream>> listOfObjects;

                if (aUserDefinedAttribute.Value is IReferenceEdge)
                {
                    listOfObjects = ((IReferenceEdge)aUserDefinedAttribute.Value).GetAllEdgeDestinations(myDBContext.DBObjectCache);
                }
                else
                {
                    listOfObjects = myDBContext.DBObjectCache.LoadListOfDBObjectStreams(typeOFAttribute, (HashSet<ObjectUUID>)aUserDefinedAttribute.Value);
                }

                foreach (var aDBObject in listOfObjects)
                {
                    if (aDBObject.Failed())
                    {
                        return new Exceptional(aDBObject);
                    }

                    var removeExcept = myDBContext.DBObjectManager.RemoveBackwardEdge(aDBObject.Value, myTypeUUID, aUserDefinedAttribute.Key, myObjectUUIDReference);

                    if (removeExcept.Failed())
                    {
                        return new Exceptional(removeExcept);
                    }
                }

            }

            #endregion

            return Exceptional.OK;
        }
开发者ID:TheByte,项目名称:sones,代码行数:60,代码来源:AAttributeAssignOrUpdateOrRemove.cs

示例6: EdgeTypeSingleReference

 public EdgeTypeSingleReference(ObjectUUID dbos, TypeUUID myTypeOfDBObject)
 {
     Debug.Assert(myTypeOfDBObject != null);
     if (dbos != null)
     {
         _ObjectUUID = new Tuple<ObjectUUID, Reference>(dbos, new Reference(dbos, myTypeOfDBObject));
     }
 }
开发者ID:ipbi,项目名称:sones,代码行数:8,代码来源:EdgeTypeSingleReference.cs

示例7: DBObjectMR

        public DBObjectMR(DBObjectStream myDBObject, GraphDBType myDBTypeStream, DBContext myTypeManager)
        {
            _ObjectUUID = myDBObject.ObjectUUID;
            _Attributes = new Dictionary<String, Object>();

            foreach (var _Attribute in myDBTypeStream.Attributes)
            {
                _Attributes.Add(_Attribute.Value.Name, myDBObject.GetAttribute(_Attribute.Key));
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:10,代码来源:DBObjectMR.cs

示例8: AFSObject

        /// <summary>
        /// This will set all important variables within this AFSObject.
        /// This will especially create a new ObjectUUID and mark the
        /// AFSObject as "new" and "dirty".
        /// </summary>
        public AFSObject()
        {
            _ObjectStream       = null;
            _ObjectSize         = 0;
            _ObjectSizeOnDisc   = 0;

            // Generate a new ObjectUUID
            if (ObjectUUID.Length == 0)
                ObjectUUID = new ObjectUUID();
        }
开发者ID:TheByte,项目名称:sones,代码行数:15,代码来源:AFSObject.cs

示例9: AddBackwardEdge

        /// <summary>
        /// Adds a new BackwardEdge from the current DBObject to the destination attribute identified by <paramref name="myBackwardEdgeAttribute"/>.
        /// Do not forget to call Flush() after doing all changes!
        /// </summary>
        /// <param name="myBackwardEdgeAttribute">The destination type and attribute</param>
        /// <param name="myObjectReference">The destination DBObject</param>
        /// <returns></returns>
        public BulkInsertDBO AddBackwardEdge(EdgeKey myBackwardEdgeAttribute, ObjectUUID myObjectReference)
        {
            if (_BackwardEdge == null)
                _BackwardEdge = new BackwardEdgeStream(_DBObjectStream.ObjectLocation);
            _BackwardEdge.AddBackwardEdge(myBackwardEdgeAttribute, myObjectReference, _DBContext.DBObjectManager);

            BackwardEdgesCount++;

            return this;
        }
开发者ID:TheByte,项目名称:sones,代码行数:17,代码来源:BulkInsertDBO.cs

示例10: AFSStructure

        /// <summary>
        /// This will set all important variables within this AFSStructure.
        /// This will especially create a new ObjectUUID and mark the
        /// AGraphStructure as "new" and "dirty".
        /// </summary>
        public AFSStructure()
        {
            // Members of AGraphStructure
            _isNew                   = true;
            _StructureVersion        = 1;
            _IntegrityCheckValue     = null;
            _EncryptionParameters    = null;
            ObjectUUID               = new ObjectUUID();
            _ObjectLocatorReference  = null;

            // Members of IFastSerialize
            isDirty                  = true;
        }
开发者ID:ipbi,项目名称:sones,代码行数:18,代码来源:AFSStructure.cs

示例11: LoadDBObjectStream

 /// <summary>
 /// Loads a DBObject from internal cache structure or GraphFS (if it is not present in cache)
 /// </summary>
 /// <param name="myType">The type of the DBObject as TypeUUID.</param>
 /// <param name="myObjectUUID">The UUID of the DBObject.</param>
 /// <returns>A DBObject.</returns>
 public Exceptional<DBObjectStream> LoadDBObjectStream(TypeUUID myType, ObjectUUID myObjectUUID)
 {
     return LoadDBObjectStream(_typeManager.GetTypeByUUID(myType), myObjectUUID);
 }
开发者ID:ipbi,项目名称:sones,代码行数:10,代码来源:DBObjectCache.cs

示例12: Deserialize


//.........这里部分代码省略.........

                if (EncryptionParameters_Length > mySerializedData.Length - HeaderLength - IntegrityCheckValue_Length)
                    throw new GraphFSException_InvalidEncryptionParametersLengthField("The length of the encryption parameters is invalid!");

                #endregion

                #region Read Padding lengths

                DataPadding_Length = (Int32)_SerializationReader.ReadByte();
                AdditionalPadding_Length = (Int32)(256 * _SerializationReader.ReadByte() + _SerializationReader.ReadByte()) << 3;

                if ((HeaderLength + IntegrityCheckValue_Length + EncryptionParameters_Length + AdditionalPadding_Length) >= mySerializedData.Length)
                    throw new GraphFSException_InvalidAdditionalPaddingLengthField("The length of the additional padding is invalid!");

                _SerializationReader.ReadBytesDirect(2);  // Read reserved bytes

                #endregion

                #region Read Integrity Check Value and Encryption Parameters

                IntegrityCheckValue_Position = _SerializationReader.BaseStream.Position;

                if (IntegrityCheckValue_Length > 0)
                    IntegrityCheckValue = _SerializationReader.ReadBytesDirect(IntegrityCheckValue_Length);

                if (EncryptionParameters_Length > 0)
                    EncryptionParameters = _SerializationReader.ReadBytesDirect(EncryptionParameters_Length);

                #endregion

                #region Verify the integrity of the data

                if (myIntegrityCheckAlgorithm != null && IntegrityCheckValue_Length > 0)
                {

                    // Save the read IntegrityCheckValue
                    IntegrityCheckValue = new Byte[IntegrityCheckValue_Length];
                    Array.Copy(mySerializedData, IntegrityCheckValue_Position, IntegrityCheckValue, 0, IntegrityCheckValue_Length);

                    // Zero the IntegrityCheckValue within the serialized data
                    Byte[] AllZeros = new Byte[IntegrityCheckValue_Length];
                    Array.Copy(AllZeros, 0, mySerializedData, IntegrityCheckValue_Position, IntegrityCheckValue_Length);

                    // Calculate the actual IntegrityCheckValue
                    actualIntegrityCheckValue = myIntegrityCheckAlgorithm.GetHashValueAsByteArray(mySerializedData);

                    // Compare read and actual IntegrityCheckValue
                    if (IntegrityCheckValue.CompareByteArray(actualIntegrityCheckValue) != 0 && myIgnoreIntegrityCheckFailures == false)
                        throw new GraphFSException_IntegrityCheckFailed(String.Concat("The IntegrityCheck failed as ", actualIntegrityCheckValue.ToHexString(), " is not equal to the expected ", IntegrityCheckValue.ToHexString()));

                }

                #endregion

                #region Decrypt the remaining data

                //EncryptedData_Length      = (UInt64) (mySerializedData.Length - (HeaderLength + IntegrityCheckValue_Length + EncryptionParameters_Length + AdditionalPadding_Length));
                //EncryptedData             = new Byte[EncryptedData_Length];
                //Array.Copy(mySerializedData, HeaderLength + IntegrityCheckValue_Length + EncryptionParameters_Length, EncryptedData, 0, (Int64) EncryptedData_Length);

                //#endregion

                //#region Decrypt Data

                // Decrypt Data, sooon...!

                //if ( (UInt64) DataPadding_Length >= EncryptedData_Length)
                //    throw new GraphFSException_InvalidDataPaddingLengthField("The length of the data padding is invalid!");

                //DecryptedData = new Byte[EncryptedData_Length - (UInt64) DataPadding_Length];
                //Array.Copy(EncryptedData, 0, DecryptedData, 0, (Int64) (EncryptedData_Length - (UInt64) DataPadding_Length));

                #endregion

                #region Deserialize Inner Object

                _StructureVersion = BitConverter.ToUInt16(_SerializationReader.ReadBytesDirect(2), 0);
                ObjectUUID = new ObjectUUID();
                ObjectUUID.Deserialize(ref _SerializationReader); // n or at least 16 Bytes

                Deserialize(ref _SerializationReader);

                #endregion

            }

            catch (GraphFSException_IntegrityCheckFailed e)
            {
                throw new GraphFSException_IntegrityCheckFailed("The AGraphStructure could not be deserialized as its integrity is corrupted!\n\n" + e);
            }

            catch (Exception e)
            {
                throw new GraphFSException_AGraphStructureCouldNotBeDeserialized("The AGraphStructure could not be deserialized!\n\n" + e);
            }

            _SerializedAGraphStructure = mySerializedData;

            return new Exceptional();
        }
开发者ID:TheByte,项目名称:sones,代码行数:101,代码来源:AFSObject.cs

示例13: GetObjectsDirectory

 public Exceptional<DirectoryObject> GetObjectsDirectory(GraphDBType myTypeOfDBObject, ObjectUUID uuid)
 {
     return _IGraphFSSession.GetFSObject<DirectoryObject>(new ObjectLocation(myTypeOfDBObject.ObjectLocation, DBConstants.DBObjectsLocation, ObjectManager.GetDBObjectStreamShard(myTypeOfDBObject, uuid)));
 }
开发者ID:TheByte,项目名称:sones,代码行数:4,代码来源:DBTypeManager.cs

示例14: AddAttributeToDBObject

        private Exceptional<ResultType> AddAttributeToDBObject(GraphDBType myTypeOfDBObject, ObjectUUID myUUID, AttributeUUID myAttributeUUID, IObject myAttributeValue)
        {
            //myGraphType is needed due to correctness concerning the attribute name

            #region Input exceptions

            if ((myTypeOfDBObject == null) || (myUUID == null) || (myAttributeUUID == null) || (myAttributeValue == null))
            {
                throw new ArgumentNullException();
            }

            #endregion

            #region Check GraphType for new Attribute

            TypeAttribute typeAttribute = myTypeOfDBObject.GetTypeAttributeByUUID(myAttributeUUID);

            if (typeAttribute == null)
            {
                //Todo: add notification here (the user has to be informed about the detailed circumstances)

                GraphDBError aError = new Error_AttributeIsNotDefined(myTypeOfDBObject.Name, myAttributeUUID.ToString());

                return new Exceptional<ResultType>(aError);
            }

            #endregion

            #region Data

            var objectLocation = new ObjectLocation(myTypeOfDBObject.ObjectLocation, DBConstants.DBObjectsLocation, myUUID.ToString());
            Exceptional<DBObjectStream> aNewDBObject;
            Exceptional<ResultType> result = new Exceptional<ResultType>();

            #endregion

            #region add attribute

            aNewDBObject = _DBContext.DBObjectManager.LoadDBObject(myTypeOfDBObject, myUUID);

            if (aNewDBObject.Failed())
            {
                result.PushIError(new Error_LoadObject(aNewDBObject.Value.ObjectLocation));
                return result;
            }

            result = aNewDBObject.Value.AddAttribute(typeAttribute.UUID, myAttributeValue);

            if (result.Failed())
                return result;

            try
            {
                _DBContext.DBObjectManager.FlushDBObject(aNewDBObject.Value);
            }
            catch (Exception ex)
            {
                result.PushIError(new Error_FlushObject(aNewDBObject.Value.ObjectLocation, ex));
                aNewDBObject.Value.RemoveAttribute(typeAttribute.UUID);
            }

            #endregion

            return result;
        }
开发者ID:TheByte,项目名称:sones,代码行数:65,代码来源:DBTypeManager.cs

示例15: LoadDBBackwardEdgeStream

        /// <summary>
        /// Loads a DBBackwardEdge from internal cache structure or GraphFS (if it is not present in cache)
        /// </summary>
        /// <param name="myType">The Type of the DBObjects as DBTypeStream.</param>
        /// <param name="myObjectUUID">The UUID of the corresponding DBObject.</param>
        /// <returns>A BackwardEdge</returns>
        public Exceptional<BackwardEdgeStream> LoadDBBackwardEdgeStream(GraphDBType myType, ObjectUUID myObjectUUID)
        {
            ConcurrentDictionary<ObjectUUID, WeakReference> items = null;
            lock (_cachedBackwardEdges)
            {
                if (!_cachedBackwardEdges.ContainsKey(myType.UUID))
                {
                    _cachedBackwardEdges.Add(myType.UUID, new ConcurrentDictionary<ObjectUUID, WeakReference>());
                }
                items = _cachedBackwardEdges[myType.UUID];
            }

            try
            {
                if (_currentElements > _maxElements)
                {
                    if (items.ContainsKey(myObjectUUID))
                    {
                        return GetBackwardEdgeStreamViaWeakReference(myObjectUUID, myType, items[myObjectUUID]);
                    }
                    else
                    {
                        //just load from fs
                        return LoadDBBackwardEdgeInternal(myType, myObjectUUID);
                    }
                }
                else
                {
                    var aWeakReference = items.GetOrAdd(myObjectUUID, (aObjectUUID) =>
                    {
                        //DBObject must be loaded from GraphFS
                        var tempResult = LoadDBBackwardEdgeInternal(myType, aObjectUUID);

                        if (tempResult.Failed())
                        {
                            throw new GraphDBException(tempResult.IErrors);
                        }

                        Interlocked.Increment(ref _currentElements);

                        return new WeakReference(tempResult);
                    });

                    return GetBackwardEdgeStreamViaWeakReference(myObjectUUID, myType, aWeakReference);
                }
            }
            catch (GraphDBException ex)
            {
                return new Exceptional<BackwardEdgeStream>(ex.GraphDBErrors);
            }
        }
开发者ID:ipbi,项目名称:sones,代码行数:57,代码来源:DBObjectCache.cs


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