Table of Contents

Class BOOL

Namespace
L5Sharp.Types.Atomics
Assembly
L5Sharp.dll

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

radix Radix

The Radix number format of the value.

BOOL(bool)

Creates a new BOOL with the provided value.

public BOOL(bool value)

Parameters

value bool

The 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 bool

The value to initialize the type with.

radix Radix

The optional radix format of the value.

BOOL(int)

Creates a new BOOL with the provided value.

public BOOL(int value)

Parameters

value int

The int value to initialize the type with. All non-zero value will be evaluated as true.

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

string

A string name identifying the logix type.

Radix

The radix format for the AtomicType.

public override Radix Radix { get; }

Property Value

Radix

A Radix representing the format of the atomic type 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 object

An 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:
Value

Meaning

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 object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetBytes()

Returns the AtomicType value as an array of byte values.

public override byte[] GetBytes()

Returns

byte[]

An array of byte representing the value of the type.

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 string

The string value to parse.

Returns

BOOL

A BOOL representing the parsed value.

Exceptions

FormatException

The Radix format can not be inferred from value.

Operators

implicit operator bool(BOOL)

Implicitly converts the provided BOOL to a bool value.

public static implicit operator bool(BOOL atomic)

Parameters

atomic BOOL

The value to convert.

Returns

bool

A bool type value.

implicit operator int(BOOL)

Implicitly converts the provided BOOL to a bool value.

public static implicit operator int(BOOL atomic)

Parameters

atomic BOOL

The value to convert.

Returns

int

A bool type value.

implicit operator string(BOOL)

Implicitly converts the provided BOOL to a string value.

public static implicit operator string(BOOL value)

Parameters

value BOOL

The value to convert.

Returns

string

A new string value.

implicit operator BOOL(bool)

Implicitly converts the provided bool to a BOOL value.

public static implicit operator BOOL(bool value)

Parameters

value bool

The value to convert.

Returns

BOOL

A BOOL value.

implicit operator BOOL(int)

Implicitly converts the provided bool to a BOOL value.

public static implicit operator BOOL(int value)

Parameters

value int

The value to convert.

Returns

BOOL

A BOOL value.

implicit operator BOOL(string)

Implicitly converts a string to a BOOL value.

public static implicit operator BOOL(string value)

Parameters

value string

The value to convert.

Returns

BOOL

A new BOOL value.