Exemplo n.º 1
0
        static public Link Create(Link source, Link linker, Link target)
        {
            if (!MemoryManagerIsReady)
            {
                throw new Exception("Менеджер памяти ещё не готов.");
            }
            if (LinkWasDeleted(source))
            {
                throw new ArgumentException("Удалённая связь не может использоваться в качестве значения.", "source");
            }
            if (LinkWasDeleted(linker))
            {
                throw new ArgumentException("Удалённая связь не может использоваться в качестве значения.", "linker");
            }
            if (LinkWasDeleted(target))
            {
                throw new ArgumentException("Удалённая связь не может использоваться в качестве значения.", "target");
            }
            __link *link = CreateLink(source, linker, target);

            if (link == null)
            {
                throw new OutOfMemoryException();
            }

            Parallel.Invoke(() => CreatedEvent.Invoke(new LinkDefinition(source, linker, target)));

            return(link);
        }
Exemplo n.º 2
0
 static private extern void SetMappedLink(int index, __link *link);
Exemplo n.º 3
0
 static private extern __link *SearchLink(__link *source, __link *linker, __link *target);
Exemplo n.º 4
0
 static private extern __link *ReplaceLink(__link *link, __link *replacement);
Exemplo n.º 5
0
 static private extern void DeleteLink(__link *link);
Exemplo n.º 6
0
 static private extern __link *UpdateLink(__link *link, __link *newSource, __link *newLinker, __link *newTarget);
Exemplo n.º 7
0
 static private extern __link *CreateLink(__link *source, __link *linker, __link *target);
Exemplo n.º 8
0
 static private bool LinkWasDeleted(__link *link)
 {
     return(link != null && link->Source == null);
 }
Exemplo n.º 9
0
 public Link(__link *link)
 {
     _link = link;
 }
Exemplo n.º 10
0
 static private bool LinkDoesNotExist(__link *link)
 {
     return(link == null || link->Source == null);
 }
Exemplo n.º 11
0
 static private extern int WalkThroughReferersByTarget(__link *root, StopableVisitor func);
Exemplo n.º 12
0
 static private extern void WalkThroughAllReferersByTarget(__link *root, Visitor action);
Exemplo n.º 13
0
 static private extern uint GetLinkNumberOfReferersByTarget(__link *link);
Exemplo n.º 14
0
 static private extern uint GetLinkNumberOfReferersByLinker(__link *link);
Exemplo n.º 15
0
 static private extern uint GetLinkNumberOfReferersBySource(__link *link);