Vuo  2.3.2
VuoGenericType.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoType.hh"
13 
19 class VuoGenericType : public VuoType
20 {
21 public:
26  {
30  };
31 
32  VuoGenericType(string typeName, vector<string> compatibleSpecializedTypes);
33  bool isSpecializedTypeCompatible(string typeName);
34  bool isGenericTypeCompatible(VuoGenericType *otherType);
35  vector<string> getCompatibleSpecializedTypes(Compatibility &compatibility);
36 
37  static bool isGenericTypeName(string typeName);
38  static size_t findGenericTypeName(string stringToSearch, size_t startPos, string &genericTypeName);
39  static string replaceInnermostGenericTypeName(string genericTypeName, string replacementTypeName);
40  static string createGenericTypeName(unsigned int suffix);
41  static void sortGenericTypeNames(vector<string> &genericTypeNames);
42 
43 private:
44  vector<string> compatibleSpecializedTypes;
45 
46  static const string genericTypeNamePrefix;
47  static bool isPairOfGenericTypesSorted(string type1, string type2);
48  static string extractSuffixStringFromGenericTypeName(string genericTypeName);
49  static unsigned int extractSuffixFromGenericTypeName(string genericTypeName);
50 };