cta_functions.h File Reference
Functions for working with CTA_Function objects. CTA_Function objects can be used to address functions.
More...
#include "cta_system.h"
#include "cta_datatypes.h"
#include "cta_handles.h"
#include "cta_interface.h"
#include "ctai_xml.h"
Go to the source code of this file.
Typedefs |
typedef CTA_Handle | CTA_Func |
Functions |
CTAEXPORT int | CTA_Func_Create (const char *name, CTA_Function *function, const CTA_Intf hintf, CTA_Func *hfunc) |
| Create a new COSTA function.
|
CTAEXPORT CTA_Func | CTA_CreateFuncDynamicLib (char *libraryName, char *functionName, char *name, char *id) |
| Create a COSTA function loaded from dynamic library.
|
CTAEXPORT int | CTA_Func_Duplicate (CTA_Func hfunc, CTA_Func *hdupl) |
| Duplicates a user defined function.
|
CTAEXPORT int | CTA_Func_Free (CTA_Func *hfunc) |
| Free a new COSTA function.
|
CTAEXPORT int | CTA_Func_GetIntf (const CTA_Func hfunc, CTA_Intf *hintf) |
| Get interface of COSTA function.
|
CTAEXPORT int | CTA_Func_GetFunc (const CTA_Func hfunc, CTA_Function **function) |
| Get function pointer of function.
|
CTAEXPORT int | CTA_Func_GetName (const CTA_Func hfunc, CTA_String name) |
| Get name of function.
|
CTAEXPORT int | CTA_Func_SetUserdata (const CTA_Func hfunc, const CTA_Handle userdata) |
| Set userdata of function.
|
CTAEXPORT int | CTA_Func_GetUserdata (const CTA_Func hfunc, CTA_Handle userdata) |
| Get userdata of function.
|
CTAEXPORT CTA_Func | CTAI_XML_CreateFunc (xmlNode *cur_node) |
| Create a COSTA function from XML (load from dynamic load library).
|
Detailed Description
Functions for working with CTA_Function objects. CTA_Function objects can be used to address functions.
Definition in file cta_functions.h.
Typedef Documentation
Function Documentation
CTAEXPORT CTA_Func CTA_CreateFuncDynamicLib |
( |
char * |
libraryName, |
|
|
char * |
functionName, |
|
|
char * |
name, |
|
|
char * |
id | |
|
) |
| | |
Create a COSTA function loaded from dynamic library.
- Parameters:
-
| libraryName | I Name of the dynamic library excluding the extention (.dll, .so, .dylib) eg "libmyroutines" |
| functionName | I Name of the function to load. |
| name | I Name of the function used inside the OpenDA administration |
| id | I Name (id) of the handle that is created (needed when stored as part of a tree |
- Returns:
- Handle to function or CTA_NULL in case of an error.
- Note:
- When the load of the function fails, some decorated, typical Fortran variations are tried as well
Create a new COSTA function.
- Note:
- Argument name is only used for debugging and output.
- Parameters:
-
| name | I name of the new function for debugging purposes |
| function | I pointer to function that has to be associated with new COSTA function |
| hintf | I handle of associated interface |
| hfunc | O receives handle of created COSTA function |
- Returns:
- CTA_OK if successful
Referenced by usr_SP_Model_CreateFunc().
Duplicates a user defined function.
- Parameters:
-
| hfunc | I COSTA user function handle |
| hdupl | I duplication of hfunc |
- Returns:
- error status: CTA_OK
CTAEXPORT int CTA_Func_Free |
( |
CTA_Func * |
hfunc |
) |
|
Free a new COSTA function.
- Note:
- Parameters:
-
| hfunc | IO handle of COSTA function, replaced by CTA_NULL on return |
- Returns:
- CTA_OK if sucessful
Get function pointer of function.
- Note:
- There is no FORTRAN verion of this function available
- Parameters:
-
| hfunc | I handle of COSTA function. |
| function | O receives pointer to function |
- Returns:
- CTA_OK if successful
Get interface of COSTA function.
- Note:
- For performance reasons, the interface is not a copy but a handle to the actual interface, it should NOT be freed by the calling routine!
- Parameters:
-
| hfunc | I handle of COSTA function |
| hintf | O receives handle of interface of function |
- Returns:
- CTA_OK if successful
Get name of function.
- Note:
- Future versions will return a COSTA string handle.
- Parameters:
-
| hfunc | I handle of COSTA function. |
| name | O handle of string object that is to receive function name, must exist before calling |
- Returns:
- CTA_OK if successful
Get userdata of function.
- Parameters:
-
| hfunc | I handle of COSTA function. |
| userdata | O userdata handle |
- Returns:
- CTA_OK if successful
Set userdata of function.
- Note:
- Frees existing user data and replaces it with userdata
- Parameters:
-
| hfunc | IO handle of COSTA function. |
| userdata | I new userdata handles |
- Returns:
- CTA_OK if successful
CTAEXPORT CTA_Func CTAI_XML_CreateFunc |
( |
xmlNode * |
cur_node |
) |
|
Create a COSTA function from XML (load from dynamic load library).
- Parameters:
-
| cur_node | I Current XML node |
- Returns:
- Handle to create or CTA_NULL in case of an error.