BroTable Class |
Namespace: BroccoliSharp
The BroTable type exposes the following members.
Name | Description | |
---|---|---|
BroTable |
Creates a new BroTable/
| |
BroTable(IDictionaryBroValue, BroValue) |
Creates a new BroTable from an existing dictionary of BroValue items.
|
Name | Description | |
---|---|---|
Add(KeyValuePairBroValue, BroValue) |
Adds a key/value pair to this BroTable.
| |
Add(BroValue, BroValue) |
Adds an element with the provided key and value to this BroTable.
| |
Add(Object, BroType, Object, BroType, String, String) |
Adds an element with the provided key of keyType and
value of valueType to this BroTable.
| |
Clear |
Removes all items from this BroTable.
| |
Clone |
Gets a clone of this BroTable.
| |
Contains |
Determines whether this BroTable contains specified key/value pair.
| |
ContainsKey(BroValue) |
Determines whether this BroTable contains specified key.
| |
ContainsKey(Object, BroType, String) |
Determines whether this BroTable contains specified key of keyType.
| |
CopyTo | ||
Dispose |
Releases all the resources used by this BroTable object.
| |
Dispose(Boolean) |
Releases the unmanaged resources used by this BroTable object and optionally releases the managed resources.
| |
Equals | (Inherited from Object.) | |
Finalize |
Releases the unmanaged resources before this BroTable object is reclaimed by GC.
(Overrides ObjectFinalize.) | |
GetEnumerator |
Returns an enumerator that iterates through the collection.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
Removes the element with the specified key from this BroTable.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryGetValue(BroValue, BroValue) |
Gets the BroValue associated with the specified key.
| |
TryGetValue(Object, BroType, BroValue, String) |
Name | Description | |
---|---|---|
(BroTable to BroSet) |
Implicitly converts keys of a BroTable object to a BroSet.
|
Name | Description | |
---|---|---|
Count |
Gets the number of elements contained in this BroTable.
| |
IsReadOnly |
Gets a value indicating whether this BroTable is read-only.
| |
ItemBroValue |
Gets or sets the BroValue with the specified key.
| |
ItemObject, BroType, String | ||
Keys |
Gets an ICollectionT containing the keys of this BroTable.
| |
KeyType |
Gets the BroType for keys of this BroTable.
| |
Values |
Gets an ICollectionT containing the values of this BroTable.
| |
ValueType |
Gets the BroType for values of this BroTable.
|
The functionality of a BroTable is virtually identical to that of a .NET DictionaryTKey, TValue with a type implementation of a BroValue for both the key and the value.
Tables are handled similarly to records in that typing is determined dynamically by the initial key/value pair inserted. The resulting types can be obtained via the BroTable.KeyType property and the BroTable.ValueType property. Should the types not have been determined yet, BroType.Unknown will result. Also, as with records, values inserted into the table are copied internally, and the ones passed to the insertion functions remain unaffected.
The main thing to know about BroccoliSharp's implementation of tables is how to use composite key types. You may treat composite key types exactly as BroRecord instances, though you do not need to use field names when assigning elements to individual BroField values, you can leave the field name out of most methods and when doing so the field name will default to an empty string. So in order to insert a key/value pair in the table, you will create a new BroRecord with the needed values then use this record as the key object for the BroTable. In order to differentiate composite index types from direct ones consisting of a single record, use BroType.List as the type of the record key, as opposed to BroType.Record. The Broccoli API will then know to interpret the record as an ordered sequence of items making up a composite element, not a regular record.