Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
CoordinateReferenceSystem.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 "witsml1_4_1_1/AbstractObject.h"
22 
23 #include "tools/TimeTools.h"
24 
25 namespace WITSML1_4_1_1_NS
26 {
27  class DLL_IMPORT_OR_EXPORT CoordinateReferenceSystem : public AbstractObject
28  {
29  public:
35  CoordinateReferenceSystem(soap* soapContext,
36  const std::string & guid,
37  const std::string & title,
38  const std::string & namingSystem,
39  const std::string & code,
40  const std::string & sourceName,
41  const time_t & dTimCreation,
42  const time_t & dTimLastChange,
43  const std::string & comments
44  );
45 
49  CoordinateReferenceSystem(gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems* fromGsoap):AbstractObject(fromGsoap) {}
50 
55 
56  soap* getGSoapContext() const {return collection->soap;}
57 
58  gsoap_witsml1_4_1_1::witsml1__refNameString* newReference() const;
59 
60  const std::vector<AbstractObject*>& getObjectsUsingThisCrs() const {return objectsUsingThisCrs;}
61 
62  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->name;}
63 
64  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->uid;}
65  time_t getCreation() const
66  {
67  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimCreation)
68  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimCreation);
69  else
70  return -1;
71  }
72  time_t getLastUpdate() const
73  {
74  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimLastChange)
75  return timeTools::timegm(static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimLastChange);
76  else
77  return -1;
78  }
79 
80  std::vector<epc::Relationship> getAllEpcRelationships() const;
81 
87 
88  static const char* XML_TAG;
89  virtual std::string getXmlTag() const {return XML_TAG;}
90 
91  protected:
92 
93  //backward relationship
94  std::vector<AbstractObject*> objectsUsingThisCrs;
95 
96  friend void AbstractObject::setCoordinateReferenceSystem(CoordinateReferenceSystem* wellCrs);
97  };
98 }
99 
CoordinateReferenceSystem(gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems *fromGsoap)
Definition: CoordinateReferenceSystem.h:49
void importRelationshipSetFromEpc(COMMON_NS::EpcDocument *epcDoc)
Definition: CoordinateReferenceSystem.h:86
virtual std::string getXmlTag() const
Definition: CoordinateReferenceSystem.h:89
Definition: EpcDocument.h:130
Definition: EpcDocument.h:154
~CoordinateReferenceSystem()
Definition: CoordinateReferenceSystem.h:54
Definition: AbstractObject.h:28
Definition: CoordinateReferenceSystem.h:27