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 four Elements languages) that can easily be shared across all four platforms (.NET, Cocoa, Java/Android, and Island).

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

See Also