HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_DataHint.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SIM_DataHint.h ( SIM Library, C++)
7  *
8  * COMMENTS: Holds information about what sort of simulation data
9  * relationships are likely valid, and which are likely not.
10  */
11 
12 #ifndef __SIM_DataHint__
13 #define __SIM_DataHint__
14 
15 #include "SIM_API.h"
16 #include <UT/UT_String.h>
17 #include <UT/UT_StringHolder.h>
18 #include <UT/UT_IntArray.h>
19 #include <UT/UT_ValArray.h>
20 #include <UT/UT_SymbolTable.h>
21 
22 class UT_StringArray;
23 class SIM_Data;
24 class SIM_Object;
25 class SIM_Engine;
26 class SIM_DataHint;
28 
30 
32 {
33 public:
34  static void addHint(const UT_StringHolder &parentdatatype,
35  const UT_StringHolder &expectedchildtype,
36  const UT_StringHolder &expectedchildname,
37  int maxcount);
38  static void getAllDataHints(UT_StringArray &parentdatatypes,
39  UT_StringArray &expectedchildtypes,
40  UT_StringArray &expectedchildnames,
41  UT_IntArray &maxcounts);
42  static void getAllSubdataTypes(const UT_StringRef &parentdatatype,
43  UT_StringArray &subdatatypes,
44  UT_IntArray &maxcountindices,
45  UT_IntArray &maxcounts);
46  static void getAllSubdataTypes(const UT_StringRef &parentdatatype,
47  UT_StringArray &subdatatypes,
48  UT_IntArray &maxcountindices,
49  UT_IntArray &maxcounts,
50  SIM_Engine &work_engine);
51  static int getSubdataNumInputs(const UT_StringRef &datatype,
52  SIM_Engine &work_engine);
53  static void verifySimulationData(const SIM_Engine &engine);
54  static void destroyAllDataHints();
55 
56  static void addAlias(const UT_StringHolder &datatype,
57  const UT_StringHolder &alias);
58  static const UT_StringHolder
59  &getDataTypeFromAlias(const UT_StringRef &alias);
60  static void getAllDataTypeAliases(UT_StringArray &aliases,
61  UT_StringArray &datatypes);
62 
63 private:
64  SIM_DataHint(const UT_StringHolder &parentdatatype,
65  const UT_StringHolder &expecteddatatype,
66  const UT_StringHolder &expecteddataname,
67  int maxcount);
68  virtual ~SIM_DataHint();
69 
70  bool getDataIsExpected(const SIM_Data &child,
71  const UT_StringRef &childname) const;
72 
73  static void processHintsForData(const SIM_Engine &engine,
74  const SIM_RootData &rootdata,
75  const SIM_Data &parentdata);
76  static void destroyDataHints(void *);
77 
78  UT_StringHolder myParentDataType;
79  UT_StringHolder myExpectedDataType;
80  UT_StringHolder myExpectedDataName;
81  int myMaxCount;
82 
84  static SIM_DataHintArray *theMasterHintArray;
85  static SIM_DataHintTable *theHintTable;
86  static UT_SymbolMap<UT_StringHolder> theDataTypeAliases;
87 };
88 
89 #endif
UT_ValArray< SIM_DataHint * > SIM_DataHintArray
Definition: SIM_DataHint.h:27
#define SIM_API
Definition: SIM_API.h:12