OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Global Project Methods

Global methods associated with a SWMM project. More...

Collaboration diagram for Global Project Methods:

Functions

void project_open (const char *inp_file, const char *rpt_file, const char *out_file)
 Opens a new SWMM project.
 
void project_close (void)
 Close project.
 
void project_readInput (void)
 Read project inputs.
 
int project_readOption (char *s1, char *s2)
 Reads a project option from a pair of string tokens.
 
void project_validate (void)
 Checks validity of project data.
 
int project_init (void)
 Initializes the internal state of the project.
 
int project_addObject (int type, char *id, int n)
 Adds an object Id to a hash table.
 
int project_findObject (int type, const char *id)
 Uses hash table to find index of an object with a given ID.
 
char * project_findID (int type, char *id)
 Uses hash table to find address of a given string entry.
 
double ** project_createMatrix (int nrows, int ncols)
 Allocates memory for a matrix of doubles.
 
void project_freeMatrix (double **m)
 Frees memory allocated for a matrix of doubles.
 

Detailed Description

Global methods associated with a SWMM project.

Function Documentation

◆ project_addObject()

int project_addObject ( int type,
char * id,
int n )

Adds an object Id to a hash table.

Parameters
[in]typeObject type
[in]idObject ID string
[in]nObject index
Returns
0 if object already added, 1 if not, -1 if hashing fails

Adds an object Id to a hash table.

Implementation arguments
  • type (in): Object type.
  • id (borrowed/value): Object ID string.
  • n (in): Object index.
Returns
0 if object already added, 1 if not, -1 if hashing fails.
Here is the call graph for this function:

◆ project_close()

void project_close ( void )

Close project.

Close project.

◆ project_createMatrix()

double ** project_createMatrix ( int nrows,
int ncols )

Allocates memory for a matrix of doubles.

Parameters
[in]nrowsNumber of rows (0-based)
[in]ncolsNumber of columns (0-based)
Returns
Pointer to a matrix of doubles
Implementation arguments
  • nrows (in): Number of rows (0-based).
  • ncols (in): Number of columns (0-based).
Returns
A pointer to a matrix.

◆ project_findID()

char * project_findID ( int type,
char * id )

Uses hash table to find address of a given string entry.

Parameters
[in]typeObject type
[in]idID name being sought
Returns
Pointer to location where object's ID string is stored

Uses hash table to find address of a given string entry.

Implementation arguments
  • type (in): Object type.
  • id (borrowed/value): ID name being sought.
Returns
Pointer to location where object's ID string is stored.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ project_findObject()

int project_findObject ( int type,
const char * id )

Uses hash table to find index of an object with a given ID.

Parameters
[in]typeObject type
[in]idObject ID string
Returns
Returns index of object with given ID, or -1 if not found
Implementation arguments
  • type (in): Object type.
  • id (in): Object ID.
Returns
Index of object with given ID, or -1 if ID not found.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ project_freeMatrix()

void project_freeMatrix ( double ** a)

Frees memory allocated for a matrix of doubles.

Parameters
aMatrix of floats.
Here is the caller graph for this function:

◆ project_init()

int project_init ( void )

Initializes the internal state of the project.

Initializes the internal state of the project.

Returns
An error code.
Here is the call graph for this function:

◆ project_open()

void project_open ( const char * inp_file,
const char * rpt_file,
const char * out_file )

Opens a new SWMM project.

Parameters
[in]inp_fileSWMM input file
[in]rpt_fileSWMM report file
[in]out_fileSWMM output file
Implementation arguments
  • inp_file (in): SWMM input file
  • rpt_file (in): SWMM report file
  • out_file (in): SWMM output file

◆ project_readInput()

void project_readInput ( void )

Read project inputs.

Read project inputs.

Here is the call graph for this function:

◆ project_readOption()

int project_readOption ( char * s1,
char * s2 )

Reads a project option from a pair of string tokens.

Parameters
[in]s1Option keyword
[in]s2String representation of option's value
Returns
Error code
Note
All project options have default values assigned in setDefaults().
Implementation arguments
  • s1 (borrowed/value): Option keyword.
  • s2 (borrowed/value): String representation of option's value.
Returns
Error code.
Note
All project options have default values assigned in setDefaults().
Here is the call graph for this function:

◆ project_validate()

void project_validate ( void )

Checks validity of project data.

Here is the call graph for this function: