TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ConfigValue in Tinman.Core.Config

Abstract base class for ConfigValue implementations.

abstract class ConfigValue implements ICodeOutput
  ICodeRange
  IEquatable<ConfigValue>
  IValidatable
  IVersioned

Public / Constants

ContextIncludeVirtualFields

public constant ContextIncludeVirtualFields = "include-virtual-fields"
type string

False

The boolean value false.

public static readonly field False
type ConfigValue

Invalid

An invalid value.

public static readonly field Invalid
type ConfigValue

Null

The null value for ClassType values.

public static readonly field Null
type ConfigValue

One

The number value 1.

public static readonly field One
type ConfigValue

True

The boolean value true.

public static readonly field True
type ConfigValue

Zero

The number value 0.

public static readonly field Zero
type ConfigValue

Public / Attributes

Bool

Accesses the config value, assuming a conversion to Bool exists.

public virtual property Bool { get set }
type bool
value The config value.

See also:

ConfigType.IsBoolean

Exceptions:

CanConfigure

Can the Configure method be called on this config value?

public property CanConfigure { get }
type bool
value true if Configure can be called,
false if not.

Elements

Accesses the config value, assuming it is an array value.

public virtual property Elements { get }
type ValueArray
value [not-null] The config value.

See also:

ConfigType.IsArray
ArrayType

Exceptions:

EvaluatedBy

Returns the config expression that has been evaluated to create this config value.

public property EvaluatedBy { get }
type ConfigExpression
value The config expression or null if not known resp. applicable.

Fields

Accesses the config value, assuming it is a class value.

public virtual property Fields { get }
type IConfigValueBag
value [not-null] The config value.

See also:

ConfigType.IsClass
ClassType

Exceptions:

IsInvalid

public virtual property IsInvalid { get }
type bool
value

IsNull

public virtual property IsNull { get }
type bool
value

Num

Accesses the config value, assuming a conversion to Num exists.

public virtual property Num { get set }
type float64
value The config value.

See also:

ConfigType.IsNumber

Exceptions:

Path

Accesses the config value, assuming a conversion to Path exists.

public virtual property Path { get set }
type Path
value The config value.

See also:

ConfigType.IsPath

Exceptions:

Range

Returns source code range of this object.

public property Range { get }
type RangeI
value The source code character range or Inv if none.
implements ICodeRange.Range

Str

Accesses the config value, assuming a conversion to Str exists.

public virtual property Str { get set }
type string
value The config value.

See also:

ConfigType.IsString

Exceptions:

SyntaxWeightCtor

public property SyntaxWeightCtor { get }
type int32
value

Type

Returns the type of this config property value.

public abstract property Type { get }
type ConfigType
value [not-null] The type of this property value.

Version

Returns the current version of object.

public virtual property Version { get }
type int32
value The current version number.
implements IVersioned.Version

Remarks:

For each modification, the version is incremented by at least one.

Public / Constructors

Evaluate

Parses the given config expression and returns the resulting config value.

public static method Evaluate (string code)
type ConfigValue
params code [not-null] The config expression.
returns [not-null] The config value.

New

Creates a new Bool config value object for the the given value.

public static method New (bool value)
type ConfigValue
params value The initial value.
returns [not-null] The ConfigValue object.

Creates a new Num config value object for the the given value.

public static method New (float64 value)
type ConfigValue
params value The initial value.
returns [not-null] The ConfigValue object.

Creates a new Path config value object for the the given value.

public static method New (Path value)
type ConfigValue
params value The initial value.
returns [not-null] The ConfigValue object.

Creates a new Str config value object for the the given value.

public static method New (string value)
type ConfigValue
params value The initial value.
returns [not-null] The ConfigValue object.

NewArray

Creates a new Path config value array for the the given values.

public static method NewArray (bool[] values)
type ConfigValue
params values The initial values.
returns [not-null] The ConfigValue object.

Creates a new Path config value array for the the given values.

public static method NewArray (float64[] values)
type ConfigValue
params values The initial values.
returns [not-null] The ConfigValue object.

Creates a new Path config value array for the the given values.

public static method NewArray (string[] values)
type ConfigValue
params values The initial values.
returns [not-null] The ConfigValue object.

Creates a new Path config value array for the the given values.

public static method NewArray (Path[] values)
type ConfigValue
params values The initial values.
returns [not-null] The ConfigValue object.

Public / Methods

Cache

Caches the given object.

[EmptyBody]
public virtual method Cache (object obj)
type ConfigValue
params obj The native object
returns [not-null] this

Remarks:

This method can be called after a config value has been constructed for a native object.

Cached

Returns the cached object.

[EmptyBody]
public virtual method Cached (int32 version)
type object
params version The config value version.
returns The cached native object or null if not present or outdated.

Configure

Uses this config value and creates a native object from it.

[OwnerReturn]
public method Configure ()
type IConfigurable
returns [not-null] The created object.

Remarks:

An IConfiguratorObject instance must have been specified for the ClassType of this value (see Configurator).

Equals

Compares this object with the given one.

[Pure]
public method Equals (ConfigValue other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
implements IEquatable.Equals

GetField

Returns the value of the given field.

public method GetField (string name, bool notNull = false)
type ConfigValue
params name [not-null] The field name.
  notNull Call NotNull on field value? Defaults to false.
returns [not-null] The field value.

See also:

Fields

GetFieldBool

Returns the value of the given field.

public method GetFieldBool (string name)
type bool
params name [not-null] The field name.
returns The field value.

See also:

Fields

GetFieldDouble

Returns the value of the given field.

public method GetFieldDouble (string name)
type float64
params name [not-null] The field name.
returns The field value.

See also:

Fields

GetFieldInt

Returns the value of the given field.

public method GetFieldInt (string name)
type int32
params name [not-null] The field name.
returns The field value.

See also:

Fields

GetFieldPath

Returns the value of the given field.

public method GetFieldPath (string name, bool notNull = false)
type Path
params name [not-null] The field name.
  notNull Call NotNull on field value? Defaults to false.
returns The field value.

See also:

Fields

GetFieldStr

Returns the value of the given field.

public method GetFieldStr (string name, bool notNull = false)
type string
params name [not-null] The field name.
  notNull Call NotNull on field value? Defaults to false.
returns The field value.

See also:

Fields

IsFieldNull

Checks if this config value has a field named name that has a non-null value.

public method IsFieldNull (string name)
type bool
params name [not-null] The field name.
returns true if the field name exists and has a non-null value, false otherwise.

New

Creates a new instance of the given nullable type and sets this value to the resulting value.

public virtual method New (ConfigType type = null)
type ConfigValue
params type The nullable type to instantiate or null to use the value base type.
returns [not-null] this

NotNull

Throws a ConfigException if this config value is Null.

public method NotNull ()
type ConfigValue
returns [not-null] this

Exceptions:

Set

Sets the value to the given value.

public virtual method Set (ConfigValue value)
type ConfigValue
params value [not-null] The other value.
returns [not-null] this

SetField

Sets the value of the given field.

public method SetField (string name, ConfigValue value)
type ConfigValue
params name [not-null] The field name.
  value [not-null] The field value.
returns [not-null] this

See also:

Fields

Sets the value of the given field.

public method SetField (string name, IConfigurable value)
type ConfigValue
params name [not-null] The field name.
  value The field value.
returns [not-null] this

See also:

Fields

SetFieldBool

Sets the value of the given field.

public method SetFieldBool (string name, bool value)
type ConfigValue
params name [not-null] The field name.
  value The field value.
returns [not-null] this

See also:

Fields

SetFieldNum

Sets the value of the given field.

public method SetFieldNum (string name, float64 value)
type ConfigValue
params name [not-null] The field name.
  value The field value.
returns [not-null] this

See also:

Fields

SetFieldPath

Sets the value of the given field.

public method SetFieldPath (string name, Path value)
type ConfigValue
params name [not-null] The field name.
  value The field value.
returns [not-null] this

See also:

Fields

SetFieldStr

Sets the value of the given field.

public method SetFieldStr (string name, string value)
type ConfigValue
params name [not-null] The field name.
  value The field value.
returns [not-null] this

See also:

Fields

ToString

[Pure]
public override method ToString ()
type string

public method ToString (bool includeVirtualFields)
type string
params includeVirtualFields

Validate

Validates the state of this object.

public method Validate (Validator validator)
params validator [not-null] The validator object.
implements IValidatable.Validate

ValidateFlush

Flushes all cached validation results.

public virtual method ValidateFlush ()

Remarks:

Call this method when external changes have taken place, such as file deletions / creations.

WriteSourceCode

Produces source code by feeding the given source code writer.

public abstract method WriteSourceCode (SourceCodeWriter writer, Context context)
params writer [not-null] The source code writer to use.
  context [not-null] Context information.
implements ICodeOutput.WriteSourceCode

Protected / Attributes

DoSyntaxWeightCtor

protected abstract property DoSyntaxWeightCtor { get }
type int32
value

Protected / Constructors

ConfigValue

protected constructor ConfigValue ()

Protected / Methods

DoEquals

Compares this config value and the given one for equality.

protected abstract method DoEquals (ConfigValue other)
type bool
params other The other config value. This will never be null. Also, the types of this config value and the given one are mutually convertible to each other.
returns true if both config values are equal, false if not.

DoValidate

[EmptyBody]
protected virtual method DoValidate (Validator validator)
params validator