Global methods associated with a SWMM project.
More...
|
| 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.
|
| |
Global methods associated with a SWMM project.
◆ project_addObject()
| int project_addObject |
( |
int |
type, |
|
|
char * |
id, |
|
|
int |
n |
|
) |
| |
Adds an object Id to a hash table.
- Parameters
-
| [in] | type | Object type |
| [in] | id | Object ID string |
| [in] | n | Object index |
- Returns
- 0 if object already added, 1 if not, -1 if hashing fails
◆ project_close()
| void project_close |
( |
void |
| ) |
|
◆ project_createMatrix()
| double ** project_createMatrix |
( |
int |
nrows, |
|
|
int |
ncols |
|
) |
| |
Allocates memory for a matrix of doubles.
- Parameters
-
| [in] | nrows | Number of rows (0-based) |
| [in] | ncols | Number of columns (0-based) |
- Returns
- Pointer to a matrix of doubles
◆ project_findID()
| char * project_findID |
( |
int |
type, |
|
|
char * |
id |
|
) |
| |
Uses hash table to find address of a given string entry.
- Parameters
-
| [in] | type | Object type |
| [in] | id | ID name being sought |
- Returns
- Pointer to location where object's ID string is stored
◆ 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] | type | Object type |
| [in] | id | Object ID string |
- Returns
- Returns index of object with given ID, or -1 if not found
◆ project_freeMatrix()
| void project_freeMatrix |
( |
double ** |
m | ) |
|
Frees memory allocated for a matrix of doubles.
◆ project_init()
| int project_init |
( |
void |
| ) |
|
Initializes the internal state of the project.
◆ 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_file | SWMM input file |
| [in] | rpt_file | SWMM report file |
| [in] | out_file | SWMM output file |
◆ project_readInput()
| void project_readInput |
( |
void |
| ) |
|
◆ project_readOption()
| int project_readOption |
( |
char * |
s1, |
|
|
char * |
s2 |
|
) |
| |
Reads a project option from a pair of string tokens.
- Parameters
-
| [in] | s1 | Option keyword |
| [in] | s2 | String representation of option's value |
- Returns
- Error code
- Note
- All project options have default values assigned in setDefaults().
◆ project_validate()
| void project_validate |
( |
void |
| ) |
|
Checks validity of project data.