cta_model_utilities.h File Reference

A set of utilities that simplify the creation of COSTA model components. More...

#include "cta_system.h"
#include "cta_handles.h"
#include "cta_datatypes.h"
#include "cta_tree.h"
#include "cta_string.h"

Go to the source code of this file.

Functions

CTAEXPORT int CTA_Model_Util_InputTree (CTA_Handle hinput, CTA_Tree *tinput, int *cleanup)
 Handles model configuration tree or name of input xml-file.

Detailed Description

A set of utilities that simplify the creation of COSTA model components.

A set of utility routines. These routines are originally designed for the rapid development of COSTA model components. But their use is not limited to model components.

Note:
This is just a set of utility routines it does not define any COSTA component

Definition in file cta_model_utilities.h.


Function Documentation

CTAEXPORT int CTA_Model_Util_InputTree ( CTA_Handle  hinput,
CTA_Tree tinput,
int *  cleanup 
)

Handles model configuration tree or name of input xml-file.

When a new instance of the a model component is created it needs some input. The most convenient way is to provide the root to a COSTA-tree with configuration information the name of a XML-configuration file This routine will check whether the input handle is a COSTA-tree or the name of a XML-configuration file. A COSTA-tree containing the content of the XML-file is created when the input is the name of the XML-file.

Note:
A COSTA-tree is created if the input is the name of an XML-file. the handle of the input tree is returned otherwise. This means that depending on the input, a tree is created. The routine will return whether the returned tree is created by this routine. The caller is responsible for freeing the tree when necessary.
Parameters:
hinput I handle of tree (CTA_Tree) with model input or string (CTA_Sring) with name of xml-input file
tinput O receives handle of tree (CTA_Tree) with model input
cleanup O receives flag (CTA_TRUE/CTA_FALSE) indicating whether tinput is created and must be freed by the caller
Returns:
error status: CTA_OK if successful

Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1