Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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

◆ xData_2d_xy_allocateCopyData()

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

Definition at line 84 of file xData_2d_xy.cc.

84 {
85
86 xData_Int i;
87 xDataType *xDT = &(element->xDataTypeInfo);
88 double *data;
89
90 if( !xData_isElement_2d_xy( smr, element, 1 ) ) return( NULL );
91 *length = xDT->length;
92 //if( ( data = xData_malloc2( smr, 2 * xDT->length * sizeof( double ), 0, "data" ) ) ) {
93 if( ( data = (double*)xData_malloc2( smr, 2 * xDT->length * sizeof( double ), 0, "data" ) ) ) {
94 for( i = 0; i < 2 * xDT->length; i++ ) data[i] = ((double *) xDT->data)[i];
95 }
96 return( data );
97}
xData_Int length
Definition: xData.h:162
void * data
Definition: xData.h:163
xDataType xDataTypeInfo
Definition: xData.h:187
#define xData_malloc2(smr, size, zero, forItem)
Definition: xData.h:313
int xData_Int
Definition: xData.h:50
int xData_isElement_2d_xy(statusMessageReporting *smr, xData_element *element, int setMsg)
Definition: xData_2d_xy.cc:77

Referenced by tpia_misc_get2dx_y_data().

◆ xData_2d_xy_free_copyData()

int xData_2d_xy_free_copyData ( statusMessageReporting smr,
void *  data 
)

Definition at line 101 of file xData_2d_xy.cc.

101 {
102
103 xData_free( smr, data );
104 return( 0 );
105}
void * xData_free(statusMessageReporting *smr, void *p)
Definition: xDataMisc.cc:89

◆ xData_init_2d_xy()

int xData_init_2d_xy ( statusMessageReporting smr,
xData_element element 
)

Definition at line 54 of file xData_2d_xy.cc.

54 {
55
56 xDataType *xDT = &(element->xDataTypeInfo);
57
60 xDT->element = element;
61 xDT->toData = toData;
62 xDT->toString = toString;
63 xDT->release = release;
64 xDT->data = NULL;
65 return( xData_xDataTypeConvertAttributes( smr, element ) );
66}
xData_element * element
Definition: xData.h:157
enum xData_xDataType status
Definition: xData.h:155
xDT_releaseFunction release
Definition: xData.h:160
const char * typeString
Definition: xData.h:156
xDT_toStringFunction toString
Definition: xData.h:159
xDT_toDataFunction toData
Definition: xData.h:158
int xData_xDataTypeConvertAttributes(statusMessageReporting *smr, xData_element *element)
Definition: xData.cc:668
char const *const xData_twod_xy_ID
Definition: xData.h:72
@ xData_xDataType_Ok
Definition: xData.h:81

◆ xData_is_2d_xy()

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

Definition at line 70 of file xData_2d_xy.cc.

70 {
71
72 return( xData_is_xDataType( smr, xDT, xData_twod_xy_ID, setMsg ) );
73}
int xData_is_xDataType(statusMessageReporting *smr, xDataType *xDT, char const *const type, int setMsg)
Definition: xData.cc:900

Referenced by tpia_misc_get2dx_y_data(), and xData_isElement_2d_xy().

◆ xData_isElement_2d_xy()

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

Definition at line 77 of file xData_2d_xy.cc.

77 {
78
79 return( xData_is_2d_xy( smr, &(element->xDataTypeInfo), setMsg ) );
80}
int xData_is_2d_xy(statusMessageReporting *smr, xDataType *xDT, int setMsg)
Definition: xData_2d_xy.cc:70

Referenced by xData_2d_xy_allocateCopyData().