Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.Utilities.TagsInWList< ValueT > Class Template Reference

An implementation of ITags designed for AstNode. More...


Source file:
Inheritance diagram for Loyc.Utilities.TagsInWList< ValueT >:
Loyc.ITags< ValueT >

Remarks

An implementation of ITags designed for AstNode.

It is supposed to be possible to clone AstNode quickly; to support extra tags, we need to be able to clone the tags quickly too, so it makes sense to store them in a WList. To make cloning as quick as possible, we derive from WListProtected. To optimize access to tags, we use the UserByte of WListProtected to hold the index of the last tag that was used. This ensures tags can be accessed quickly by code that only uses a single tag.

Properties

IDictionary< Symbol, ValueT > Tags [get]
 
int TagCount [get]
 
- Properties inherited from Loyc.ITags< ValueT >
IDictionary< Symbol, T > Tags [get]
 Returns a dictionary that can be used to store additional state beyond the standard content of the object. More...
 

Public Member Functions

 TagsInWList (WListProtected< KeyValuePair< Symbol, ValueT >> original)
 
FVList< KeyValuePair< Symbol, ValueT > >.Enumerator TagEnumerator ()
 
ValueT GetTag (string key)
 
ValueT GetTag (Symbol key)
 
ValueT GetTag (Symbol key, ValueT defaultValue)
 
void SetTag (string key, ValueT val)
 
void SetTag (Symbol key, ValueT val)
 
bool RemoveTag (string key)
 
bool RemoveTag (Symbol key)
 
bool HasTag (string key)
 
bool HasTag (Symbol key)