cta_handles.h File Reference

Description of functions for working with CTA_Handle objects that are being used to access COSTA objects. More...

#include "cta_datatypes.h"

Go to the source code of this file.

Functions

CTAEXPORT int CTA_Handle_Create (const char *name, const CTA_Datatype datatype, void *data, CTA_Handle *handle)
 Create a new COSTA handle.
CTAEXPORT int CTA_Handle_Free (CTA_Handle *handle)
 Free a COSTA handle.
CTAEXPORT int CTA_Handle_Free_All (CTA_Handle *handle)
 Free a COSTA handle.
CTAEXPORT int CTA_Handle_Check (const CTA_Handle handle, const CTA_Datatype datatype)
 Check whether a handle is valid and checks type.
CTAEXPORT int CTA_Handle_GetData (const CTA_Handle handle, void **data)
 Get pointer to data element of handle.
CTAEXPORT int CTA_Handle_GetValue (const CTA_Handle handle, void *value, CTA_Datatype datatype)
 Get the value the handle points to.
CTAEXPORT int CTA_Handle_GetName (const CTA_Handle handle, CTA_String hname)
 Get name associated with handle.
CTAEXPORT int CTA_Handle_GetDatatype (const CTA_Handle handle, CTA_Datatype *datatype)
 Get data type associated with handle.
CTAEXPORT int CTAI_Handle_SetName (const CTA_Handle handle, const char *name)
 Set name associated with handle (internal use only!).
CTAEXPORT int CTA_Handle_Find (CTA_String sname, CTA_Datatype datatype, int *handlenr)
 Find a handle by name and data type in the COSTA handle administration.
CTAEXPORT int CTA_Handle_Printall ()
 Print overview of all COSTA handles.
CTAEXPORT int CTA_Handle_PrintInfo (const char *location)
 Counts all handles sorts them by type and prints overview. This function can be usefull for detecting memory leaks that are the result of not freeing instances of COSTA objects costa objects.
CTAEXPORT int CTA_Handle_GetRefCount (const CTA_Handle handle, int *refCount)
 Get the reference count of the handle.
CTAEXPORT int CTA_Handle_IncRefCount (const CTA_Handle handle)
 Increase the reference count of the handle.
CTAEXPORT int CTA_Handle_DecrRefCount (const CTA_Handle handle)
 Decrease the reference count of the handle.

Variables

CTAEXPORT typedef int CTA_Handle
CTAEXPORT typedef CTA_Handle CTA_String

Detailed Description

Description of functions for working with CTA_Handle objects that are being used to access COSTA objects.

Definition in file cta_handles.h.


Function Documentation

CTAEXPORT int CTA_Handle_Check ( const CTA_Handle  handle,
const CTA_Datatype  datatype 
)

Check whether a handle is valid and checks type.

Note:
The handle CTA_NULL is not valid.
Parameters:
handle I COSTA handle
datatype I data type to compare handle with
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE, CTA_INCOMPATIBLE_HANDLE
CTAEXPORT int CTA_Handle_Create ( const char *  name,
const CTA_Datatype  datatype,
void *  data,
CTA_Handle handle 
)

Create a new COSTA handle.

Parameters:
name I name associated with handle
datatype I data type of handle
data I block of data associated to handle
handle O receives COSTA handle
Returns:
error status: CTA_OK
CTAEXPORT int CTA_Handle_DecrRefCount ( const CTA_Handle  handle  ) 

Decrease the reference count of the handle.

Parameters:
handle I COSTA handle
Returns:
error status: CTA_OK
CTAEXPORT int CTA_Handle_Find ( CTA_String  sname,
CTA_Datatype  datatype,
int *  handlenr 
)

Find a handle by name and data type in the COSTA handle administration.

Parameters:
sname I name of handle
datatype I data type of handle
handlenr O receives the handle (only if return value is CTA_OK)
Returns:
error status: CTA_OK, CTA_HANDLE_NOT_FOUND
CTAEXPORT int CTA_Handle_Free ( CTA_Handle handle  ) 

Free a COSTA handle.

Note:
The data part of the handle is NOT freed.
Parameters:
handle IO handle that is to be freed, replaced by CTA_NULL on return.
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE
CTAEXPORT int CTA_Handle_Free_All ( CTA_Handle handle  ) 

Free a COSTA handle.

Note:
Calls datatype-specific free methods, if available.
Parameters:
handle IO handle that must be freed, replaced by CTA_NULL on return.
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE
CTAEXPORT int CTA_Handle_GetData ( const CTA_Handle  handle,
void **  data 
)

Get pointer to data element of handle.

Parameters:
handle I COSTA handle
data O receives pointer to data element
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE
CTAEXPORT int CTA_Handle_GetDatatype ( const CTA_Handle  handle,
CTA_Datatype datatype 
)

Get data type associated with handle.

Parameters:
handle I COSTA handle
datatype O receives data type of handle
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE
CTAEXPORT int CTA_Handle_GetName ( const CTA_Handle  handle,
CTA_String  hname 
)

Get name associated with handle.

Parameters:
handle I COSTA handle
hname O receives name of data type
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE
CTAEXPORT int CTA_Handle_GetRefCount ( const CTA_Handle  handle,
int *  refCount 
)

Get the reference count of the handle.

Parameters:
handle I COSTA handle
refCount O reference count of handle
Returns:
error status: CTA_OK
CTAEXPORT int CTA_Handle_GetValue ( const CTA_Handle  handle,
void *  value,
CTA_Datatype  datatype 
)

Get the value the handle points to.

Parameters:
handle I COSTA handle
value O receives pointer to data element
datatype I specify the data type of *value, must be the same as data type of handle
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE, CTA_INCOMPATIBLE_HANDLE
CTAEXPORT int CTA_Handle_IncRefCount ( const CTA_Handle  handle  ) 

Increase the reference count of the handle.

Parameters:
handle I COSTA handle
Returns:
error status: CTA_OK
CTAEXPORT int CTA_Handle_Printall (  ) 

Print overview of all COSTA handles.

Returns:
error status: CTA_OK
CTAEXPORT int CTA_Handle_PrintInfo ( const char *  location  ) 

Counts all handles sorts them by type and prints overview. This function can be usefull for detecting memory leaks that are the result of not freeing instances of COSTA objects costa objects.

Parameters:
location I String to indicate location of call
Returns:
error status: CTA_OK
CTAEXPORT int CTAI_Handle_SetName ( const CTA_Handle  handle,
const char *  name 
)

Set name associated with handle (internal use only!).

Parameters:
handle IO COSTA handle
name I COSTA string
Returns:
error status: CTA_OK, CTA_ILLEGAL_HANDLE

Variable Documentation

CTAEXPORT typedef int CTA_Handle

Definition at line 33 of file cta_handles.h.

CTAEXPORT typedef CTA_Handle CTA_String

Definition at line 36 of file cta_handles.h.


Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1