Elements RTL

Elements RTL (also referred to as RTL2) is a new cross-platform base library and abstraction layer that allows you to write code (in any of the five Elements languages) that can easily be shared across all Platforms.

Elements RTL provides abstractions for common low-level types such as Strings ad Collections, and tasks such as value conversions, text encoding and mathematical operations. It also includes fully native, cross-platform XML and Json document implementations, HTTP access, and more.

Elements RTL supersedes and replaces Sugar. Applications using Sugar should port over to Elements RTL easily, since many APIs are the same or similar.

Using Elements RTL

A pre-compiled version of Elements RTL is included with Elements, and can be added to your projects via the Add References dialog in Fire or Visual Studio, where the Elements library should show automatically. The New Project dialog in Fire will also give you the option to start new projects based on Elements RTL.

Simply adding the reference and adding the RemObjects.Elements.RTL namespace to your uses/import statements will make the Elements RTL classes available for you. For ease of use, we recommend adding RemObjects.Elements.RTL to the global "Default Uses" Project Setting.

Classes and Types

Currently, the following major types are supported/implemented. Unless otherwise noted, all parts of Elements RTL are available across all platforms, including Island.

Classes

Enums

Exceptions

Attributes

Aliases

Alias Type
ApplicationContext
Object  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
ArgumentException
System.ArgumentException  .NET, .NET Core 6.0, .NET Standard 2.0
IllegalArgumentException  Cooper
ArgumentException  Island
DateParserOptions
set of DateParserOption  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
ImmutableObjectDictionary
ImmutableDictionary<String, Object>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island
ImmutableDictionary<String, NSObject>  Toffee, ToffeeV2
ImmutablePlatformBinary
MemoryStream  .NET, .NET Core 6.0, .NET Standard 2.0
ByteArrayOutputStream  Cooper
MemoryStream  Island
NSData  Toffee, ToffeeV2
ImmutableStringDictionary
ImmutableDictionary<String, String>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
ImmutableStringDictionary2
ImmutableDictionary<String, ImmutableDictionary<String, String>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
ImmutableStringDictionary3
ImmutableDictionary<String, ImmutableDictionary<String, ImmutableDictionary<String, String>>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
ImmutableStringDictionary4
ImmutableDictionary<String, ImmutableDictionary<String, ImmutableDictionary<String, ImmutableDictionary<String, String>>>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
JsonDocument
JsonNode  .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2
NotImplementedException
System.NotImplementedException  .NET, .NET Core 6.0, .NET Standard 2.0
NotImplementedException  Island
NotSupportedException
System.NotSupportedException  .NET, .NET Core 6.0, .NET Standard 2.0
UnsupportedOperationException  Cooper
NotSupportedException  Island
ObjectDictionary
Dictionary<String, Object>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island
Dictionary<String, NSObject>  Toffee, ToffeeV2
PlatformAttribute
Attribute  .NET, .NET Core 6.0, .NET Standard 2.0
CustomAttribute  Island
PlatformBinary
MemoryStream  .NET, .NET Core 6.0, .NET Standard 2.0
ByteArrayOutputStream  Cooper
MemoryStream  Island
NSMutableData  Toffee, ToffeeV2
PlatformDateTime
DateTime  .NET, .NET Core 6.0, .NET Standard 2.0
Calendar  Cooper
DateTime  Island
NSDate  Toffee, ToffeeV2
PlatformDictionary<T,U>
Dictionary<T, U>  .NET, .NET Core 6.0, .NET Standard 2.0
HashMap<T, U>  Cooper
RemObjects.Elements.System.Dictionary<T,U>  Island
NSMutableDictionary<T, U>  Toffee, ToffeeV2
PlatformEncoding
Encoding  .NET, .NET Core 6.0, .NET Standard 2.0
Charset  Cooper
Encoding  Island
NSNumber  Toffee, ToffeeV2
PlatformEvent
EventWaitHandle  .NET, .NET Core 6.0, .NET Standard 2.0
ReentrantLock  Cooper
EventWaitHandle  Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows
NSCondition  Toffee, ToffeeV2
PlatformField
FieldInfo  .NET, .NET Core 6.0, .NET Standard 2.0
Field  Cooper
FieldInfo  Island
PlatformGuid
Guid  .NET, .NET Core 6.0, .NET Standard 2.0
UUID  Cooper
Guid  Island
NSUUID  Toffee, ToffeeV2
PlatformImmutableDictionary<T,U>
Dictionary<T, U>  .NET, .NET Core 6.0, .NET Standard 2.0
HashMap<T, U>  Cooper
RemObjects.Elements.System.ImmutableDictionary<T,U>  Island
NSDictionary<T, U>  Toffee, ToffeeV2
PlatformImmutableList<T>
List<T>  .NET, .NET Core 6.0, .NET Standard 2.0
ArrayList<T>  Cooper
RemObjects.Elements.System.ImmutableList<T>  Island
NSArray<T>  Toffee, ToffeeV2
PlatformImmutableQueue<T>
Queue<T>  .NET, .NET Core 6.0, .NET Standard 2.0
LinkedList<T>  Cooper
RemObjects.Elements.System.Queue<T>  Island
NSArray<T>  Toffee, ToffeeV2
PlatformImmutableStack<T>
Stack<T>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper
RemObjects.Elements.System.Stack<T>  Island
NSArray  Toffee, ToffeeV2
PlatformInternalFileStream
FileStream  .NET, .NET Core 6.0, .NET Standard 2.0
RandomAccessFile  Cooper
FileStream  Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows
NSFileHandle  Toffee, ToffeeV2
PlatformList<T>
List<T>  .NET, .NET Core 6.0, .NET Standard 2.0
ArrayList<T>  Cooper
RemObjects.Elements.System.List<T>  Island
NSMutableArray<T>  Toffee, ToffeeV2
PlatformMath
Math  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, ToffeeV2
Math  Island
PlatformMemoryStream
MemoryStream  .NET, .NET Core 6.0, .NET Standard 2.0
ByteArrayOutputStream  Cooper
MemoryStream  Island
NSMutableData  Toffee, ToffeeV2
PlatformMethod
MethodInfo  .NET, .NET Core 6.0, .NET Standard 2.0
Method  Cooper
MethodInfo  Island
PlatformMonitor
ManualResetEvent  .NET, .NET Core 6.0, .NET Standard 2.0
ReentrantLock  Cooper
Monitor  Island
NSRecursiveLock  Toffee, ToffeeV2
PlatformParameter
ParameterInfo  .NET, .NET Core 6.0, .NET Standard 2.0
ArgumentInfo  Island
PlatformProcess
Process  .NET, .NET Core 6.0, .NET Standard 2.0
Process  Island-macOS, Island-Windows
NSTask  Toffee-macOS, ToffeeV2-macOS
PlatformProperty
PropertyInfo  .NET, .NET Core 6.0, .NET Standard 2.0
PropertyInfo  Island
PlatformQueue<T>
Queue<T>  .NET, .NET Core 6.0, .NET Standard 2.0
LinkedList<T>  Cooper
RemObjects.Elements.System.Queue<T>  Island
NSMutableArray<T>  Toffee, ToffeeV2
PlatformSeekOrigin
SeekOrigin  .NET, .NET Core 6.0, .NET Standard 2.0, ToffeeV2
SeekOrigin  Island
PlatformSequence<T>
IEnumerable<T>  .NET, .NET Core 6.0, .NET Standard 2.0, Island
Iterable<T>  Cooper
INSFastEnumeration<T>  Toffee, ToffeeV2
PlatformStack<T>
Stack<T>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper
RemObjects.Elements.System.Stack<T>  Island
NSMutableArray  Toffee, ToffeeV2
PlatformStream
Stream  .NET, .NET Core 6.0, .NET Standard 2.0
Stream  Island
PlatformString
String  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island
NSString  Toffee, ToffeeV2
PlatformStringBuilder
StringBuilder  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper
StringBuilder  Island
NSMutableString  Toffee, ToffeeV2
PlatformThread
Thread  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper
Thread  Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows
NSThread  Toffee, ToffeeV2
PlatformTimer
Timer  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper
Timer  Island
NSTimer  Toffee, ToffeeV2
PlatformTimeZone
TimeZoneInfo  .NET, .NET Core 6.0, .NET Standard 2.0
TimeZone  Cooper
TimeZone  Island
NSTimeZone  Toffee, ToffeeV2
PlatformType
Type  .NET, .NET Core 6.0, .NET Standard 2.0, ToffeeV2
Class  Cooper, Toffee
Type  Island
RegistryHive
Microsoft.Win32.RegistryHive  .NET, .NET Core 6.0, .NET Standard 2.0
String  Island-Windows
StringDictionary
Dictionary<String, String>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
StringDictionary2
Dictionary<String, Dictionary<String, String>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
StringDictionary3
Dictionary<String, Dictionary<String, Dictionary<String, String>>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
StringDictionary4
Dictionary<String, Dictionary<String, Dictionary<String, Dictionary<String, String>>>>  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
UnicodeCharacter
String  .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
UnicodeCodePoint
UInt32  .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2
Cardinal  Cooper

How Elements RTL Works

A large portion of Elements RTL is implemented using an Elements compiler feature called Mapped Types that allows platform-native classes to be accessed using a different, shared API defined by Elements RTL.

For example, RemObjects.Elements.RTL.Dictionary is the class Elements RTL provides for working with a dictionary of keys and values. The class, and its methods, can be used on .NET, Cocoa, Java and Island in exactly the same way, so code that makes use of a RemObjects.Elements.RTL.Dictionary can be compiled for all platforms. But it is not a "real" class. Instead, it is a mapping to

That means that when your code is using RemObjects.Elements.RTL.Dictionary on, say, Cocoa, the compiler will actually translate it to code that directly works with an NSMutableDictionary. The same code, compiled for Java, will seamlessly use a HashMap.

This has several benefits:

  • Rather than "reinventing the wheel", Elements RTL makes use of existing (and well-tested) classes and APIs provided by the underlying frameworks.
  • Elements RTL never boxes you in; you can always access features of the underlying framework classes, simply by casting (although of course that part of the code then becomes platform dependent).
  • Casting between Elements RTL and framework classes is toll free, so your platform-specific UI code can be written to use the regular framework classes, but can seamlessly pass those into your shared business code, which expects and works with Elements RTL classes.

Contributing

Elements RTL is open source and available on GitHub. It also ships pre-compiled and pre-installed with Elements 9.1 and later. Contributions are welcome.

The bulk part of Elements RTL is written in the Oxygene language, but you can open the Elements RTL projects in Fire and Visual Studio 2017 without requiring an Oxygene license, so even C#, Swift or Iodine developers can contribute. We accept contributions in any of the five Elements languages.

See Also