Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cse::variable_index #265 #339

Merged
merged 3 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions include/cse.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ typedef int64_t cse_time_point;
/// The type used to specify (simulation) time durations. The time unit is nanoseconds.
typedef int64_t cse_duration;

/// Variable index.
typedef uint32_t cse_variable_index;
/// value reference.
typedef uint32_t cse_value_reference;

/// Slave index.
typedef int cse_slave_index;
Expand Down Expand Up @@ -333,8 +333,8 @@ typedef struct
{
/// The name of the variable.
char name[SLAVE_NAME_MAX_SIZE];
/// The variable index.
cse_variable_index index;
/// The value reference.
cse_value_reference reference;
/// The variable type.
cse_variable_type type;
/// The variable causality.
Expand Down Expand Up @@ -384,8 +384,8 @@ typedef struct
cse_slave_index slave_index;
/// The type of the variable.
cse_variable_type type;
/// The index of the variable.
cse_variable_index variable_index;
/// The variable's value reference.
cse_value_reference value_reference;
} cse_variable_id;


Expand Down Expand Up @@ -430,7 +430,7 @@ typedef struct cse_manipulator_s cse_manipulator;
* The slave.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to set.
* value references of variables to set.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -443,7 +443,7 @@ typedef struct cse_manipulator_s cse_manipulator;
int cse_manipulator_slave_set_real(
cse_manipulator* manipulator,
cse_slave_index slaveIndex,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
const double values[]);

Expand All @@ -456,7 +456,7 @@ int cse_manipulator_slave_set_real(
* The slave.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to set.
* value references of variables to set.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -469,7 +469,7 @@ int cse_manipulator_slave_set_real(
int cse_manipulator_slave_set_integer(
cse_manipulator* manipulator,
cse_slave_index slaveIndex,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
const int values[]);

Expand All @@ -482,7 +482,7 @@ int cse_manipulator_slave_set_integer(
* The slave.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to set.
* value references of variables to set.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -495,7 +495,7 @@ int cse_manipulator_slave_set_integer(
int cse_manipulator_slave_set_boolean(
cse_manipulator* manipulator,
cse_slave_index slaveIndex,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
const bool values[]);

Expand All @@ -508,7 +508,7 @@ int cse_manipulator_slave_set_boolean(
* The slave.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to set.
* value references of variables to set.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -521,7 +521,7 @@ int cse_manipulator_slave_set_boolean(
int cse_manipulator_slave_set_string(
cse_manipulator* manipulator,
cse_slave_index slaveIndex,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
const char* values[]);

Expand All @@ -536,7 +536,7 @@ int cse_manipulator_slave_set_string(
* The variable type.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to reset.
* value references of variables to reset.
* \param [in] nv
* The length of the `variables` array.
*
Expand All @@ -547,7 +547,7 @@ int cse_manipulator_slave_reset(
cse_manipulator* manipulator,
cse_slave_index slaveIndex,
cse_variable_type type,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv);

/**
Expand All @@ -559,7 +559,7 @@ int cse_manipulator_slave_reset(
* The slave.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to retrieve.
* value references of variables to retrieve.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -572,7 +572,7 @@ int cse_manipulator_slave_reset(
int cse_observer_slave_get_real(
cse_observer* observer,
cse_slave_index slave,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
double values[]);

Expand All @@ -585,7 +585,7 @@ int cse_observer_slave_get_real(
* The slave index.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to retrieve.
* value references of variables to retrieve.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -598,7 +598,7 @@ int cse_observer_slave_get_real(
int cse_observer_slave_get_integer(
cse_observer* observer,
cse_slave_index slave,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
int values[]);

Expand All @@ -611,7 +611,7 @@ int cse_observer_slave_get_integer(
* The slave index.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to retrieve.
* value references of variables to retrieve.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -624,7 +624,7 @@ int cse_observer_slave_get_integer(
int cse_observer_slave_get_boolean(
cse_observer* observer,
cse_slave_index slave,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
bool values[]);

Expand All @@ -637,7 +637,7 @@ int cse_observer_slave_get_boolean(
* The slave index.
* \param [in] variables
* A pointer to an array of length `nv` that contains the (slave-specific)
* indices of variables to retrieve.
* value references of variables to retrieve.
* \param [in] nv
* The length of the `variables` and `values` arrays.
* \param [out] values
Expand All @@ -651,7 +651,7 @@ int cse_observer_slave_get_boolean(
int cse_observer_slave_get_string(
cse_observer* observer,
cse_slave_index slave,
const cse_variable_index variables[],
const cse_value_reference variables[],
size_t nv,
const char* values[]);

Expand All @@ -660,7 +660,7 @@ int cse_observer_slave_get_string(
*
* \param [in] observer the observer
* \param [in] slave index of the slave
* \param [in] variableIndex the variable index
* \param [in] valueReference the value reference
* \param [in] fromStep the step number to start from
* \param [in] nSamples the number of samples to read
* \param [out] values the series of observed values
Expand All @@ -673,7 +673,7 @@ int cse_observer_slave_get_string(
int64_t cse_observer_slave_get_real_samples(
cse_observer* observer,
cse_slave_index slave,
cse_variable_index variableIndex,
cse_value_reference valueReference,
cse_step_number fromStep,
size_t nSamples,
double values[],
Expand All @@ -685,7 +685,7 @@ int64_t cse_observer_slave_get_real_samples(
*
* \param [in] observer the observer
* \param [in] slave index of the slave
* \param [in] variableIndex the variable index
* \param [in] valueReference the value reference
* \param [in] fromStep the step number to start from
* \param [in] nSamples the number of samples to read
* \param [out] values the series of observed values
Expand All @@ -698,7 +698,7 @@ int64_t cse_observer_slave_get_real_samples(
int64_t cse_observer_slave_get_integer_samples(
cse_observer* observer,
cse_slave_index slave,
cse_variable_index variableIndex,
cse_value_reference valueReference,
cse_step_number fromStep,
size_t nSamples,
int values[],
Expand All @@ -710,9 +710,9 @@ int64_t cse_observer_slave_get_integer_samples(
*
* \param [in] observer the observer
* \param [in] slave1 index of the first slave
* \param [in] variableIndex1 the first variable index
* \param [in] valueReference the first value reference
* \param [in] slave2 index of the second slave
* \param [in] variableIndex2 the second variable index
* \param [in] valueReference the second value reference
* \param [in] fromStep the step number to start from
* \param [in] nSamples the number of samples to read
* \param [out] values1 the first series of observed values
Expand All @@ -724,9 +724,9 @@ int64_t cse_observer_slave_get_integer_samples(
int64_t cse_observer_slave_get_real_synchronized_series(
cse_observer* observer,
cse_slave_index slave1,
cse_variable_index variableIndex1,
cse_value_reference valueReference1,
cse_slave_index slave2,
cse_variable_index variableIndex2,
cse_value_reference valueReference2,
cse_step_number fromStep,
size_t nSamples,
double values1[],
Expand Down Expand Up @@ -781,11 +781,11 @@ int cse_observer_get_step_numbers(
* The execution.
* \param [in] outputSlaveIndex
* The source slave.
* \param [in] outputVariableIndex
* \param [in] outputValueReference
* The source variable.
* \param [in] inputSlaveIndex
* The destination slave.
* \param [in] inputVariableIndex
* \param [in] inputValueReference
* The destination variable.
*
* \returns
Expand All @@ -794,9 +794,9 @@ int cse_observer_get_step_numbers(
int cse_execution_connect_real_variables(
cse_execution* execution,
cse_slave_index outputSlaveIndex,
cse_variable_index outputVariableIndex,
cse_value_reference outputValueReference,
cse_slave_index inputSlaveIndex,
cse_variable_index inputVariableIndex);
cse_value_reference inputValueReference);

/**
* Connects one integer output variable to one integer input variable.
Expand All @@ -805,11 +805,11 @@ int cse_execution_connect_real_variables(
* The execution.
* \param [in] outputSlaveIndex
* The source slave.
* \param [in] outputVariableIndex
* \param [in] outputValueReference
* The source variable.
* \param [in] inputSlaveIndex
* The destination slave.
* \param [in] inputVariableIndex
* \param [in] inputValueReference
* The destination variable.
*
* \returns
Expand All @@ -818,9 +818,9 @@ int cse_execution_connect_real_variables(
int cse_execution_connect_integer_variables(
cse_execution* execution,
cse_slave_index outputSlaveIndex,
cse_variable_index outputVariableIndex,
cse_value_reference outputValueReference,
cse_slave_index inputSlaveIndex,
cse_variable_index inputVariableIndex);
cse_value_reference inputValueReference);


/// Creates an observer which stores the last observed value for all variables.
Expand Down Expand Up @@ -864,10 +864,10 @@ cse_observer* cse_time_series_observer_create();
cse_observer* cse_buffered_time_series_observer_create(size_t bufferSize);

/// Start observing a variable with a `time_series_observer`.
int cse_observer_start_observing(cse_observer* observer, cse_slave_index slave, cse_variable_type type, cse_variable_index index);
int cse_observer_start_observing(cse_observer* observer, cse_slave_index slave, cse_variable_type type, cse_value_reference reference);

/// Stop observing a variable with a `time_series_observer`.
int cse_observer_stop_observing(cse_observer* observer, cse_slave_index slave, cse_variable_type type, cse_variable_index index);
int cse_observer_stop_observing(cse_observer* observer, cse_slave_index slave, cse_variable_type type, cse_value_reference reference);

/// Destroys an observer
int cse_observer_destroy(cse_observer* observer);
Expand Down
Loading