xData_2d_xy.cc File Reference

#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include "xData.h"

Go to the source code of this file.

Functions

int xData_init_2d_xy (statusMessageReporting *smr, xData_element *element)
int xData_is_2d_xy (statusMessageReporting *smr, xDataType *xDT, int setMsg)
int xData_isElement_2d_xy (statusMessageReporting *smr, xData_element *element, int setMsg)
double * xData_2d_xy_allocateCopyData (statusMessageReporting *smr, xData_element *element, xData_Int *length)
int xData_2d_xy_free_copyData (statusMessageReporting *smr, void *data)


Function Documentation

double* xData_2d_xy_allocateCopyData ( statusMessageReporting *  smr,
xData_element *  element,
xData_Int *  length 
)

Definition at line 84 of file xData_2d_xy.cc.

References xData_isElement_2d_xy().

Referenced by tpia_misc_get2dx_y_data().

00084                                                                                                                {
00085 
00086     xData_Int i;
00087     xDataType *xDT = &(element->xDataTypeInfo);
00088     double *data;
00089 
00090     if( !xData_isElement_2d_xy( smr, element, 1 ) ) return( NULL );
00091     *length = xDT->length;
00092     //if( ( data = xData_malloc2( smr, 2 * xDT->length * sizeof( double ), 0, "data" ) ) ) {
00093     if( ( data = (double*)xData_malloc2( smr, 2 * xDT->length * sizeof( double ), 0, "data" ) ) ) {
00094         for( i = 0; i < 2 * xDT->length; i++ ) data[i] = ((double *) xDT->data)[i];
00095     }
00096     return( data );
00097 }

int xData_2d_xy_free_copyData ( statusMessageReporting *  smr,
void *  data 
)

Definition at line 101 of file xData_2d_xy.cc.

References xData_free().

00101                                                                          {
00102 
00103     xData_free( smr, data );
00104     return( 0 );
00105 }

int xData_init_2d_xy ( statusMessageReporting *  smr,
xData_element *  element 
)

Definition at line 54 of file xData_2d_xy.cc.

References xData_xDataTypeConvertAttributes().

00054                                                                             {
00055 
00056     xDataType *xDT = &(element->xDataTypeInfo);
00057 
00058     xDT->status = xData_xDataType_Ok;
00059     xDT->typeString = xData_twod_xy_ID;
00060     xDT->element = element;
00061     xDT->toData = toData;
00062     xDT->toString = toString;
00063     xDT->release = release;
00064     xDT->data = NULL;
00065     return( xData_xDataTypeConvertAttributes( smr, element ) );
00066 }

int xData_is_2d_xy ( statusMessageReporting *  smr,
xDataType *  xDT,
int  setMsg 
)

Definition at line 70 of file xData_2d_xy.cc.

References xData_is_xDataType().

Referenced by tpia_misc_get2dx_y_data(), and xData_isElement_2d_xy().

00070                                                                               {
00071 
00072     return( xData_is_xDataType( smr, xDT, xData_twod_xy_ID, setMsg ) );
00073 }

int xData_isElement_2d_xy ( statusMessageReporting *  smr,
xData_element *  element,
int  setMsg 
)

Definition at line 77 of file xData_2d_xy.cc.

References xData_is_2d_xy().

Referenced by xData_2d_xy_allocateCopyData().

00077                                                                                              {
00078 
00079     return( xData_is_2d_xy( smr, &(element->xDataTypeInfo), setMsg ) );
00080 }


Generated on Mon May 27 17:51:17 2013 for Geant4 by  doxygen 1.4.7