Fesapi 2.3.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
MacroDefinitions.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
27#define CHECK_RANGE(vector, index) if (index >= vector.size()) { throw std::range_error("The index is out of range"); }
28
37#define GETTER_SETTER_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName, attributeDatatype)\
38 DLL_IMPORT_OR_EXPORT void set##attributeName(const attributeDatatype& value) {\
39 if (isPartial()) { throw std::logic_error("Cannot set an attribute of a partial dataobject."); }\
40 static_cast<gsoapClassName*>(proxyVariable)->attributeName = value;\
41 }\
42 DLL_IMPORT_OR_EXPORT attributeDatatype get##attributeName() const {\
43 if (isPartial()) { throw std::logic_error("Cannot get an attribute of a partial dataobject."); }\
44 return static_cast<gsoapClassName*>(proxyVariable)->attributeName;\
45 }
46
54#define CHECKER_PRESENCE_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName)\
55 DLL_IMPORT_OR_EXPORT bool has##attributeName() const {\
56 return static_cast<gsoapClassName*>(proxyVariable)->attributeName != nullptr;\
57 }
58
67#define CHECKER_PRESENCE_ATTRIBUTE_IN_VECTOR(gsoapClassName, proxyVariable, vectorName, attributeName)\
68 DLL_IMPORT_OR_EXPORT bool has##vectorName##attributeName(unsigned int index) const {\
69 CHECK_RANGE(static_cast<gsoapClassName*>(proxyVariable)->vectorName, index)\
70 return static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName != nullptr;\
71}
72
81#define GETTER_SETTER_OPTIONAL_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName, attributeDatatype)\
82 DLL_IMPORT_OR_EXPORT void set##attributeName(const attributeDatatype& value);\
83 DLL_IMPORT_OR_EXPORT attributeDatatype get##attributeName() const {\
84 if (isPartial()) { throw std::logic_error("Cannot get an attribute of a partial dataobject."); }\
85 if (!has##attributeName()) { throw std::invalid_argument("The attribute does not exist"); }\
86 return *static_cast<gsoapClassName*>(proxyVariable)->attributeName;\
87 }\
88 CHECKER_PRESENCE_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName)
89
98#define GETTER_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName, uomDatatype)\
99 DLL_IMPORT_OR_EXPORT void set##attributeName(double value, uomDatatype uom);\
100 DLL_IMPORT_OR_EXPORT double get##attributeName##Value() const {\
101 if (!has##attributeName()) { throw std::invalid_argument("The attribute does not exist"); }\
102 return static_cast<gsoapClassName*>(proxyVariable)->attributeName->__item;\
103 }\
104 DLL_IMPORT_OR_EXPORT uomDatatype get##attributeName##Uom() const {\
105 if (!has##attributeName()) { throw std::invalid_argument("The attribute does not exist"); }\
106 return static_cast<gsoapClassName*>(proxyVariable)->attributeName->uom;\
107 }\
108 CHECKER_PRESENCE_ATTRIBUTE(gsoapClassName, proxyVariable, attributeName)
109
119#define GETTER_SETTER_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoapClassName, proxyVariable, vectorName, attributeName, attributeDatatype)\
120 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, const attributeDatatype& value);\
121 DLL_IMPORT_OR_EXPORT attributeDatatype get##vectorName##attributeName(unsigned int index) const {\
122 if (!has##vectorName##attributeName(index)) { throw std::invalid_argument("The attribute does not exist"); }\
123 return *static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName;\
124 }\
125 CHECKER_PRESENCE_ATTRIBUTE_IN_VECTOR(gsoapClassName, proxyVariable, vectorName, attributeName)
126
136#define GETTER_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoapClassName, proxyVariable, vectorName, attributeName, uomDatatype)\
137 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom);\
138 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const {\
139 if (!has##vectorName##attributeName(index)) { throw std::invalid_argument("The attribute does not exist"); }\
140 return static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName->__item;\
141 }\
142 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const {\
143 if (!has##vectorName##attributeName(index)) { throw std::invalid_argument("The attribute does not exist"); }\
144 return static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName->uom;\
145 }\
146 CHECKER_PRESENCE_ATTRIBUTE_IN_VECTOR(gsoapClassName, proxyVariable, vectorName, attributeName)
147
158#define SETTER_OPTIONAL_ATTRIBUTE_IMPL(className, gsoapClassName, proxyVariable, attributeName, attributeDatatype, constructor)\
159void className::set##attributeName(const attributeDatatype& value)\
160{\
161 if (isPartial()) { throw std::logic_error("Cannot set an attribute of a partial dataobject."); }\
162 static_cast<gsoapClassName*>(proxyVariable)->attributeName = constructor(proxyVariable->soap);\
163 *static_cast<gsoapClassName*>(proxyVariable)->attributeName = value;\
164}
165
176#define SETTER_MEASURE_ATTRIBUTE_IMPL(className, gsoapClassName, proxyVariable, attributeName, uomDatatype, constructor)\
177void className::set##attributeName(double value, uomDatatype uom)\
178{\
179 static_cast<gsoapClassName*>(proxyVariable)->attributeName = constructor(proxyVariable->soap);\
180 static_cast<gsoapClassName*>(proxyVariable)->attributeName->__item = value;\
181 static_cast<gsoapClassName*>(proxyVariable)->attributeName->uom = uom;\
182}
183
195#define SETTER_OPTIONAL_ATTRIBUTE_IN_VECTOR_IMPL(className, gsoapClassName, proxyVariable, vectorName, attributeName, attributeDatatype, constructor)\
196void className::set##vectorName##attributeName(unsigned int index, const attributeDatatype& value)\
197{\
198 CHECK_RANGE(static_cast<gsoapClassName*>(proxyVariable)->vectorName, index)\
199 static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName = constructor(proxyVariable->soap);\
200 *static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName = value;\
201}
202
214#define SETTER_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, gsoapClassName, proxyVariable, vectorName, attributeName, uomDatatype, constructor)\
215void className::set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom)\
216{\
217 CHECK_RANGE(static_cast<gsoapClassName*>(proxyVariable)->vectorName, index)\
218 static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName = constructor(proxyVariable->soap);\
219 static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName->__item = value;\
220 static_cast<gsoapClassName*>(proxyVariable)->vectorName[index]->attributeName->uom = uom;\
221}
222
231#define GLUE(a,b) a##b
232
239#define CHECK_ATTRIBUTE_EXISTENCE(className, attributeName) if (static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName == nullptr) { throw std::invalid_argument("The attribute does not exist"); }
240
248#define CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName) \
249 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
250 if (static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName == nullptr) { throw std::invalid_argument("The attribute in vector does not exist"); }
251
259#define CREATE_ATTRIBUTE_IF_NOT_PRESENT(className, attributeName, constructor) if (static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName == nullptr) { static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName = constructor(gsoapProxy2_1->soap); }
260
269#define CREATE_ATTRIBUTE_IN_VECTOR_IF_NOT_PRESENT(className, vectorName, attributeName, constructor)\
270 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
271 if (static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName == nullptr) { static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName = constructor(gsoapProxy2_1->soap); }
272
278#define ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(attributeName) DLL_IMPORT_OR_EXPORT virtual bool has##attributeName() const = 0;
279
285#define FINAL_GETTER_PRESENCE_ATTRIBUTE(attributeName) DLL_IMPORT_OR_EXPORT bool has##attributeName() const final;
286
292#define GETTER_PRESENCE_ATTRIBUTE(attributeName) DLL_IMPORT_OR_EXPORT bool has##attributeName() const;
293
300#define GETTER_PRESENCE_ATTRIBUTE_IMPL(className, attributeName) bool GLUE(,className)::has##attributeName() const { return static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName != nullptr; }
301
308#define ABSTRACT_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName) DLL_IMPORT_OR_EXPORT virtual bool has##vectorName##attributeName(unsigned int index) const = 0;
309
316#define FINAL_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName) DLL_IMPORT_OR_EXPORT bool has##vectorName##attributeName(unsigned int index) const final;
317
324#define GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName) DLL_IMPORT_OR_EXPORT bool has##vectorName##attributeName(unsigned int index) const;
325
333#define GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName) bool GLUE(,className)::has##vectorName##attributeName(unsigned int index) const {\
334 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
335 return static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName != nullptr;\
336}
337
344#define ABSTRACT_GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
345 DLL_IMPORT_OR_EXPORT virtual void set##attributeName(const attributeDatatype & value) = 0;\
346 DLL_IMPORT_OR_EXPORT virtual attributeDatatype get##attributeName() const = 0;
347
354#define FINAL_GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
355 DLL_IMPORT_OR_EXPORT void set##attributeName(const attributeDatatype & value) final;\
356 DLL_IMPORT_OR_EXPORT attributeDatatype get##attributeName() const final;
357
364#define GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
365 DLL_IMPORT_OR_EXPORT void set##attributeName(const attributeDatatype & value);\
366 DLL_IMPORT_OR_EXPORT attributeDatatype get##attributeName() const;
367
375#define GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IMPL(attributeDatatype, className, attributeName)\
376 void GLUE(,className)::set##attributeName(const attributeDatatype & value) { static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName = value; }\
377 attributeDatatype GLUE(,className)::get##attributeName() const { return static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName; }
378
386#define ABSTRACT_GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
387 DLL_IMPORT_OR_EXPORT virtual void set##vectorName##attributeName(unsigned int index, const attributeDatatype & value) = 0;\
388 DLL_IMPORT_OR_EXPORT virtual attributeDatatype get##vectorName##attributeName(unsigned int index) const = 0;
389
397#define FINAL_GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
398 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, const attributeDatatype & value) final;\
399 DLL_IMPORT_OR_EXPORT attributeDatatype get##vectorName##attributeName(unsigned int index) const final;
400
408#define GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
409 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, const attributeDatatype & value);\
410 DLL_IMPORT_OR_EXPORT attributeDatatype get##vectorName##attributeName(unsigned int index) const;
411
420#define GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR_IMPL(attributeDatatype, className, vectorName, attributeName)\
421 void GLUE(,className)::set##vectorName##attributeName(unsigned int index, const attributeDatatype & value) {\
422 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
423 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName = value;\
424 }\
425 attributeDatatype GLUE(,className)::get##vectorName##attributeName(unsigned int index) const {\
426 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
427 return static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName;\
428 }
429
436#define ABSTRACT_GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE(attributeDatatype, attributeName)\
437 ABSTRACT_GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
438 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(attributeName)
439
446#define FINAL_GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE(attributeDatatype, attributeName)\
447 FINAL_GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
448 FINAL_GETTER_PRESENCE_ATTRIBUTE(attributeName)
449
456#define GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE(attributeDatatype, attributeName)\
457 GETTER_AND_SETTER_GENERIC_ATTRIBUTE(attributeDatatype, attributeName)\
458 GETTER_PRESENCE_ATTRIBUTE(attributeName)
459
468#define GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IMPL(attributeDatatype, className, attributeName, constructor)\
469 void GLUE(,className)::set##attributeName(const attributeDatatype & attributeName) {\
470 CREATE_ATTRIBUTE_IF_NOT_PRESENT(className, attributeName, constructor)\
471 *static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName = attributeName;\
472 }\
473 GETTER_PRESENCE_ATTRIBUTE_IMPL(className, attributeName)\
474 attributeDatatype GLUE(,className)::get##attributeName() const {\
475 CHECK_ATTRIBUTE_EXISTENCE(className, attributeName)\
476 return *static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName;\
477 }
478
486#define ABSTRACT_GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
487 ABSTRACT_GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
488 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
489
497#define FINAL_GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
498 FINAL_GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
499 FINAL_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
507#define GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
508 GETTER_AND_SETTER_GENERIC_ATTRIBUTE_IN_VECTOR(attributeDatatype, vectorName, attributeName)\
509 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
510
520#define GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IN_VECTOR_IMPL(attributeDatatype, className, vectorName, attributeName, constructor)\
521 void GLUE(,className)::set##vectorName##attributeName(unsigned int index, const attributeDatatype & value) {\
522 CREATE_ATTRIBUTE_IN_VECTOR_IF_NOT_PRESENT(className, vectorName, attributeName, constructor)\
523 *static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName = value;\
524 }\
525 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
526 attributeDatatype GLUE(,className)::get##vectorName##attributeName(unsigned int index) const {\
527 CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName)\
528 return *static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName;\
529 }
530
537#define GETTER_AND_SETTER_TIME_T_OPTIONAL_ATTRIBUTE_IMPL(className, attributeName)\
538 void GLUE(,className)::set##attributeName(const time_t & attributeName) {\
539 CREATE_ATTRIBUTE_IF_NOT_PRESENT(className, attributeName, gsoap_eml2_1::soap_new_std__string)\
540 *static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName = timeTools::convertUnixTimestampToIso(attributeName);\
541 }\
542 GETTER_PRESENCE_ATTRIBUTE_IMPL(className, attributeName)\
543 time_t GLUE(,className)::get##attributeName() const {\
544 CHECK_ATTRIBUTE_EXISTENCE(className, attributeName)\
545 return timeTools::convertIsoToUnixTimestamp(*static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName);\
546 }
547
555#define GETTER_AND_SETTER_TIME_T_OPTIONAL_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
556 void GLUE(,className)::set##vectorName##attributeName(unsigned int index, const time_t & attributeName) {\
557 CREATE_ATTRIBUTE_IN_VECTOR_IF_NOT_PRESENT(className, vectorName, attributeName, gsoap_eml2_1::soap_new_std__string)\
558 *static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName = timeTools::convertUnixTimestampToIso(attributeName);\
559 }\
560 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
561 time_t GLUE(,className)::get##vectorName##attributeName(unsigned int index) const {\
562 CHECK_RANGE(static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName, index)\
563 CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName)\
564 return timeTools::convertIsoToUnixTimestamp(*static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName);\
565 }
566
573#define ABSTRACT_GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
574 DLL_IMPORT_OR_EXPORT virtual void set##attributeName(double value, uomDatatype uom) = 0;\
575 DLL_IMPORT_OR_EXPORT virtual double get##attributeName##Value() const = 0;\
576 DLL_IMPORT_OR_EXPORT virtual uomDatatype get##attributeName##Uom() const = 0;\
577 DLL_IMPORT_OR_EXPORT virtual std::string get##attributeName##UomAsString() const = 0;
578
585#define FINAL_GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
586 DLL_IMPORT_OR_EXPORT void set##attributeName(double value, uomDatatype uom) final;\
587 DLL_IMPORT_OR_EXPORT double get##attributeName##Value() const final;\
588 DLL_IMPORT_OR_EXPORT uomDatatype get##attributeName##Uom() const final;\
589 DLL_IMPORT_OR_EXPORT std::string get##attributeName##UomAsString() const final;
590
597#define GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
598 DLL_IMPORT_OR_EXPORT void set##attributeName(double value, uomDatatype uom);\
599 DLL_IMPORT_OR_EXPORT double get##attributeName##Value() const;\
600 DLL_IMPORT_OR_EXPORT uomDatatype get##attributeName##Uom() const;\
601 DLL_IMPORT_OR_EXPORT std::string get##attributeName##UomAsString() const;
602
609#define ABSTRACT_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
610 ABSTRACT_GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
611 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(attributeName)
612
619#define FINAL_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
620 FINAL_GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
621 FINAL_GETTER_PRESENCE_ATTRIBUTE(attributeName)
622
629#define GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
630 GETTER_AND_SETTER_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
631 GETTER_PRESENCE_ATTRIBUTE(attributeName)
632
639#define ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
640 DLL_IMPORT_OR_EXPORT virtual void set##attributeName(double value, uomDatatype uom, const std::string & datum) = 0;\
641 DLL_IMPORT_OR_EXPORT virtual double get##attributeName##Value() const = 0;\
642 DLL_IMPORT_OR_EXPORT virtual uomDatatype get##attributeName##Uom() const = 0;\
643 DLL_IMPORT_OR_EXPORT virtual std::string get##attributeName##Datum() const = 0;
644
651#define FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
652 DLL_IMPORT_OR_EXPORT void set##attributeName(double value, uomDatatype uom, const std::string & datum) final;\
653 DLL_IMPORT_OR_EXPORT double get##attributeName##Value() const final;\
654 DLL_IMPORT_OR_EXPORT uomDatatype get##attributeName##Uom() const final;\
655 DLL_IMPORT_OR_EXPORT std::string get##attributeName##Datum() const final;
656
663#define GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
664 DLL_IMPORT_OR_EXPORT void set##attributeName(double value, uomDatatype uom, const std::string & datum);\
665 DLL_IMPORT_OR_EXPORT double get##attributeName##Value() const;\
666 DLL_IMPORT_OR_EXPORT uomDatatype get##attributeName##Uom() const;\
667 DLL_IMPORT_OR_EXPORT std::string get##attributeName##Datum() const;
668
675#define ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
676 ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
677 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(attributeName)
678
685#define FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
686 FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
687 FINAL_GETTER_PRESENCE_ATTRIBUTE(attributeName)
688
695#define GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE(attributeName, uomDatatype)\
696 GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE(attributeName, uomDatatype)\
697 GETTER_PRESENCE_ATTRIBUTE(attributeName)
698
706#define ABSTRACT_GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
707 DLL_IMPORT_OR_EXPORT virtual void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom) = 0;\
708 DLL_IMPORT_OR_EXPORT virtual double get##vectorName##attributeName##Value(unsigned int index) const = 0;\
709 DLL_IMPORT_OR_EXPORT virtual uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const = 0;
710
718#define FINAL_GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
719 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom) final;\
720 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const final;\
721 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const final;
722
730#define GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
731 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom);\
732 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const;\
733 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const;
734
742#define ABSTRACT_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
743 ABSTRACT_GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
744 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
745
753#define FINAL_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
754 FINAL_GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
755 FINAL_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
756
764#define GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
765 GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
766 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
767
775#define ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
776 DLL_IMPORT_OR_EXPORT virtual void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom, const std::string & datum) = 0;\
777 DLL_IMPORT_OR_EXPORT virtual double get##vectorName##attributeName##Value(unsigned int index) const = 0;\
778 DLL_IMPORT_OR_EXPORT virtual uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const = 0;\
779 DLL_IMPORT_OR_EXPORT virtual std::string get##vectorName##attributeName##Datum(unsigned int index) const = 0;
780
788#define FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
789 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom, const std::string & datum) final;\
790 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const final;\
791 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const final;\
792 DLL_IMPORT_OR_EXPORT std::string get##vectorName##attributeName##Datum(unsigned int index) const final;
793
801#define GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
802 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom, const std::string & datum);\
803 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const;\
804 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const;\
805 DLL_IMPORT_OR_EXPORT std::string get##vectorName##attributeName##Datum(unsigned int index) const;
806
814#define ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
815 ABSTRACT_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
816 ABSTRACT_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
817
825#define FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
826 FINAL_GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
827 FINAL_GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
828
836#define GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
837 GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName, uomDatatype)\
838 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR(vectorName, attributeName)
839
846#define GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName)\
847 double GLUE(,className)::get##attributeName##Value() const {\
848 if (!has##attributeName()) { throw invalid_argument("The measure attribute to get does not exist."); }\
849 return static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->__item;\
850 }
851
859#define GETTER_UOM_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype)\
860 uomDatatype GLUE(, className)::get##attributeName##Uom() const {\
861 if (!has##attributeName()) { throw invalid_argument("The measure attribute to get does not exist."); }\
862 return static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->uom;\
863 }
864
872#define GETTER_UOM_OF_MEASURE_AS_STRING_ATTRIBUTE_IMPL(className, attributeName, uomDatatypeStringConversion)\
873 std::string GLUE(, className)::get##attributeName##UomAsString() const {\
874 return uomDatatypeStringConversion(gsoapProxy2_1->soap, get##attributeName##Uom());\
875 }
876
885#define GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, uomDatatypeStringConversion, constructor)\
886 void GLUE(,className)::set##attributeName(double value, uomDatatype uom) {\
887 if (value != value) { throw invalid_argument("You cannot set an undefined measure"); }\
888 CREATE_ATTRIBUTE_IF_NOT_PRESENT(className, attributeName, constructor)\
889 static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->__item = value;\
890 static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->uom = uom;\
891 }\
892 GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName)\
893 GETTER_UOM_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype)\
894 GETTER_UOM_OF_MEASURE_AS_STRING_ATTRIBUTE_IMPL(className, attributeName, uomDatatypeStringConversion)
895
904#define GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, constructor)\
905 void GLUE(,className)::set##attributeName(double value, uomDatatype uom, const std::string & datum) {\
906 if (value != value) { throw invalid_argument("You cannot set an undefined depth measure"); }\
907 CREATE_ATTRIBUTE_IF_NOT_PRESENT(className, attributeName, constructor)\
908 static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->__item = value;\
909 static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->uom = uom;\
910 static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->datum = datum;\
911 }\
912 GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName)\
913 GETTER_UOM_OF_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype)\
914 std::string GLUE(, className)::get##attributeName##Datum() const {\
915 if (!has##attributeName()) { throw invalid_argument("The measure attribute to get does not exist."); }\
916 return static_cast<witsml20__##className*>(gsoapProxy2_1)->attributeName->datum;\
917 }
918
927#define GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, uomDatatypeStringConversion, constructor)\
928 GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, uomDatatypeStringConversion, constructor)\
929 GETTER_PRESENCE_ATTRIBUTE_IMPL(className, attributeName)
930
939#define GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, constructor)\
940 GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IMPL(className, attributeName, uomDatatype, constructor)\
941 GETTER_PRESENCE_ATTRIBUTE_IMPL(className, attributeName)
942
950#define GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
951 double GLUE(,className)::get##vectorName##attributeName##Value(unsigned int index) const {\
952 CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName)\
953 return static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->__item;\
954 }
955
964#define GETTER_UOM_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype)\
965 uomDatatype GLUE(,className)::get##vectorName##attributeName##Uom(unsigned int index) const {\
966 CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName)\
967 return static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->uom;\
968 }
969
979#define GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
980 void GLUE(,className)::set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom) {\
981 if (value != value) { throw invalid_argument("You cannot set an undefined measured depth coord"); }\
982 CREATE_ATTRIBUTE_IN_VECTOR_IF_NOT_PRESENT(className, vectorName, attributeName, constructor)\
983 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->__item = value;\
984 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->uom = uom;\
985 }\
986 GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
987 GETTER_UOM_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype)
988
998#define GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
999 void GLUE(,className)::set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom, const std::string & datum) {\
1000 if (value != value) { throw invalid_argument("You cannot set an undefined measured depth coord"); }\
1001 CREATE_ATTRIBUTE_IN_VECTOR_IF_NOT_PRESENT(className, vectorName, attributeName, constructor)\
1002 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->__item = value;\
1003 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->uom = uom;\
1004 static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->datum = datum;\
1005 }\
1006 GETTER_VALUE_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)\
1007 GETTER_UOM_OF_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype)\
1008 std::string GLUE(, className)::get##vectorName##attributeName##Datum(unsigned int index) const {\
1009 CHECK_ATTRIBUTE_IN_VECTOR_EXISTENCE(className, vectorName, attributeName)\
1010 return static_cast<witsml20__##className*>(gsoapProxy2_1)->vectorName[index]->attributeName->datum;\
1011 }
1012
1022#define GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
1023 GETTER_AND_SETTER_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
1024 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)
1025
1036#define GETTER_AND_SETTER_DEPTH_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
1037 GETTER_AND_SETTER_DEPTH_MEASURE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName, uomDatatype, constructor)\
1038 GETTER_PRESENCE_ATTRIBUTE_IN_VECTOR_IMPL(className, vectorName, attributeName)