Free Electron
Macros | Functions | Variables
xDataPrimer.cc File Reference

The purpose of src/data provide open run time extensible structured data. More...

#include "fe/data.h"
#include <math.h>
Include dependency graph for xDataPrimer.cc:

Macros

#define DT   1.0e-4
 
#define ST   0.1
 

Functions

void print_group (sp< RecordGroup > spRecordGroup)
 
sp< RecordGrouphello_world (sp< Master > spMaster)
 
void using_accessors (sp< Scope > spScope)
 
void add_heterogenous_dataset (sp< RecordGroup > spRecordGroup)
 
void using_accessorsets (sp< RecordGroup > spRecordGroup)
 
void gravity (Real &force_A, const Real &location_A, const Real &mass_A, Real &force_B, const Real &location_B, const Real &mass_B)
 
void viscosity (Real &force_A, const Real &velocity_A)
 
void integrate (Real &location, Real &velocity, const Real &force, const Real &mass, const Real &dt)
 
void access_pattern_basic (sp< RecordGroup > spRecordGroup)
 
void access_pattern_recordarray (sp< RecordGroup > spRecordGroup)
 
void access_pattern_layout (sp< Scope > spScope)
 
void access_pattern_compile (sp< RecordGroup > spRecordGroup)
 
void schema_example (void)
 
void write_files (sp< RecordGroup > spRecordGroup)
 
void read_files (sp< Scope > spScope, sp< RecordGroup > &spRGFromAscii, sp< RecordGroup > &spRGFromBinary)
 
String colorize_src_data (const std::string &ascii_text)
 
int main (void)
 

Variables

const char * schema_rg
 
const char * body_rg
 

Detailed Description

The purpose of src/data provide open run time extensible structured data.

Precedents range from Houdini and Maya data systems to game ECS systems.

Please see Data System Primer for a full discussion.


What

Overview

Runtime Aggregate Typed Data System – An aggregation of attributes defines this notion of "type". This manifests as both a form of implicit typing (akin to python "duck" typing, where a thing is a thing because it has the attributes of that thing), and an explicit form (where a thing is constructed as a thing with a strict set of attributes).

This leads directly to analogy with other cases, such as Maya, Houdini, USD, etc. However, one of the closest patterns to compare is the Entity Component System (ECS) pattern.

Distilled from https://en.wikipedia.org/wiki/Entity_component_system:

src/data overlaps with the above definition. src/data does not directly facilitate the "System" part, but rather defers the functionality aspect to src/plugin. However, src/data extends the concept of Entity to a Typed Entity, which improves on the ECS pattern's power and can be used for more optimized implementation without losing usability. Therefore, the src/data pattern could be termed: Typed Entity Components for Systems (TEC-S)

A good reason to relate src/data to ECS is that ECS has a lot of stuff written about it which applies to src/data, including the value of the run time part of it, and the tradeoffs in such.

Specifically

The Basic Summary (non circular)

The terms used in traditional ECS map roughly to these src/data terms.

Deep

The way data is actually stored in src/data has some compile time options. The original src/data implementation stored data in what were called State Blocks (SB), which is an Array of Structures (AoS) approach.

In order to improve performance, a Structure of Arrays (SoA) approach was added using what were called Attribute Vectors (AV).

Finally, to improve performance even more, for intense inner loop system cases, more direct access to the Attribute Vectors in a heterogenously usable way was added. Here we call that AV'.

Variable Documentation

◆ body_rg

const char* body_rg
Initial value:
= " \
RECORD 0 particle \
location 0.1 \
RECORD 1 particle \
location 0.3 \
"

◆ schema_rg

const char* schema_rg
Initial value:
= "INFO 5 \
ATTRIBUTE location real F32 float \
ATTRIBUTE mass real F32 float \
ATTRIBUTE force real F32 float \
ATTRIBUTE velocity real F32 float \
LAYOUT particle \
location \
mass \
force \
velocity \
LAYOUT place \
location \
END"