| 142 | } |
| 143 | |
| 144 | func (self cppIndexField) IndexType() string { |
| 145 | |
| 146 | switch self.Index.Type { |
| 147 | case model.FieldType_Int32: |
| 148 | return "int" |
| 149 | case model.FieldType_UInt32: |
| 150 | return "unsigned int" |
| 151 | case model.FieldType_Int64: |
| 152 | return "long long" |
| 153 | case model.FieldType_UInt64: |
| 154 | return "unsigned long long" |
| 155 | case model.FieldType_String: |
| 156 | return "std::string" |
| 157 | case model.FieldType_Float: |
| 158 | return "float" |
| 159 | case model.FieldType_Bool: |
| 160 | return "bool" |
| 161 | case model.FieldType_Enum: |
| 162 | |
| 163 | return self.Index.Complex.Name |
| 164 | default: |
| 165 | log.Errorf("%s can not be index ", self.Index.String()) |
| 166 | } |
| 167 | |
| 168 | return "unknown" |
| 169 | } |
| 170 | |
| 171 | type cppField struct { |
| 172 | *model.FieldDescriptor |