Fesapi 2.9.0.1
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
ChannelMetaDataObject.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
21#include "../witsml2/WellboreObject.h"
22
23#include <stdexcept>
24
25#include "../eml2/PropertyKind.h"
26
27namespace WITSML2_1_NS
28{
36 template <class T>
38 {
39 public:
40
48 DLL_IMPORT_OR_EXPORT ChannelMetaDataObject(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : WellboreObject(partialObject) {}
49
51 ChannelMetaDataObject() : WITSML2_NS::WellboreObject() {}
52
58 ChannelMetaDataObject(gsoap_eml2_3::eml23__AbstractObject* fromGsoap) : WITSML2_NS::WellboreObject(fromGsoap) {}
59
61 virtual ~ChannelMetaDataObject() = default;
62
68 COMMON_NS::DataObjectReference getWellboreDor() const final
69 {
70 return COMMON_NS::DataObjectReference(static_cast<T*>(this->gsoapProxy2_3)->Wellbore);
71 }
72
80 DLL_IMPORT_OR_EXPORT void setWellbore(WITSML2_NS::Wellbore* witsmlWellbore) final
81 {
82 if (witsmlWellbore == nullptr) {
83 throw std::invalid_argument("Cannot set a null witsml wellbore to a witsml trajectory");
84 }
85
86 static_cast<T*>(this->gsoapProxy2_3)->Wellbore = witsmlWellbore->newEml23Reference();
87
88 getRepository()->addRelationship(this, witsmlWellbore);
89 }
90
98#define GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_TEMPLATE(attributeDatatype, attributeName, constructor)\
99 DLL_IMPORT_OR_EXPORT virtual void set##attributeName(const attributeDatatype & attributeName) = 0;\
100 std::string get##attributeName() const {\
101 if (static_cast<T*>(this->gsoapProxy2_3)->attributeName == nullptr) { throw std::invalid_argument("The attribute does not exist"); }\
102 return *static_cast<T*>(this->gsoapProxy2_3)->attributeName;\
103 }\
104 bool has##attributeName() const { return static_cast<T*>(this->gsoapProxy2_3)->attributeName != nullptr; }
105
106 GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_TEMPLATE(std::string, RunNumber, gsoap_eml2_3::soap_new_std__string)
107 GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_TEMPLATE(std::string, PassNumber, gsoap_eml2_3::soap_new_std__string)
108 };
109}
A wellbore represents the path from surface to a unique bottomhole location.
Definition Wellbore.h:46
Definition WellboreObject.h:32
Definition ChannelMetaDataObject.h:38
virtual ~ChannelMetaDataObject()=default
ChannelMetaDataObject()
Definition ChannelMetaDataObject.h:51
void setWellbore(WITSML2_NS::Wellbore *witsmlWellbore) final
Definition ChannelMetaDataObject.h:80
ChannelMetaDataObject(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition ChannelMetaDataObject.h:48
common::DataObjectReference getWellboreDor() const final
Gets wellbore dor.
Definition ChannelMetaDataObject.h:68
ChannelMetaDataObject(gsoap_eml2_3::eml23__AbstractObject *fromGsoap)
Definition ChannelMetaDataObject.h:58
A wellbore represents the path from surface to a unique bottomhole location.
Definition Wellbore.h:29