()
| 229 | } |
| 230 | |
| 231 | func NewMap() *Map { |
| 232 | defaultMapInitOnce.Do(initDefaultMap) |
| 233 | |
| 234 | return &Map{ |
| 235 | oidToType: make(map[uint32]*Type), |
| 236 | nameToType: make(map[string]*Type), |
| 237 | reflectTypeToName: make(map[reflect.Type]string), |
| 238 | oidToFormatCode: make(map[uint32]int16), |
| 239 | |
| 240 | memoizedEncodePlans: make(map[uint32]map[reflect.Type][2]EncodePlan), |
| 241 | |
| 242 | TryWrapEncodePlanFuncs: []TryWrapEncodePlanFunc{ |
| 243 | TryWrapDerefPointerEncodePlan, |
| 244 | TryWrapBuiltinTypeEncodePlan, |
| 245 | TryWrapFindUnderlyingTypeEncodePlan, |
| 246 | TryWrapStringerEncodePlan, |
| 247 | TryWrapStructEncodePlan, |
| 248 | TryWrapSliceEncodePlan, |
| 249 | TryWrapMultiDimSliceEncodePlan, |
| 250 | TryWrapArrayEncodePlan, |
| 251 | }, |
| 252 | |
| 253 | TryWrapScanPlanFuncs: []TryWrapScanPlanFunc{ |
| 254 | TryPointerPointerScanPlan, |
| 255 | TryWrapBuiltinTypeScanPlan, |
| 256 | TryFindUnderlyingTypeScanPlan, |
| 257 | TryWrapStructScanPlan, |
| 258 | TryWrapPtrSliceScanPlan, |
| 259 | TryWrapPtrMultiDimSliceScanPlan, |
| 260 | TryWrapPtrArrayScanPlan, |
| 261 | }, |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | // RegisterTypes registers multiple data types in the sequence they are provided. |
| 266 | func (m *Map) RegisterTypes(types []*Type) { |
no outgoing calls