My Project
CoordinateReferenceSystem.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2016)
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 "witsml1_4_1_1/AbstractObject.h"
37 
38 namespace witsml1_4_1_1
39 {
40  class DLL_IMPORT_OR_EXPORT CoordinateReferenceSystem : public AbstractObject
41  {
42  public:
48  CoordinateReferenceSystem(soap* soapContext,
49  const std::string & guid,
50  const std::string & title,
51  const std::string & namingSystem,
52  const std::string & code,
53  const std::string & sourceName,
54  const time_t & dTimCreation,
55  const time_t & dTimLastChange,
56  const std::string & comments
57  );
58 
62  CoordinateReferenceSystem(gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems* fromGsoap):AbstractObject(fromGsoap) {}
63 
68 
69  soap* getGSoapContext() const {return collection->soap;}
70 
71  gsoap_witsml1_4_1_1::witsml1__refNameString* newReference() const;
72 
73  const std::vector<AbstractObject*>& getObjectsUsingThisCrs() const {return objectsUsingThisCrs;}
74 
75  const std::string & getTitle() const {return static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->name;}
76 
77  std::string getUuid() const {return *static_cast<gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->uid;}
78  time_t getCreation() const
79  {
80  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimCreation)
81  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimCreation;
82  else
83  return -1;
84  }
85  time_t getLastUpdate() const
86  {
87  if (static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimLastChange)
88  return *static_cast<gsoap_witsml1_4_1_1::_witsml1__coordinateReferenceSystems*>(collection)->coordinateReferenceSystem[0]->commonData->dTimLastChange;
89  else
90  return -1;
91  }
92 
93  std::vector<epc::Relationship> getAllEpcRelationships() const;
94 
100 
101  static const char* XML_TAG;
102  virtual std::string getXmlTag() const {return XML_TAG;}
103 
104  protected:
105 
106  //backward relationship
107  std::vector<AbstractObject*> objectsUsingThisCrs;
108 
109  friend void AbstractObject::setCoordinateReferenceSystem(CoordinateReferenceSystem* wellCrs);
110  };
111 }
Definition: EpcDocument.h:142
CoordinateReferenceSystem(gsoap_witsml1_4_1_1::witsml1__obj_USCOREcoordinateReferenceSystems *fromGsoap)
Definition: CoordinateReferenceSystem.h:62
Definition: AbstractObject.h:43
Definition: EpcDocument.h:155
void importRelationshipSetFromEpc(common::EpcDocument *epcDoc)
Definition: CoordinateReferenceSystem.h:99
~CoordinateReferenceSystem()
Definition: CoordinateReferenceSystem.h:67
Definition: CoordinateReferenceSystem.h:40
virtual std::string getXmlTag() const
Definition: CoordinateReferenceSystem.h:102