예제 #1
0
        public IDManager()
        {
            VertexTypeID = new UniqueID();
            EdgeTypeID = new UniqueID();

            _vertexIDs = new Dictionary<long, UniqueID>();
            _edgeIDs = new Dictionary<long, UniqueID>();
        }
예제 #2
0
        public UniqueID GetEdgeTypeUniqeID(long myEdgeTypeID)
        {
            if (!_edgeIDs.ContainsKey(myEdgeTypeID))

                lock (_edgeIDs)
                {
                    if (!_edgeIDs.ContainsKey(myEdgeTypeID))
                    {
                        _edgeIDs[myEdgeTypeID] = new UniqueID();
                    }
                }

            return _edgeIDs[myEdgeTypeID];
        }
예제 #3
0
        public UniqueID GetVertexTypeUniqeID(long myVertexTypeID)
        {
            if (!_vertexIDs.ContainsKey(myVertexTypeID))

                lock (_vertexIDs)
                {
                    if (!_vertexIDs.ContainsKey(myVertexTypeID))
                    {
                        _vertexIDs[myVertexTypeID] = new UniqueID();
                    }
                }

            return _vertexIDs[myVertexTypeID];
        }
예제 #4
0
파일: IDManager.cs 프로젝트: loubo/sones
        public UniqueID this[long myVertexTypeID]
        {
            get
            {

                if (!_vertexIDs.ContainsKey(myVertexTypeID))
                    lock (_vertexIDs)
                    {
                        if (!_vertexIDs.ContainsKey(myVertexTypeID))
                        {
                            _vertexIDs[myVertexTypeID] = new UniqueID();
                        }
                    }
                return _vertexIDs[myVertexTypeID];
            }
        }