MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
geometryproperty.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#include "geometryproperty.h"
8
9#include "globals.h"
10
11using namespace std;
12
14 DEBUG("GeometryProperty::~GeometryProperty entry", MAIA_DEBUG_ALLOCATION);
15
16 DEBUG("GeometryProperty::~GeometryProperty return", MAIA_DEBUG_ALLOCATION);
17}
18
20 TRACE();
21 switch(propertyType) {
22 case MINT: {
23 delete[] intField;
24 break;
25 }
26 case MFLOAT: {
27 delete[] floatField;
28 break;
29 }
30 case MSTRING: {
31 delete[] stringField;
32 break;
33 }
34 default: {
35 stringstream errorMessage;
36 errorMessage << "GeometryProperty::clear(): switch variable 'propertyType' with value " << propertyType
37 << " not matching any case." << endl;
38 mTerm(1, AT_, errorMessage.str());
39 }
40 }
41}
43 DEBUG("GeometryProperty::GeometryProperty entry", MAIA_DEBUG_ALLOCATION);
44 DEBUG("GeometryProperty::GeometryProperty return", MAIA_DEBUG_ALLOCATION);
45}
46
48 // TRACE();
49
50 return propertyType;
51}
52
54 // TRACE();
55 return elements;
56}
57
59 // TRACE();
60 return stringField;
61}
62
64 // TRACE();
65 return intField;
66}
67
69
71 // TRACE();
72 if(index + 1 > elements) {
73 cerr << " GeometryProperty::asString() Requested index out of reach! ";
74 // SX8 cannont compile with exception handling
75 // throw(" Requested index for property out of reach! ");
76 }
77 return (stringField + index);
78}
79
81 // TRACE();
82 if(index + 1 > elements) {
83 cerr << " GeometryProperty::asInt() Requested index out of reach! ";
84 // SX8 cannont compile with exception handling
85 // throw(" Requested index for property out of reach! ");
86 }
87 return (intField + index);
88}
89
91 // TRACE();
92 if(index + 1 > elements) {
93 cerr << " GeometryProperty::asFloat() Requested index out of reach! ";
94 // SX8 cannont compile with exception handling
95 // throw(" Requested index for property out of reach! ");
96 }
97 return (floatField + index);
98}
VariableType type()
VariableType propertyType
VariableType
Definition: enums.h:269
@ MINT
Definition: enums.h:269
@ MFLOAT
Definition: enums.h:269
@ MSTRING
Definition: enums.h:269
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52