public class BroValue : IEquatable<BroValue>
Public Class BroValue Implements IEquatable(Of BroValue)
type BroValue = class interface IEquatable<BroValue> end
public class BroValue implements IEquatable<BroValue>
BroccoliSharp.BroValue = function(); Type.createClass( 'BroccoliSharp.BroValue', null, IEquatable`1);
Thetype exposes the following members.
Determines whether the specified Object is equal to the current .(Overrides ObjectEquals(Object).)
Indicates whether the current BroType.is equal to another of the same
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Gets a hash code for this(Overrides . ObjectGetHashCode.)
Gets the Type of the current instance.(Inherited from Object.)
Creates a shallow copy of the current Object.(Inherited from Object.)
Returns a string that represents this(Overrides . ObjectToString.)
Equality operator for.
|(Boolean to BroValue)|
Implicitly converts Boolean value to a .
|(DateTime to BroValue)|
Implicitly converts DateTime value to a .
|(IPAddress to BroValue)|
Implicitly converts IPAddress value to a .
|(String to BroValue)|
Implicitly converts String value to a .
|(BroAddress to BroValue)|
Implicitly converts BroAddress value to a .
|(BroPacket to BroValue)|
Implicitly converts BroPacket value to a .
|(BroPort to BroValue)|
Implicitly converts BroPort value to a .
|(BroRecord to BroValue)|
Implicitly converts BroRecord value to a .
|(BroSet to BroValue)|
Implicitly converts BroSet value to a .
|(BroString to BroValue)|
Implicitly converts BroString value to a .
|(BroSubnet to BroValue)|
Implicitly converts BroSubnet value to a .
|(BroTable to BroValue)|
Implicitly converts BroTable value to a .
|(BroTime to BroValue)|
Implicitly converts BroTime value to a .
|(BroValue to BroString)|
Implicitly converts BroString.to a
|(BroValue to String)|
Implicitly converts String.to a
|(BroValue to BroPort)|
Implicitly converts BroPort.to a
|(BroValue to BroAddress)|
Implicitly converts BroAddress.to a
|(BroValue to IPAddress)|
Implicitly converts IPAddress.to an
|(BroValue to BroSubnet)|
Implicitly converts BroSubnet.to a
|(BroValue to BroVector)|
Implicitly converts BroVector.to a
|(BroValue to BroRecord)|
Implicitly converts BroRecord.to a
|(BroValue to BroTable)|
Implicitly converts BroTable.to a
|(BroValue to BroSet)|
Implicitly converts BroSet.to a
|(BroValue to BroPacket)|
Implicitly converts BroPacket.to a
|(BroValue to BroTime)|
Implicitly converts BroTime.to a
|(BroValue to DateTime)|
Implicitly converts DateTime.to a
|(BroValue to Boolean)|
Implicitly converts Boolean.to a
|(BroValue to Int32)|
Implicitly converts Int32.to a
|(BroValue to UInt64)|
Implicitly converts UInt64.to a
|(BroValue to Double)|
Implicitly converts Double.to a
|(BroVector to BroValue)|
Implicitly converts BroVector value to a .
Inequality operator for.
Attempts to get a new value converted to the specified type.(Defined by based on the provided BroValueExtensions.)
Gets a flag that determines if thisas an assigned value.
Gets type of.
Gets or sets optional name of specialized type of.
Gets value of.
A BroType implementations. The is an intermediate class that holds a reference to the actual type value and is implicitly castable to all BroType wrapper classes, structures and applicable .NET data types. The class exists to map strongly-typed BroType wrapper implementations and .NET native types to the void* values that are passed into the Broccoli C API.acts as a versatile variant value class that can wrap all managed and native
Any Broccoli C API detail concerning use of opaque vs. transparent structures or getting a fixed pointer to a managed memory location for value and reference types are handled internally by BroccoliSharp via theclass.
A BroType implementations. For reference-types, the just acts as a pointer to the value - casting to and from the type implementation and a only creates a reference to the type - not a new instance of the type. Casting a to a type other than the BroType implementation it represents will usually result in a null value. However, where applicable for the type, casting to and from related native .NET types is allowed. To change the type of a to another type, use the ConvertToType(BroValue, BroType) method. For value-types, casting to and from the type implementation and a always makes a copy of the value.is implicitly castable to all the
|BroPort, BroAddress and BroSubnet are immutable value-types, as a result, casting from these structures to a always makes a copy of the value. Also, although in the Broccoli C API the bro_string data type is a structure, the corresponding BroccoliSharp wrapper class, BroString, is a reference-type - however, this class is also immutable.|
Even with these constraints, this would not be the end of the world - you could go down the struct path without breaking the basic functionality of the library. However, making these changes would significantly reduce developer usage convenience of the library by having to always create Bro wrapper types to interact with the library. With the way the library is currently designed (with classes), a String can be a BroString, an IPAddress can be a BroAddress and a DateTime can be a BroTime, etc. without the developer having to deal with or think about the conversion details from native types to Bro wrapper types.
Another issue with the struct approach would be the performance penalties that would be incurred in the boxing and unboxing of the struct (value-type) as it was cast to and from its base interface (reference-type) before it could interact with any of Bro classes that work with values - and that being most all of them. As a side note, you might be thinking I actually tried using these classes as structs and later decided it was a bad idea - and if so, you would be right.