Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Smooth.Slinq.Collections.LinkedHeadTail< K, T > Struct Template Reference

Represents a singly linked list. More...

Inheritance diagram for Smooth.Slinq.Collections.LinkedHeadTail< K, T >:

Public Member Functions

void Append (K key, T value)
 Appends a pooled node with with specified key and value to the end of the list. More...
 
void Append (Linked< K, T > node)
 Appends the specified node to the end of the list. More...
 
void Append (LinkedHeadTail< K, T > other)
 Appends the specified list to the end of this list. More...
 
void Dispose ()
 Releases the head of the list to the node pool. More...
 
void DisposeInBackground ()
 Adds the head of the list to the disposal queue. More...
 
override bool Equals (object other)
 
bool Equals (LinkedHeadTail< K, T > other)
 
override int GetHashCode ()
 
 LinkedHeadTail (K key, T value)
 Returns a list containing a single node with the specified key and value. More...
 
 LinkedHeadTail (Linked< K, T > head)
 Returns a list that starts with the specified node. More...
 
Slinq< T, LinkedContext< K, T > > SlinqAndDispose ()
 Returns a Slinq that enumerates the values contained in the list. More...
 
Slinq< T, LinkedContext< K, T > > SlinqAndKeep ()
 Returns a Slinq that enumerates the values contained in the list without reliquishing ownership of the nodes. More...
 
Slinq< T, LinkedContext< K, T > > SlinqAndKeep (BacktrackDetector bd)
 Returns a Slinq that enumerates the values contained in the list without reliquishing ownership of the nodes. More...
 

Static Public Member Functions

static bool operator!= (LinkedHeadTail< K, T > lhs, LinkedHeadTail< K, T > rhs)
 
static bool operator== (LinkedHeadTail< K, T > lhs, LinkedHeadTail< K, T > rhs)
 

Public Attributes

int count
 The number of elements in the list. More...
 
Linked< K, T > head
 The first node in the list. More...
 
Linked< K, T > tail
 The last node in the list. More...
 

Detailed Description

Represents a singly linked list.

Constructor & Destructor Documentation

Smooth.Slinq.Collections.LinkedHeadTail< K, T >.LinkedHeadTail ( key,
value 
)
inline

Returns a list containing a single node with the specified key and value.

Smooth.Slinq.Collections.LinkedHeadTail< K, T >.LinkedHeadTail ( Linked< K, T >  head)
inline

Returns a list that starts with the specified node.

The constructor will traverse the specified node's links to set the tail and count fields.

If the specified node is null, the resulting list will be empty.

Member Function Documentation

void Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Append ( key,
value 
)
inline

Appends a pooled node with with specified key and value to the end of the list.

void Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Append ( Linked< K, T >  node)
inline

Appends the specified node to the end of the list.

The specified node's links will be traversed to determine the new tail and count.

If the specified node is null, the list will not be modified.

void Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Append ( LinkedHeadTail< K, T >  other)
inline

Appends the specified list to the end of this list.

This list and the specified list must be well formed when calling this method or the program will enter an invalid state, resulting in unspecified behaviour.

Calling this method will invalidate the specified list and any variables containing its nodes.

void Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Dispose ( )
inline

Releases the head of the list to the node pool.

The list must be well formed when calling this method or the program will enter an invalid state, resulting in unspecified behaviour.

void Smooth.Slinq.Collections.LinkedHeadTail< K, T >.DisposeInBackground ( )
inline

Adds the head of the list to the disposal queue.

The list must be well formed when calling this method or the program will enter an invalid state, resulting in unspecified behaviour.

override bool Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Equals ( object  other)
inline
bool Smooth.Slinq.Collections.LinkedHeadTail< K, T >.Equals ( LinkedHeadTail< K, T >  other)
inline
override int Smooth.Slinq.Collections.LinkedHeadTail< K, T >.GetHashCode ( )
inline
static bool Smooth.Slinq.Collections.LinkedHeadTail< K, T >.operator!= ( LinkedHeadTail< K, T >  lhs,
LinkedHeadTail< K, T >  rhs 
)
inlinestatic
static bool Smooth.Slinq.Collections.LinkedHeadTail< K, T >.operator== ( LinkedHeadTail< K, T >  lhs,
LinkedHeadTail< K, T >  rhs 
)
inlinestatic
Slinq<T, LinkedContext<K, T> > Smooth.Slinq.Collections.LinkedHeadTail< K, T >.SlinqAndDispose ( )
inline

Returns a Slinq that enumerates the values contained in the list.

Ownership of the nodes contained in the list is transferred to the Slinq. When the Slinq is disposed, the nodes will be added to the disposal queue.

Slinq<T, LinkedContext<K, T> > Smooth.Slinq.Collections.LinkedHeadTail< K, T >.SlinqAndKeep ( )
inline

Returns a Slinq that enumerates the values contained in the list without reliquishing ownership of the nodes.

The caller of this method is responsible for making sure the returned Slinq is not used after the nodes are modified or returned to the pool.

Slinq<T, LinkedContext<K, T> > Smooth.Slinq.Collections.LinkedHeadTail< K, T >.SlinqAndKeep ( BacktrackDetector  bd)
inline

Returns a Slinq that enumerates the values contained in the list without reliquishing ownership of the nodes.

The caller of this method is responsible for making sure the returned Slinq is not used after the nodes are modified or returned to the pool.

If backtrack detection is enabled, the supplied backtrack detector can be returned to the pool using its TryReleaseShared method to prevent subsequent enumeration of the returned Slinq.

Member Data Documentation

int Smooth.Slinq.Collections.LinkedHeadTail< K, T >.count

The number of elements in the list.

Linked<K, T> Smooth.Slinq.Collections.LinkedHeadTail< K, T >.head

The first node in the list.

Linked<K, T> Smooth.Slinq.Collections.LinkedHeadTail< K, T >.tail

The last node in the list.


The documentation for this struct was generated from the following file: