Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
AbstractObject.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "common/EpcDocument.h"
22 
23 namespace WITSML1_4_1_1_NS
24 {
28  class DLL_IMPORT_OR_EXPORT AbstractObject
29  {
30  protected:
31  gsoap_witsml1_4_1_1::abstract__abstractObject* collection;
32  COMMON_NS::EpcDocument* epcDocument;
33 
34  // forward relationshsip
35  class CoordinateReferenceSystem* crs;
36 
37  bool updateXml;
38 
39  AbstractObject(gsoap_witsml1_4_1_1::abstract__abstractObject* proxy = nullptr) : collection(proxy), epcDocument (nullptr), crs(nullptr), updateXml(true) {}
40 
42 
43  gsoap_witsml1_4_1_1::witsml1__cs_USCOREcommonData* newCommonData(
44  const std::string & sourceName,
45  const time_t & dTimCreation,
46  const time_t & dTimLastChange,
47  const std::string & comments);
48 
49  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructEastingNorthingLocation(
50  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
51  const double & easting,
52  const double & northing,
53  class CoordinateReferenceSystem* wellCrs);
54 
55  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructWestingSouthingLocation(
56  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
57  const double & westing,
58  const double & southing,
59  class CoordinateReferenceSystem* wellCrs);
60 
61  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructProjectedXProjectedYLocation(
62  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
63  const double & projectedX,
64  const double & projectedY,
65  class CoordinateReferenceSystem* wellCrs);
66 
67  public:
68  virtual ~AbstractObject() {}
69 
70  static const char* SCHEMA_VERSION;
71 
72  virtual const std::string & getTitle() const = 0;
73 
74  virtual std::string getUuid() const = 0;
75  virtual time_t getCreation() const = 0;
76  virtual time_t getLastUpdate() const = 0;
77 
81  gsoap_witsml1_4_1_1::abstract__abstractObject* getGsoapProxy() {return collection;}
82 
87  void serializeIntoStream(std::ostream * stream);
88 
92  int getGsoapType() const {return collection->soap_type();}
93 
97  COMMON_NS::EpcDocument* getEpcDocument() const {return epcDocument;}
98 
102  virtual std::string getXmlNamespace() const {return "witsml1";}
103 
107  virtual std::string getXmlTag() const = 0;
108 
112  std::string getContentType() const;
113 
117  std::string getPartNameInEpcDocument() const;
118 
119  gsoap_resqml2_0_1::eml20__DataObjectReference* newResqmlReference() const;
120 
121  void setCoordinateReferenceSystem(class CoordinateReferenceSystem* wellCrs);
122 
123  class CoordinateReferenceSystem* getCoordinateReferenceSystem() const {return crs;}
124 
128  virtual std::vector<epc::Relationship> getAllEpcRelationships() const;
129 
133  virtual void importRelationshipSetFromEpc(COMMON_NS::EpcDocument * epcDoc) = 0;
134 
138  std::string serializeIntoString();
139  };
140 }
141 
gsoap_witsml1_4_1_1::abstract__abstractObject * getGsoapProxy()
Definition: AbstractObject.h:81
virtual std::string getXmlNamespace() const
Definition: AbstractObject.h:102
int getGsoapType() const
Definition: AbstractObject.h:92
void addGsoapProxy(COMMON_NS::AbstractObject *proxy)
Definition: EpcDocument.cpp:529
AbstractObject(gsoap_witsml1_4_1_1::abstract__abstractObject *proxy=nullptr)
Indicate wether methods update the XML (Gsoap) or only the C++ classes of the API.
Definition: AbstractObject.h:39
Definition: EpcDocument.h:130
Definition: EpcDocument.h:154
Definition: AbstractObject.h:28
Definition: CoordinateReferenceSystem.h:27
COMMON_NS::EpcDocument * getEpcDocument() const
Definition: AbstractObject.h:97