Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
StringTableLookup.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/AbstractObject.h"
22 
23 namespace RESQML2_0_1_NS
24 {
25  class DLL_IMPORT_OR_EXPORT StringTableLookup : public COMMON_NS::AbstractObject
26  {
27  public:
28 
32  StringTableLookup(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {}
33 
38 
45  StringTableLookup(soap* soapContext, const std::string & guid, const std::string & title);
46 
50  StringTableLookup(gsoap_resqml2_0_1::_resqml2__StringTableLookup* fromGsoap) : AbstractObject(fromGsoap) {}
51 
56 
57  static const char* XML_TAG;
58  virtual std::string getXmlTag() const {return XML_TAG;}
59 
64  void addCategoricalPropertyValues(class CategoricalProperty* categVal) {categoricalPropertyValuesSet.push_back(categVal);}
65 
69  bool containsKey(const long & longValue);
70 
74  unsigned int getItemCount() const;
75 
79  long getKeyAtIndex(const unsigned int & index) const;
80 
84  std::string getStringValueAtIndex(const unsigned int & index) const;
85 
90  std::string getStringValue(const long & longValue);
91 
96  void addValue(const std::string & strValue, const long & longValue);
97 
102  void setValue(const std::string & strValue, const long & longValue);
103 
104  /*
105  * Get the minimum value in this discrete properties. It reads it from file.
106  * @return the minimum value if present in the file otherwise long.max.
107  */
108  LONG64 getMinimumValue();
109 
110  /*
111  * Get the maximum value in this discrete properties. It reads it from file.
112  * @return the maximum value if present in the file otherwise long.min.
113  */
114  LONG64 getMaximumValue();
115 
116  /*
117  * Getter for the underlying map of the string lookup.
118  */
119 #if (defined(_WIN32) && _MSC_VER >= 1600) || defined(__APPLE__)
120  std::unordered_map<long, std::string> getMap() const;
121 #else
122  std::tr1::unordered_map<long, std::string> getMap() const;
123 #endif
124 
125  protected:
126 
127  std::vector<epc::Relationship> getAllEpcRelationships() const;
132 
133  // XML backwards relationships
134  std::vector<class CategoricalProperty*> categoricalPropertyValuesSet;
135  };
136 }
137 
StringTableLookup(gsoap_resqml2_0_1::_resqml2__StringTableLookup *fromGsoap)
Definition: StringTableLookup.h:50
StringTableLookup()
Definition: StringTableLookup.h:37
Definition: EpcDocument.h:65
Definition: CategoricalProperty.h:25
virtual std::string getXmlTag() const
Definition: StringTableLookup.h:58
StringTableLookup(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: StringTableLookup.h:32
void addCategoricalPropertyValues(class CategoricalProperty *categVal)
Definition: StringTableLookup.h:64
Definition: EpcDocument.h:154
Definition: AbstractObject.h:27
Definition: StringTableLookup.h:25
void importRelationshipSetFromEpc(COMMON_NS::EpcDocument *epcDoc)
Definition: StringTableLookup.h:131
~StringTableLookup()
Definition: StringTableLookup.h:55
Definition: AbstractHdfProxy.h:28