MarkSet

class MarkSet(val pruningRules: PruningRules)

A mark set is used in three phases:

  1. Marking root types and root members. These are the identifiers specifically identified by the user in the includes set. In this phase it is an error to mark a type that is excluded, or to mark both a type and one of its members.

  2. Marking members transitively reachable by those roots. In this phase if a member is visited, the member's enclosing type is marked instead, unless it is of a type that has a specific member already marked.

  3. Retaining which members and types have been marked.

Constructors

Link copied to clipboard
constructor(pruningRules: PruningRules)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The members to retain. Any member not in here should be pruned!

Link copied to clipboard
Link copied to clipboard

The types to retain. We may retain a type but not all of its members.

Functions

Link copied to clipboard
operator fun contains(protoMember: ProtoMember): Boolean

Returns true if member is marked and should be retained.

operator fun contains(type: ProtoType): Boolean

Returns true if type is marked and should be retained.

Link copied to clipboard
fun mark(protoMember: ProtoMember): Boolean

Marks a member as transitively reachable by the includes set. Returns true if the mark is new, the member will be retained, and reachable objects should be traversed.

fun mark(type: ProtoType): Boolean
fun mark(type: ProtoType, reference: ProtoMember): Boolean

Marks a type as transitively reachable by the includes set. Returns true if the mark is new, the type will be retained, and reachable objects should be traversed.

Link copied to clipboard
fun root(protoMember: ProtoMember)

Marks protoMember, throwing if it is explicitly excluded. This implicitly excludes other members of the same type.

fun root(type: ProtoType)

Marks type, throwing if it is explicitly excluded.