uCalc API Version: 2.1.3-preview.2 Released: 6/16/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

Introduction

Product: 

Class: 

DataTypesAccessor

Provides access to the collection of all data types registered within a uCalc instance.

Remarks

🗂️ The DataTypesAccessor Class

The DataTypesAccessor class is a read-only collection that provides access to all DataType definitions registered within a specific uCalc instance. It is the primary tool for introspecting the engine's type system at runtime.

You do not create an instance of this class directly. Instead, you retrieve it from the uCalc.DataTypes property.


⚙️ Usage Patterns

The DataTypesAccessor behaves like a standard collection and supports two main access patterns:

The most common way to use this class is to iterate through it with a foreach loop to inspect every available data type.

Console.WriteLine("Available Data Types:");foreach(var dt in uc.DataTypes) {   Console.WriteLine($"- {dt.Name} (Size: {dt.ByteSize} bytes)");}

2. Indexed Access

You can also retrieve a specific DataType by its zero-based index in the collection.

var types = uc.DataTypes;if (types.Count() > 0) {    var firstType = types[0];    Console.WriteLine($"The first registered data type is: {firstType.Name}");}

Class Members

MemberDescription
CountGets the total number of data types in the collection.
Indexer[]Retrieves a DataType object by its zero-based index.

💡 Why uCalc? (Comparative Analysis)

DataTypesAccessor provides functionality similar to reflection APIs in other languages, but it is tailored specifically for the uCalc engine.

  • vs. .NET/Java Reflection: Reflection is a general-purpose system for inspecting assemblies and compile-time types. DataTypesAccessor is a much simpler, higher-level API focused exclusively on the types defined within the uCalc engine's dynamic runtime environment. It's a specialized introspection tool, not a full reflection system.

  • vs. C++ RTTI: C++'s typeid provides runtime type information but is limited. uCalc's system allows for rich introspection of a dynamic collection of types, including custom ones defined at runtime, which is not possible with standard RTTI.

Examples

Lists the names of all standard data types registered in the current uCalc instance.
				
					using uCalcSoftware;

var uc = new uCalc();
foreach(var Item in uc.DataTypes) {
   Console.WriteLine(Item.Name);
}
				
			
anytype
bool
bool
int8u
complex
double
single
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
omnitype
pointer
sametypeas
single
size_t
string
void
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   for(auto Item : uc.DataTypes()) {
      cout << Item.Name() << endl;
   }
}
				
			
anytype
bool
bool
int8u
complex
double
single
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
omnitype
pointer
sametypeas
single
size_t
string
void
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      For Each Item In uc.DataTypes
         Console.WriteLine(Item.Name)
      Next
   End Sub
End Module
				
			
anytype
bool
bool
int8u
complex
double
single
int
int16
int16u
int
int32u
int64
int64u
int8
int8u
int
omnitype
pointer
sametypeas
single
size_t
string
void