Skip to content

Commit

Permalink
Data marshal library.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Jun 4, 2024
1 parent 78fad1a commit 14703ef
Show file tree
Hide file tree
Showing 11 changed files with 1,550 additions and 64 deletions.
8 changes: 7 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ DOC_OUTPUT_fmi := doc/content/apis/clib/fmi/index.md
DOC_LINKTITLE_fmi := FMI
DOC_TITLE_fmi := "FMI API Reference"

# Module "marshal"
DOC_INPUT_marshal := dse/clib/data/marshal.h
DOC_CDIR_marshal := dse/clib/data/marshal.c
DOC_OUTPUT_marshal := doc/content/apis/clib/marshal/index.md
DOC_LINKTITLE_marshal := Marshal
DOC_TITLE_marshal := "Marshal API Reference"

# Targets
DOC_C_MODULES := fmi
DOC_C_MODULES := fmi marshal


.PHONY: examples
Expand Down
130 changes: 68 additions & 62 deletions doc/content/apis/clib/fmi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@
title: FMI API Reference
linkTitle: FMI
---
## storage_get_bucket


Returns a reference/pointer to the requested storage bucket.

### Parameters

model_desc (FmuModelDesc*)
: Model Descriptor.

type (storage_type)
: Indicate the storage type bucket which should be retrieved.

### Returns

storage_bucket*
: Reference to the requested storage bucket.

NULL
: The specified storage bucket is not provisioned.



## FMU Model API


Expand Down Expand Up @@ -82,13 +105,46 @@ When building an FMU, link the following files:



## fmu_model_create


Creates an FMU Model Descriptor object and performs any necessary
initialisation of the FMU Model.

Called by `fmi2Instantiate()`.

Called by `fmi3InstantiateCoSimulation()`.

### Parameters

fmu_inst (void*)
: FMU provided instance data.

mem_alloc (FmuMemAllocFunc)
: Function pointer for the memory allocation function which the Model should
use. Recommend using calloc().

mem_free (FmuMemFreeFunc)
: Function pointer for the memory free function which the Model should use.
Typically free().

resource_location (const char*)
: A string referencing the path to the resource directory.

### Returns

FmuModelDesc*
: A new FMU Model Descriptor object.



## Typedefs

### FmuAdapterDesc

```c
typedef struct FmuAdapterDesc {
const char * name;
const char* name;
FmuLoadHandler load_func;
FmuInitHandler init_func;
FmuStepHandler step_func;
Expand All @@ -102,13 +158,13 @@ typedef struct FmuAdapterDesc {

```c
typedef struct FmuInstDesc {
const char * name;
const char * path;
void * model_doc;
FmuAdapterDesc * adapter;
FmuStrategyDesc * strategy;
void * inst_data;
void * model_desc;
const char* name;
const char* path;
void* model_doc;
FmuAdapterDesc* adapter;
FmuStrategyDesc* strategy;
void* inst_data;
void* model_desc;
}
```

Expand All @@ -118,8 +174,9 @@ typedef struct FmuInstDesc {
typedef struct FmuModelDesc {
FmuMemAllocFunc mem_alloc;
FmuMemFreeFunc mem_free;
void * instance_data;
void * private;
const char* resource_location;
void* instance_data;
void* private;
int external_binary_free;
}
```
Expand All @@ -128,7 +185,7 @@ typedef struct FmuModelDesc {

```c
typedef struct FmuStrategyDesc {
const char * name;
const char* name;
FmuStrategyExecuteFunc exec_func;
FmuStrategyMapVariables map_func;
FmuStrategyToVariables marshal_to_var_func;
Expand Down Expand Up @@ -176,35 +233,6 @@ action (FmuStrategyAction)



### fmu_model_create

Creates an FMU Model Descriptor object and performs any necessary
initialisation of the FMU Model.

Called by `fmi2Instantiate()`.

Called by `fmi3InstantiateCoSimulation()`.

#### Parameters

fmu_inst (void*)
: FMU provided instance data.

mem_alloc (FmuMemAllocFunc)
: Function pointer for the memory allocation function which the Model should
use. Recommend using calloc().

mem_free (FmuMemFreeFunc)
: Function pointer for the memory free function which the Model should use.
Typically free().

#### Returns

FmuModelDesc*
: A new FMU Model Descriptor object.



### fmu_model_destroy

Called by `fmi2FreeInstance()`.
Expand Down Expand Up @@ -323,28 +351,6 @@ model_desc (FmuModelDesc*)



### storage_get_bucket

Returns a reference/pointer to the requested storage bucket.

#### Parameters

model_desc (FmuModelDesc*)
: Model Descriptor.

type (storage_type)
: Indicate the storage type bucket which should be retrieved.

#### Returns

storage_bucket*
: Reference to the requested storage bucket.

NULL
: The specified storage bucket is not provisioned.



### storage_init

Initialise the storage subsystem for an FMU.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 14703ef

Please sign in to comment.