Class BOOL
Represents a BOOL Logix atomic data type, or a type analogous to a bool. This object is meant to wrap the DataValue or DataValueMember data for the L5X tag data structure.
public sealed class BOOL : AtomicType, ILogixSerializable, IComparable, IConvertible
- Inheritance
-
BOOL
- Implements
- Inherited Members
Constructors
BOOL()
Creates a new default BOOL type.
public BOOL()
BOOL(Radix)
Creates a new BOOL value with the provided radix format.
public BOOL(Radix radix)
Parameters
BOOL(bool)
Creates a new BOOL with the provided value.
public BOOL(bool value)
Parameters
value
boolThe value to initialize the type with.
BOOL(bool, Radix)
Creates a new BOOL with the provided value.
public BOOL(bool value, Radix radix)
Parameters
value
boolThe value to initialize the type with.
radix
RadixThe optional radix format of the value.
BOOL(int)
Creates a new BOOL with the provided value.
public BOOL(int value)
Parameters
Properties
Members
The collection of LogixMember objects that make up the structure of the type.
public override IEnumerable<LogixMember> Members { get; }
Property Value
- IEnumerable<LogixMember>
A IEnumerable<T> containing LogixMember objects.
Remarks
All logix types, with the exception of a BOOL
and REAL/LREAL
, have what can be considered
members. Every derived type must implement this property for which it returns a collection of members, forming
the type/member hierarchy of the logix type.
Name
The name of the logix type.
public override string Name { get; }
Property Value
Radix
The radix format for the AtomicType.
public override Radix Radix { get; }
Property Value
Methods
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
ValueMeaning
Less than zero
This instance precedes
obj
in the sort order.Zero
This instance occurs in the same position in the sort order as
obj
.Greater than zero
This instance follows
obj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetBytes()
Returns the AtomicType value as an array of byte values.
public override byte[] GetBytes()
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse(string)
Parses the provided string value to a new BOOL.
public static BOOL Parse(string value)
Parameters
value
stringThe string value to parse.
Returns
Exceptions
- FormatException
The Radix format can not be inferred from
value
.
Operators
implicit operator bool(BOOL)
public static implicit operator bool(BOOL atomic)
Parameters
atomic
BOOLThe value to convert.
Returns
implicit operator int(BOOL)
public static implicit operator int(BOOL atomic)
Parameters
atomic
BOOLThe value to convert.
Returns
implicit operator string(BOOL)
public static implicit operator string(BOOL value)
Parameters
value
BOOLThe value to convert.
Returns
implicit operator BOOL(bool)
public static implicit operator BOOL(bool value)
Parameters
value
boolThe value to convert.
Returns
implicit operator BOOL(int)
public static implicit operator BOOL(int value)
Parameters
value
intThe value to convert.
Returns
implicit operator BOOL(string)
public static implicit operator BOOL(string value)
Parameters
value
stringThe value to convert.