Teamcenter C++ API Reference  2312
SolutionVariant.hxx
Go to the documentation of this file.
1 /*
2 Copyright 2022 Siemens Digital Industries Software
3 ==================================================
4 Copyright 2020
5 Siemens Product Lifecycle Management Software Inc.
6 All Rights Reserved.
7 ==================================================
8 Copyright 2022 Siemens Digital Industries Software
9 
10 This header contains the solution variant creation ITK declaration and its supporting structures.
11 THe details are explained in appropriate structure parameters.
12 */
13 
14 #ifndef SMC0PSMCFGSUPPORT_SOLUTION_VARIANT_ITK_H
15 #define SMC0PSMCFGSUPPORT_SOLUTION_VARIANT_ITK_H
16 
17 #include <unidefs.h>
18 #include <map>
19 #include <vector>
20 #include <set>
21 #include <base_utils/DateTime.hxx>
24 #include <Smc0psmcfgsupport/libsmc0psmcfgsupport_exports.h>
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31  namespace Teamcenter
32  {
33  namespace PSM
34  {
35  namespace SolutionVariant
36  {
37  typedef std::map< tag_t, tag_t > ExpandedBOMLine;
41  typedef std::map< std::string, std::string > StringMap;
42  typedef std::map< std::string, std::vector< std::string > > StringVectorMap;
43  typedef std::map< std::string, BusinessObjectRef< Teamcenter::BusinessObject > > svTagMap;
44  typedef std::map< std::string, std::vector< BusinessObjectRef< Teamcenter::BusinessObject > > > TagVectorMap;
45  typedef std::map< std::string, int > IntMap;
46  typedef std::map< std::string, std::vector< int > > IntVectorMap;
47  typedef std::map< std::string, double > DoubleMap;
48  typedef std::map< std::string, std::vector< double > > DoubleVectorMap;
49  typedef std::map< std::string, float > FloatMap;
50  typedef std::map< std::string, std::vector< float > > FloatVectorMap;
51  typedef std::map< std::string, Teamcenter::DateTime > DateMap;
52  typedef std::map< std::string, std::vector< Teamcenter::DateTime > > DateVectorMap;
53  typedef std::map< std::string, bool > BoolMap;
54  typedef std::map< std::string, std::vector< bool > > BoolVectorMap;
55 
56  struct SMC0PSMCFGSUPPORT_API CreateSVInputProp
57  {
58  // the below Maps for which the property and its values are populated correspond to the
59  // Business Object name (m_boName)
60  std::string m_boName; // for e,g "Design Revision"
61  StringMap m_stringProps;
76  std::map< std::string, std::vector< CreateSVInputProp > > m_compoundSVItemProp;
84  CreateSVInputProp() : m_boName(""), m_stringProps(), m_stringArrayProps(), m_doubleProps(), m_doubleArrayProps(), m_floatProps(), m_floatArrayProps(), m_intProps(), m_intArrayProps(),
85  m_boolProps(), m_boolArrayProps(), m_dateProps(), m_dateArrayProps(), m_tagProps(), m_tagArrayProps(), m_compoundSVItemProp()
86  {
87  }
88  CreateSVInputProp(std::string boName) : m_boName(boName), m_stringProps(), m_stringArrayProps(), m_doubleProps(), m_doubleArrayProps(), m_floatProps(), m_floatArrayProps(), m_intProps(), m_intArrayProps(),
89  m_boolProps(), m_boolArrayProps(), m_dateProps(), m_dateArrayProps(), m_tagProps(), m_tagArrayProps(), m_compoundSVItemProp() {}
90  };
91  struct SMC0PSMCFGSUPPORT_API SolVarCreateInfo
92  {
96  tag_t m_subsetVariantRule;
109  SolVarCreateInfo() :m_createSVInputProp(), m_genericBomLine(NULLTAG), m_solVarCategory(-1), m_subsetVariantRule(NULLTAG), m_newSolVarItemRevision(NULLTAG), m_isSolVarIsExist(false), m_errorcode(0)
110  {
111  }
112  SolVarCreateInfo(CreateSVInputProp createSVInputProp, tag_t genericBomLine, int solVarCategory, tag_t newSolVarItemRevision)
113  :m_createSVInputProp(createSVInputProp), m_genericBomLine(genericBomLine), m_solVarCategory(solVarCategory), m_subsetVariantRule(NULLTAG),
114  m_newSolVarItemRevision(newSolVarItemRevision), m_isSolVarIsExist(false), m_errorcode(0) {}
115  };
116 
117  struct SMC0PSMCFGSUPPORT_API MultilevelSolVarCreateInfo
118  {
123  MultilevelSolVarCreateInfo() :m_solVarCreateInfo(), m_mappedSVBomLine(NULLTAG), m_errorcode(0)
124  {
125  }
126  MultilevelSolVarCreateInfo(SolVarCreateInfo solVarCreateInfo, tag_t mappedSVBomLine, int level) :
127  m_solVarCreateInfo(solVarCreateInfo), m_mappedSVBomLine(mappedSVBomLine), bomLinelevel(level), m_errorcode(0) {}
128  };
129 
130  // Output structure of solution variant created.
131  struct SMC0PSMCFGSUPPORT_API MultilevelSolVarCreateOutput
132  {
135  std::string status;
140  MultilevelSolVarCreateOutput() :m_genericBOMLine(0), m_newVariantBOMLine(0), m_errorcode(0)
141  {
142  }
143  };
144 
145  struct SMC0PSMCFGSUPPORT_API MultilevelSolVarCreateResponse
146  {
147  std::vector < MultilevelSolVarCreateOutput > m_multilevelSolVarCreateOutputList;
148  std::map< tag_t, tag_t > m_expandedBOMLines;
152  {
153  }
154  };
155  }
156  }
157  }
158 
225  SMC0PSMCFGSUPPORT_API extern int SMC0_solution_variants_creation(
226  std::vector< Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateInfo > &multilevelSolVarCreateInfoList,
227  const tag_t savedVariantRule,
228  const std::map< std::string, int > &preferencesMap,
239  const tag_t revRule,
240  bool multilevel,
245  const std::map < std::string, std::string > &gvToSVType,
248  Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateResponse & multilevelSolVarCreateResponse);
250 #ifdef __cplusplus
251 }
252 #endif
253 
256 #include <Smc0psmcfgsupport/libsmc0psmcfgsupport_undef.h>
257 #endif