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