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
PropertyKindMapper.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
10 http://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 <unordered_map>
22
23#include "../common/DataObjectRepository.h"
24
25namespace RESQML2_0_1_NS
26{
29 {
30 public:
31
37 PropertyKindMapper(COMMON_NS::DataObjectRepository* repository) : dataObjRepo(repository) {}
38
41
52 DLL_IMPORT_OR_EXPORT std::string loadMappingFilesFromDirectory(const std::string & directory);
53
62 DLL_IMPORT_OR_EXPORT std::string getApplicationPropertyKindNameFromResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName, const std::string & application) const;
63
73 DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getResqmlStandardPropertyKindNameFromApplicationPropertyKindName(const std::string & applicationPropertyKindName, const std::string & application) const;
74
83 DLL_IMPORT_OR_EXPORT std::string getApplicationPropertyKindNameFromResqmlLocalPropertyKindUuid(const std::string & resqmlLocalPropertyKindUuid, const std::string & application) const;
84
93 DLL_IMPORT_OR_EXPORT std::string getResqmlLocalPropertyKindUuidFromApplicationPropertyKindName(const std::string & applicationPropertyKindName, const std::string & application) const;
94
100 DLL_IMPORT_OR_EXPORT class PropertyKind* addResqmlLocalPropertyKindToEpcDocumentFromApplicationPropertyKindName(const std::string & applicationPropertyKindName, const std::string & application);
101
109 DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getPropertyKindParentOfResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const;
110
118 DLL_IMPORT_OR_EXPORT std::string getDescriptionOfResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const;
119
128 DLL_IMPORT_OR_EXPORT bool isChildOf(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind child, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind parent) const;
129
137 DLL_IMPORT_OR_EXPORT bool isAbstract(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const;
138
139 private:
141 COMMON_NS::DataObjectRepository * dataObjRepo;
142
146 struct MyHash
147 {
148 std::size_t operator()(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind const& propKind) const noexcept
149 {
150 return std::hash<std::underlying_type<gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind>::type>()(static_cast<std::underlying_type<gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind>::type>(propKind));
151 }
152 };
153
155 std::unordered_map<gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind, gsoap_resqml2_0_1::ptm__standardEnergisticsPropertyType*, MyHash> resqmlStandardPropertyKindNameToApplicationPropertyKindName;
156
161 std::unordered_map<std::string, std::unordered_map<std::string, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind> > applicationPropertyKindNameToResqmlStandardPropertyKindName;
162
164 std::unordered_map<std::string, std::unordered_map<std::string, std::string> > resqmlLocalPropertyKindUuidToApplicationPropertyKindName;
166 std::unordered_map<std::string, std::unordered_map<std::string, std::string> > applicationPropertyKindNameToResqmlLocalPropertyKindUuid;
167
169 std::unordered_map<std::string, gsoap_resqml2_0_1::_resqml20__PropertyKind*> resqmlLocalPropertyKindUuidToResqmlLocalPropertyKind;
170 };
171}
Definition PropertyKind.h:28
Definition PropertyKindMapper.h:29
std::string getApplicationPropertyKindNameFromResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName, const std::string &application) const
Get the name of a RESQML standard property kind into a particular application.
PropertyKindMapper(common ::DataObjectRepository *repository)
Definition PropertyKindMapper.h:37
std::string getDescriptionOfResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const
std::string loadMappingFilesFromDirectory(const std::string &directory)
class PropertyKind * addResqmlLocalPropertyKindToEpcDocumentFromApplicationPropertyKindName(const std::string &applicationPropertyKindName, const std::string &application)
gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getPropertyKindParentOfResqmlStandardPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const
bool isChildOf(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind child, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind parent) const
bool isAbstract(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind resqmlStandardPropertyKindName) const
gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getResqmlStandardPropertyKindNameFromApplicationPropertyKindName(const std::string &applicationPropertyKindName, const std::string &application) const
Gets RESQML standard property kind name from application property kind name.
std::string getApplicationPropertyKindNameFromResqmlLocalPropertyKindUuid(const std::string &resqmlLocalPropertyKindUuid, const std::string &application) const
Gets application property kind name from resqml local property kind uuid.
std::string getResqmlLocalPropertyKindUuidFromApplicationPropertyKindName(const std::string &applicationPropertyKindName, const std::string &application) const