My Project
AbstractObject.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2017)
3 
4 philippe.verney@f2i-consulting.com
5 
6 This software is a computer program whose purpose is to access to data formatted using Energistics standards.
7 
8 This software is governed by the CeCILL-B license under French law and
9 abiding by the rules of distribution of free software. You can use,
10 modify and/ or redistribute the software under the terms of the CeCILL-B
11 license as circulated by CEA, CNRS and INRIA at the following URL
12 "http://www.cecill.info".
13 
14 As a counterpart to the access to the source code and rights to copy,
15 modify and redistribute granted by the license, users are provided only
16 with a limited warranty and the software's author, the holder of the
17 economic rights, and the successive licensors have only limited
18 liability.
19 
20 In this respect, the user's attention is drawn to the risks associated
21 with loading, using, modifying and/or developing or reproducing the
22 software by the user in light of its specific status of free software,
23 that may mean that it is complicated to manipulate, and that also
24 therefore means that it is reserved for developers and experienced
25 professionals having in-depth computer knowledge. Users are therefore
26 encouraged to load and test the software's suitability as regards their
27 requirements in conditions enabling the security of their systems and/or
28 data to be ensured and, more generally, to use and operate it in the
29 same conditions as regards security.
30 
31 The fact that you are presently reading this means that you have had
32 knowledge of the CeCILL-B license and that you accept its terms.
33 -----------------------------------------------------------------------*/
34 #pragma once
35 
36 #include "common/EpcDocument.h"
37 
38 namespace witsml1_4_1_1
39 {
43  class DLL_IMPORT_OR_EXPORT AbstractObject
44  {
45  protected:
46  gsoap_witsml1_4_1_1::abstract__abstractObject* collection;
47  common::EpcDocument* epcDocument;
48 
49  // forward relationshsip
50  class CoordinateReferenceSystem* crs;
51 
52  bool updateXml;
53 
54  AbstractObject(gsoap_witsml1_4_1_1::abstract__abstractObject* proxy = nullptr) : collection(proxy), epcDocument (nullptr), crs(nullptr), updateXml(true) {}
55 
57 
58  gsoap_witsml1_4_1_1::witsml1__cs_USCOREcommonData* newCommonData(
59  const std::string & sourceName,
60  const time_t & dTimCreation,
61  const time_t & dTimLastChange,
62  const std::string & comments);
63 
64  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructEastingNorthingLocation(
65  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
66  const double & easting,
67  const double & northing,
68  class CoordinateReferenceSystem* wellCrs);
69 
70  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructWestingSouthingLocation(
71  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
72  const double & westing,
73  const double & southing,
74  class CoordinateReferenceSystem* wellCrs);
75 
76  gsoap_witsml1_4_1_1::witsml1__cs_USCORElocation* constructProjectedXProjectedYLocation(
77  gsoap_witsml1_4_1_1::witsml1__LengthUom uom,
78  const double & projectedX,
79  const double & projectedY,
80  class CoordinateReferenceSystem* wellCrs);
81 
82  public:
83  virtual ~AbstractObject() {}
84 
85  static const char* SCHEMA_VERSION;
86 
87  virtual const std::string & getTitle() const = 0;
88 
89  virtual std::string getUuid() const = 0;
90  virtual time_t getCreation() const = 0;
91  virtual time_t getLastUpdate() const = 0;
92 
96  gsoap_witsml1_4_1_1::abstract__abstractObject* getGsoapProxy() {return collection;}
97 
102  void serializeIntoStream(std::ostream * stream);
103 
107  int getGsoapType() const {return collection->soap_type();}
108 
112  common::EpcDocument* getEpcDocument() const {return epcDocument;}
113 
117  virtual std::string getXmlNamespace() const {return "witsml1";}
118 
122  virtual std::string getXmlTag() const = 0;
123 
127  std::string getContentType() const;
128 
132  std::string getPartNameInEpcDocument() const;
133 
134  gsoap_resqml2_0_1::eml20__DataObjectReference* newResqmlReference() const;
135 
136  void setCoordinateReferenceSystem(class CoordinateReferenceSystem* wellCrs);
137 
138  class CoordinateReferenceSystem* getCoordinateReferenceSystem() const {return crs;}
139 
143  virtual std::vector<epc::Relationship> getAllEpcRelationships() const;
144 
148  virtual void importRelationshipSetFromEpc(common::EpcDocument * epcDoc) = 0;
149 
153  std::string serializeIntoString();
154  };
155 }
Definition: EpcDocument.h:144
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:54
Definition: AbstractObject.h:43
gsoap_witsml1_4_1_1::abstract__abstractObject * getGsoapProxy()
Definition: AbstractObject.h:96
Definition: EpcDocument.h:168
int getGsoapType() const
Definition: AbstractObject.h:107
virtual std::string getXmlNamespace() const
Definition: AbstractObject.h:117
void addGsoapProxy(common::AbstractObject *proxy)
Definition: EpcDocument.cpp:519
common::EpcDocument * getEpcDocument() const
Definition: AbstractObject.h:112
Definition: CoordinateReferenceSystem.h:40