/// <summary> /// Constructs a new node. /// </summary> internal Node(String name, NodeType type = NodeType.Element, NodeFlags flags = NodeFlags.None) { _name = name ?? String.Empty; _type = type; _children = new NodeList(); _flags = flags; }
public PageSplitter(Transaction tx, Tree tree, SliceComparer cmp, Slice newKey, int len, long pageNumber, NodeFlags nodeType, ushort nodeVersion, Cursor cursor, TreeMutableState treeState) { _tx = tx; _tree = tree; _cmp = cmp; _newKey = newKey; _len = len; _pageNumber = pageNumber; _nodeType = nodeType; _nodeVersion = nodeVersion; _cursor = cursor; _treeState = treeState; Page page = _cursor.Pages.First.Value; _page = tx.ModifyPage(page.PageNumber, page); _cursor.Pop(); }
/// <summary> /// Creates a new element node. /// </summary> public Element(Document owner, String name, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None) : base(owner, name, NodeType.Element, flags) { _localName = localName; _prefix = prefix; _namespace = namespaceUri; _attributes = new NamedNodeMap(this); }
protected GreenNode(ushort kind, DiagnosticInfo[] diagnostics) { _kind = kind; if (diagnostics?.Length > 0) { this.flags |= NodeFlags.ContainsDiagnostics; s_diagnosticsTable.Add(this, diagnostics); } }
/// <summary> /// Creates a new element node. /// </summary> public Element(Document owner, String name, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None) : base(owner, name, NodeType.Element, flags) { _localName = localName; _prefix = prefix; _namespace = namespaceUri; _attributes = new List<IAttr>(); _attributeHandlers = new Dictionary<String, Action<String>>(); }
public static unsafe JobHandle Schedule(NativeArray <GridNode> array, NodeFlags defaultFlags) { return(new SetFlags { Flags = (ulong)defaultFlags, BaseAddress = (IntPtr)array.GetUnsafePtr(), Stride = UnsafeUtility.SizeOf <GridNode>(), Length = array.Length }.Schedule()); }
protected void AdjustFlagsAndWidth(GreenNode node) { if (node == null) { return; } _flags |= (node.Flags & NodeFlags.InheritMask); FullWidth += node.FullWidth; }
private static int GetCacheHash(SyntaxKind kind, NodeFlags flags, GreenNode child1) { int code = (int)(flags) ^ (int)kind; // the only child is never null code = Hash.Combine(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(child1), code); // ensure nonnegative hash return(code & Int32.MaxValue); }
protected GreenNode(ushort kind, DiagnosticInfo[] diagnostics, int fullWidth) { _kind = kind; _fullWidth = fullWidth; if (diagnostics?.Length > 0) { this.flags |= NodeFlags.ContainsDiagnostics; s_diagnosticsTable.Add(this, diagnostics); } }
// Token: 0x06001DE5 RID: 7653 RVA: 0x000805E4 File Offset: 0x0007E7E4 public bool GetNodeFlags(NodeGraph.NodeIndex nodeIndex, out NodeFlags flags) { if (nodeIndex != NodeGraph.NodeIndex.invalid && nodeIndex.nodeIndex < this.nodes.Length) { flags = this.nodes[nodeIndex.nodeIndex].flags; return(true); } flags = NodeFlags.None; return(false); }
internal bool IsCacheEquivalent(SyntaxKind kind, NodeFlags flags, GreenNode child1, GreenNode child2, GreenNode child3) { Debug.Assert(this.IsCacheable); return(this.Kind == kind && this.flags == flags && this.GetSlot(0) == child1 && this.GetSlot(1) == child2 && this.GetSlot(2) == child3); }
/// <summary> /// Initializes a new instance of a node /// </summary> /// <param name="flags"></param> internal Node(NodeFlags flags) { Flags = flags; ThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; #if STATISTICS OrigFlags = flags; TimeRequest = PerformanceObserver.MicroTime; #endif }
void SetFlag(NodeFlags f, bool value) { if (value) { Flags |= f; } else { Flags &= ~f; } }
private void SetContextFlag(bool val, NodeFlags flag) { if (val) { contextFlags |= flag; } else { contextFlags &= ~flag; } }
private void AppendFlagsAndForceAmbient(NodeFlags flags) { var finalFlags = flags; if ((flags & NodeFlags.Ambient) == NodeFlags.None) { finalFlags = flags | NodeFlags.Ambient; } AppendFlags(finalFlags); }
/// <summary> /// Creates a standard HTML element. /// </summary> public HtmlElement(Document owner, String localName, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, Combine(prefix, localName), localName, prefix, Namespaces.HtmlUri, flags | NodeFlags.HtmlMember) { RegisterAttributeObserver(AttributeNames.Style, value => { var bindable = _style as IBindable; if (String.IsNullOrEmpty(value)) Attributes.Remove(Attributes.Get(null, AttributeNames.Style)); if (bindable != null) bindable.Update(value); }); }
protected GreenNode(ushort kind, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : this(kind, diagnostics) { if (annotations?.Length > 0) { foreach (var annotation in annotations) { if (annotation == null) throw new ArgumentException(paramName: nameof(annotations), message: "" /*CSharpResources.ElementsCannotBeNull*/); } this.flags |= NodeFlags.ContainsAnnotations; s_annotationsTable.Add(this, annotations); } }
// Token: 0x06001DE1 RID: 7649 RVA: 0x0008033C File Offset: 0x0007E53C public List <NodeGraph.NodeIndex> GetActiveNodesForHullMaskWithFlagConditions(HullMask hullMask, NodeFlags requiredFlags, NodeFlags forbiddenFlags) { List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(this.nodes.Length); for (int i = 0; i < this.nodes.Length; i++) { NodeFlags flags = this.nodes[i].flags; if ((flags & forbiddenFlags) == NodeFlags.None && (flags & requiredFlags) == requiredFlags && (this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { list.Add(new NodeGraph.NodeIndex(i)); } } return(list); }
/// <summary> /// Creates a new SVG element. /// </summary> public SvgElement(Document owner, String name, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, Namespaces.SvgUri, flags | NodeFlags.SvgMember) { RegisterAttributeObserver(AttributeNames.Style, value => { var bindable = _style as IBindable; if (String.IsNullOrEmpty(value)) Attributes.RemoveNamedItem(AttributeNames.Style); if (bindable != null) bindable.Update(value); }); }
internal static NodeFlags SetFactoryContext(NodeFlags flags, SyntaxFactoryContext context) { if (context.IsInAsync) { flags |= NodeFlags.FactoryContextIsInAsync; } if (context.IsInQuery) { flags |= NodeFlags.FactoryContextIsInQuery; } return(flags); }
private void InitializeState(string methodText, object syntaxCursor = null, SourceKind?sourceKind = null) { sourceText = methodText; parsingContext = 0; this.syntaxCursor = syntaxCursor; identifiers = CreateMap <string, string>(); identifierCount = 0; nodeCount = 0; contextFlags = sourceKind == SourceKind.CLRText ? NodeFlags.CLRString : NodeFlags.None; scanner.SetText(methodText); }
private Type GetCurrentType(ParameterInfo[] pis, int curArg, bool fIsParams, out NodeFlags flags) { if (fIsParams && curArg >= (pis.Length - 1)) { flags = NodeFlags.Params; return(pis[pis.Length - 1].ParameterType.GetElementType()); } else if (curArg < pis.Length) { flags = NodeFlags.None; // out & by-ref: simply update our list of out-positions, and mark // the node w/ the appropriate flags. if (pis[curArg].IsOut && !pis[curArg].IsIn) { flags |= NodeFlags.Out; } else if (pis[curArg].ParameterType.IsByRef) { flags |= NodeFlags.ByRef; } if (flags != NodeFlags.None) { if (extraReturnPositions != null) { int[] newpos = new int[extraReturnPositions.Length + 1]; Array.Copy(extraReturnPositions, newpos, extraReturnPositions.Length); extraReturnPositions = newpos; } else { extraReturnPositions = new int[1]; } extraReturnPositions[extraReturnPositions.Length - 1] = curArg; } return(pis[curArg].ParameterType); } else { flags = NodeFlags.Params; // we're generating a params method w/ a mixed tree-depth. Debug.Assert((FunctionType & FunctionType.Params) != 0); return(null); } }
protected GreenNode(ushort kind, DiagnosticInfo[] diagnostics) { _kind = kind; #if XSHARP if (CSharp.SyntaxFacts.IsAnyToken((CSharp.SyntaxKind)kind) || CSharp.SyntaxFacts.IsTrivia((CSharp.SyntaxKind)kind)) { _fullWidth = 1; } #endif if (diagnostics?.Length > 0) { this.flags |= NodeFlags.ContainsDiagnostics; s_diagnosticsTable.Add(this, diagnostics); } }
// Token: 0x060015D9 RID: 5593 RVA: 0x00068BA8 File Offset: 0x00066DA8 private Vector3 SampleNodeGraphForSpawnPosition() { Vector3 zero = Vector3.zero; NodeGraph groundNodes = SceneInfo.instance.groundNodes; NodeFlags requiredFlags = this.usePod ? NodeFlags.NoCeiling : NodeFlags.None; List <NodeGraph.NodeIndex> activeNodesForHullMaskWithFlagConditions = groundNodes.GetActiveNodesForHullMaskWithFlagConditions(HullMask.BeetleQueen, requiredFlags, NodeFlags.None); if (activeNodesForHullMaskWithFlagConditions.Count < 0) { Debug.LogWarning("No spawn points available in scene!"); return(Vector3.zero); } NodeGraph.NodeIndex nodeIndex = activeNodesForHullMaskWithFlagConditions[Run.instance.spawnRng.RangeInt(0, activeNodesForHullMaskWithFlagConditions.Count)]; groundNodes.GetNodePosition(nodeIndex, out zero); return(zero); }
protected GreenNode(ushort kind, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations, int fullWidth) : this(kind, diagnostics, fullWidth) { if (annotations?.Length > 0) { foreach (var annotation in annotations) { if (annotation == null) { throw new ArgumentException(paramName: nameof(annotations), message: "" /*CSharpResources.ElementsCannotBeNull*/); } } this.flags |= NodeFlags.ContainsAnnotations; s_annotationsTable.Add(this, annotations); } }
public u32 Size() { u32 my_size = 0; // text offset my_size += 4; // flags my_size += NodeFlags.Size(); // attribute entries (read from flags) my_size += Attribute.Size() * Flags.Attributes; // check against info switch (Flags.RawInfo) { case 0: my_size += 4; break; case 1: my_size += 4 + 4; break; case 2: case 6: my_size += 4; if (Flags.Children > 0) { my_size += 4; } break; case 3: case 7: my_size += 4 + 4; if (Flags.Children > 0) { my_size += 4; } break; default: //Console.WriteLine("Unsupported info"); break; } return(my_size); }
/// <summary> /// Creates a new SVG element. /// </summary> public SvgElement(Document owner, String name, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, Namespaces.SvgUri, flags | NodeFlags.SvgMember) { RegisterAttributeObserver(AttributeNames.Style, value => { var bindable = _style as IBindable; if (String.IsNullOrEmpty(value)) { RemoveAttribute(AttributeNames.Style); } if (bindable != null) { bindable.Update(value); } }); }
private static int GetCacheHash(SyntaxKind kind, NodeFlags flags, GreenNode child1, GreenNode child2, GreenNode child3) { int code = (int)(flags) ^ (int)kind; if (child1 != null) { code = Hash.Combine(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(child1), code); } if (child2 != null) { code = Hash.Combine(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(child2), code); } if (child3 != null) { code = Hash.Combine(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(child3), code); } // ensure nonnegative hash return(code & Int32.MaxValue); }
protected GreenNode(SyntaxKind kind, int fullWidth, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations) : this(kind, fullWidth) { if (diagnostics?.Length > 0) { this.flags |= NodeFlags.ContainsDiagnostics; diagnosticsTable.Add(this, diagnostics); } if (annotations?.Length > 0) { foreach (var annotation in annotations) { if (annotation == null) { throw new ArgumentException(paramName: nameof(annotations), message: "Annotation cannot be null"); } } this.flags |= NodeFlags.ContainsAnnotations; annotationsTable.Add(this, annotations); } }
// Token: 0x06001DE3 RID: 7651 RVA: 0x0008048C File Offset: 0x0007E68C public List <NodeGraph.NodeIndex> FindNodesInRangeWithFlagConditions(Vector3 position, float minRange, float maxRange, HullMask hullMask, NodeFlags requiredFlags, NodeFlags forbiddenFlags, bool preventOverhead) { float num = minRange * minRange; float num2 = maxRange * maxRange; List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(); for (int i = 0; i < this.nodes.Length; i++) { NodeFlags flags = this.nodes[i].flags; if ((flags & forbiddenFlags) == NodeFlags.None && (flags & requiredFlags) == requiredFlags && (this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { Vector3 a = this.nodes[i].position - position; float sqrMagnitude = a.sqrMagnitude; if (sqrMagnitude >= num && sqrMagnitude <= num2 && (!preventOverhead || Vector3.Dot(a / Mathf.Sqrt(sqrMagnitude), Vector3.up) <= 0.70710677f)) { list.Add(new NodeGraph.NodeIndex(i)); } } } return(list); }
private static DeclarationFlags GetModifiers(NodeFlags flags) { var result = DeclarationFlags.None; if ((flags & NodeFlags.Export) != 0) { result |= DeclarationFlags.Export; } if ((flags & NodeFlags.Ambient) != 0) { result |= DeclarationFlags.Ambient; } if ((flags & NodeFlags.ScriptPublic) != 0) { result |= DeclarationFlags.Public; } return(result); }
public InteractableTemplate() { this.minimumCount = 0; this.selectionWeight = 3; this.spawnDistance = DirectorCore.MonsterSpawnDistance.Standard; this.allowAmbushSpawn = true; this.preventOverhead = false; this.minimumStageCompletions = 0; this.sendOverNetwork = true; this.hullSize = HullClassification.Golem; this.nodeGraphType = MapNodeGroup.GraphType.Ground; this.requiredFlags = NodeFlags.None; this.forbiddenFlags = NodeFlags.None; this.directorCreditCost = 15; this.occupyPosition = true; this.eliteRules = SpawnCard.EliteRules.Default; this.orientToFloor = true; this.slightlyRandomizeOrientation = false; this.skipSpawnWhenSacrificeArtifactEnabled = false; this.multiplayerOnly = false; }
public FPS4Base(Stream stream) : this() { EndianReader reader = new EndianReader(stream, Endianness.BigEndian); if (reader.ReadUInt32() != Magic) { throw new FormatException(); } Files = reader.ReadUInt32(); if (reader.ReadUInt32() != HeaderSize) { throw new FormatException(); } DataOffset = reader.ReadUInt32(); BlockSize = reader.ReadUInt16(); Flags = (NodeFlags)reader.ReadUInt16(); reader.ReadInt32(); // padding TypeOffset = reader.ReadUInt32(); for (uint i = 0; i < Files; i++) { uint offset = (Flags & NodeFlags.Offset) != 0 ? reader.ReadUInt32() : 0; uint sectionsize = (Flags & NodeFlags.SectionSize) != 0 ? reader.ReadUInt32() : 0; uint filesize = (Flags & NodeFlags.Filesize) != 0 ? reader.ReadUInt32() : 0; string filename = (Flags & NodeFlags.Filename) != 0 ? reader.ReadString(0x20) : i.ToString(); uint unknown1 = (Flags & NodeFlags.Unknown1) != 0 ? reader.ReadUInt32() : 0; uint unknown2 = (Flags & NodeFlags.Unknown2) != 0 ? reader.ReadUInt32() : 0; Node node = new Node(offset, sectionsize, filesize, filename, unknown1, unknown2, new Substream(stream, offset, filesize > 0 ? filesize : sectionsize)); Nodes.Add(node); } stream.Position = TypeOffset; Type = reader.ReadBytes((int)(DataOffset - TypeOffset)); // There's more to the type I'm sure }
internal static GreenNode TryGetNode(SyntaxKind kind, GreenNode child1, NodeFlags flags, out int hash) { if (CanBeCached(child1)) { GreenStats.ItemCacheable(); int h = hash = GetCacheHash(kind, flags, child1); int idx = h & CacheMask; var e = s_cache[idx]; if (e.hash == h && e.node != null && e.node.IsCacheEquivalent(kind, flags, child1)) { GreenStats.CacheHit(); return(e.node); } } else { hash = -1; } return(null); }
private bool TryOverwriteDataOrMultiValuePageRefNode(NodeHeader *updatedNode, MemorySlice key, int len, NodeFlags requestedNodeType, ushort?version, out byte *pos) { switch (requestedNodeType) { case NodeFlags.Data: case NodeFlags.MultiValuePageRef: { if (updatedNode->DataSize == len && (updatedNode->Flags == NodeFlags.Data || updatedNode->Flags == NodeFlags.MultiValuePageRef)) { CheckConcurrency(key, version, updatedNode->Version, TreeActionType.Add); if (updatedNode->Version == ushort.MaxValue) { updatedNode->Version = 0; } updatedNode->Version++; updatedNode->Flags = requestedNodeType; { pos = (byte *)updatedNode + Constants.NodeHeaderSize + updatedNode->KeySize; return(true); } } break; } case NodeFlags.PageRef: throw new InvalidOperationException("We never add PageRef explicitly"); default: throw new ArgumentOutOfRangeException(); } pos = null; return(false); }
public PageSplitter(Transaction tx, Tree tree, MemorySlice newKey, int len, long pageNumber, NodeFlags nodeType, ushort nodeVersion, Cursor cursor) { _tx = tx; _tree = tree; _newKey = newKey; _len = len; _pageNumber = pageNumber; _nodeType = nodeType; _nodeVersion = nodeVersion; _cursor = cursor; Page page = _cursor.Pages.First.Value; _page = tx.ModifyPage(page.PageNumber, _tree, page); _cursor.Pop(); }
private T DoOutsideOfContext <T>(NodeFlags context, Func <T> func) { var contextFlagsToClear = context & contextFlags; if (contextFlagsToClear == 0) { T result; // clear the requested context flags SetContextFlag(/*val*/ false, contextFlagsToClear); result = func(); // restore the context flags we just cleared SetContextFlag(/*val*/ true, contextFlagsToClear); return(result); } // no need to do anything special as we are not in any of the requested contexts return(func()); }
internal GreenNode(ObjectReader reader) { var kindBits = reader.ReadUInt16(); _kind = (ushort)(kindBits & ~ExtendedSerializationInfoMask); if ((kindBits & ExtendedSerializationInfoMask) != 0) { var diagnostics = (DiagnosticInfo[])reader.ReadValue(); if (diagnostics != null && diagnostics.Length > 0) { this.flags |= NodeFlags.ContainsDiagnostics; s_diagnosticsTable.Add(this, diagnostics); } var annotations = (SyntaxAnnotation[])reader.ReadValue(); if (annotations != null && annotations.Length > 0) { this.flags |= NodeFlags.ContainsAnnotations; s_annotationsTable.Add(this, annotations); } } }
public SvgElement(Document owner, String name, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, NamespaceNames.SvgUri, flags | NodeFlags.SvgMember) { }
internal HTMLTextFormControlElement(String name, NodeFlags flags = NodeFlags.None) : base(name, flags) { }
private void FlagSetter(NodeFlags flag, bool value) { flags = (byte)(((NodeFlags)flags & ~flag) | (value ? flag : 0)); }
internal void ClearFlags(NodeFlags flags) { this.flags &= ~flags; }
/// <summary> /// Creates a new element node. /// </summary> public Element(Document owner, String name, NodeFlags flags = NodeFlags.None) : this(owner, name, null, null, flags) { }
internal byte* DirectAdd(Transaction tx, Slice key, int len, NodeFlags nodeType = NodeFlags.Data, ushort? version = null) { Debug.Assert(nodeType == NodeFlags.Data || nodeType == NodeFlags.MultiValuePageRef); if (tx.Flags == (TransactionFlags.ReadWrite) == false) throw new ArgumentException("Cannot add a value in a read only transaction"); if (key.Size > tx.DataPager.MaxNodeSize) throw new ArgumentException( "Key size is too big, must be at most " + tx.DataPager.MaxNodeSize + " bytes, but was " + key.Size, "key"); Lazy<Cursor> lazy; var foundPage = FindPageFor(tx, key, out lazy); var page = tx.ModifyPage(foundPage.PageNumber, foundPage); ushort nodeVersion = 0; bool? shouldGoToOverflowPage = null; if (page.LastMatch == 0) // this is an update operation { var node = page.GetNode(page.LastSearchPosition); Debug.Assert(node->KeySize == key.Size && new Slice(node).Equals(key)); shouldGoToOverflowPage = tx.DataPager.ShouldGoToOverflowPage(len); byte* pos; if (shouldGoToOverflowPage == false) { // optimization for Data and MultiValuePageRef - try to overwrite existing node space if (TryOverwriteDataOrMultiValuePageRefNode(node, key, len, nodeType, version, out pos)) return pos; } else { // optimization for PageRef - try to overwrite existing overflows if (TryOverwriteOverflowPages(tx, State, node, key, len, version, out pos)) return pos; } RemoveLeafNode(tx, page, out nodeVersion); } else // new item should be recorded { State.EntriesCount++; } CheckConcurrency(key, version, nodeVersion, TreeActionType.Add); var lastSearchPosition = page.LastSearchPosition; // searching for overflow pages might change this byte* overFlowPos = null; var pageNumber = -1L; if (shouldGoToOverflowPage ?? tx.DataPager.ShouldGoToOverflowPage(len)) { pageNumber = WriteToOverflowPages(tx, State, len, out overFlowPos); len = -1; nodeType = NodeFlags.PageRef; } byte* dataPos; if (page.HasSpaceFor(tx, key, len) == false) { var cursor = lazy.Value; cursor.Update(cursor.Pages.First, page); var pageSplitter = new PageSplitter(tx, this, _cmp, key, len, pageNumber, nodeType, nodeVersion, cursor, State); dataPos = pageSplitter.Execute(); DebugValidateTree(tx, State.RootPageNumber); } else { switch (nodeType) { case NodeFlags.PageRef: dataPos = page.AddPageRefNode(lastSearchPosition, key, pageNumber); break; case NodeFlags.Data: dataPos = page.AddDataNode(lastSearchPosition, key, len, nodeVersion); break; case NodeFlags.MultiValuePageRef: dataPos = page.AddMultiValueNode(lastSearchPosition, key, len, nodeVersion); break; default: throw new NotSupportedException("Unknown node type for direct add operation: " + nodeType); } page.DebugValidate(tx, _cmp, State.RootPageNumber); } if (overFlowPos != null) return overFlowPos; return dataPos; }
internal HTMLFrameElementBase(String name, NodeFlags flags = NodeFlags.None) : base(name, flags | NodeFlags.Special) { }
private NodeHeader* CreateNode(int index, Slice key, NodeFlags flags, int len, ushort previousNodeVersion) { Debug.Assert(index <= NumberOfEntries && index >= 0); Debug.Assert(IsBranch == false || index != 0 || key.Size == 0);// branch page's first item must be the implicit ref if (HasSpaceFor(key, len) == false) throw new InvalidOperationException("The page is full and cannot add an entry, this is probably a bug"); // move higher pointers up one slot for (int i = NumberOfEntries; i > index; i--) { KeysOffsets[i] = KeysOffsets[i - 1]; } var nodeSize = SizeOf.NodeEntry(PageMaxSpace, key, len); var node = AllocateNewNode(index, key, nodeSize, previousNodeVersion); if (key.Options == SliceOptions.Key) key.CopyTo((byte*)node + Constants.NodeHeaderSize); node->Flags = flags; return node; }
internal HTMLFormControlElementWithState(String name, NodeFlags flags = NodeFlags.None) : base(name, flags) { CanContainRangeEndpoint = false; }
/// <summary> /// Creates a standard HTML element. /// </summary> public HtmlElement(Document owner, String localName, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, Combine(prefix, localName), localName, prefix, NamespaceNames.HtmlUri, flags | NodeFlags.HtmlMember) { }
/// <summary> /// Creates a new element node. /// </summary> internal Element(String name, NodeFlags flags = NodeFlags.None) : base(name, NodeType.Element, flags) { _elements = new HtmlElementCollection(this, deep: false); _attributes = new AttrContainer(); }
private bool TryOverwriteDataOrMultiValuePageRefNode(NodeHeader* updatedNode, Slice key, int len, NodeFlags requestedNodeType, ushort? version, out byte* pos) { switch (requestedNodeType) { case NodeFlags.Data: case NodeFlags.MultiValuePageRef: { if (updatedNode->DataSize == len && (updatedNode->Flags == NodeFlags.Data || updatedNode->Flags == NodeFlags.MultiValuePageRef)) { CheckConcurrency(key, version, updatedNode->Version, TreeActionType.Add); if (updatedNode->Version == ushort.MaxValue) updatedNode->Version = 0; updatedNode->Version++; updatedNode->Flags = requestedNodeType; { pos = (byte*)updatedNode + Constants.NodeHeaderSize + key.Size; return true; } } break; } case NodeFlags.PageRef: throw new InvalidOperationException("We never add PageRef explicitly"); default: throw new ArgumentOutOfRangeException(); } pos = null; return false; }
private NodeHeader* CreateNode(int index, MemorySlice key, NodeFlags flags, int len, ushort previousNodeVersion) { Debug.Assert(index <= NumberOfEntries && index >= 0); Debug.Assert(IsBranch == false || index != 0 || key.KeyLength == 0);// branch page's first item must be the implicit ref if (HasSpaceFor(key, len) == false) throw new InvalidOperationException(string.Format("The page is full and cannot add an entry, this is probably a bug. Key: {0}, data length: {1}, size left: {2}", key, len, SizeLeft)); var prefixedKey = key as PrefixedSlice; if (prefixedKey != null && prefixedKey.NewPrefix != null) WritePrefix(prefixedKey.NewPrefix, prefixedKey.Header.PrefixId); // move higher pointers up one slot for (int i = NumberOfEntries; i > index; i--) { KeysOffsets[i] = KeysOffsets[i - 1]; } var nodeSize = SizeOf.NodeEntry(PageMaxSpace, key, len); var node = AllocateNewNode(index, nodeSize, previousNodeVersion); node->KeySize = key.Size; if (key.Options == SliceOptions.Key && key.Size > 0) key.CopyTo((byte*)node + Constants.NodeHeaderSize); node->Flags = flags; return node; }
public HtmlFrameElementBase(Document owner, String name, String prefix, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, flags | NodeFlags.Special) { _request = FrameRequestProcessor.Create(this); }
/// <summary> /// Creates a new element node. /// </summary> public Element(Document owner, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None) : this(owner, prefix != null ? String.Concat(prefix, ":", localName) : localName, localName, prefix, namespaceUri, flags) { }
public HtmlTextFormControlElement(Document owner, String name, String prefix, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, flags) { }
/// <summary> /// Creates a new element. /// </summary> public HtmlUrlBaseElement(Document owner, String name, String prefix, NodeFlags flags) : base(owner, name, prefix, flags) { }
private bool FlagGetter(NodeFlags flag) { return ((NodeFlags)flags & flag) != 0; }
public HtmlFormControlElement(Document owner, String name, String prefix, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, flags | NodeFlags.Special) { _vstate = new ValidityState(); _labels = new NodeList(); }
public HtmlFrameOwnerElement(Document owner, String name, String prefix, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, flags) { }
/// <summary> /// Creates a new MathML element. /// </summary> public MathElement(Document owner, String name, String prefix = null, NodeFlags flags = NodeFlags.None) : base(owner, name, prefix, Namespaces.MathMlUri, flags | NodeFlags.MathMember) { }