Skip to content

Feature/encode struct names : using boost.type index to disambiguate variants instead of fields collection#2

Merged
daminetreg merged 3 commits intomasterfrom
feature/encode-struct-names
Dec 18, 2015
Merged

Feature/encode struct names : using boost.type index to disambiguate variants instead of fields collection#2
daminetreg merged 3 commits intomasterfrom
feature/encode-struct-names

Conversation

@daminetreg
Copy link
Owner

Hi @linkineo,

Could you help me reviewing this ?
It is in regards of disambiguating variants with the struct name.

This ends up in such json when a member struct is in a variant, this however drops variant disambiguation for std::string vs double vs int, because I don't disambiguate anymore for them.

Additionally it has the advantage that I don't rely on trying the deserialization process to ensure it is the right type.

[
  {
    "name": "King",
    "responsibility": {
      "checkout_number": 1,
      "section": "hardware",
      "struct": "datamodel::cashier"
    }
  },
  {
    "name": "Blake",
    "responsibility": {
      "fighting_tactic": "Krav Maga",
      "has_a_weapon": true,
      "struct": "datamodel::security"
    }
  },
  {
    "name": "Martin",
    "responsibility": {
      "floor": "5th floor",
      "room": "Toys, Petshop, Drugs, Food",
      "struct": "datamodel::cleaner"
    }
  },
  {
    "name": "Ward",
    "responsibility": {
      "checkout_number": 2,
      "section": "Food",
      "struct": "datamodel::cashier"
    }
  }
]

@daminetreg daminetreg merged commit 0f8f768 into master Dec 18, 2015
@daminetreg daminetreg deleted the feature/encode-struct-names branch March 6, 2016 21:48
@daminetreg daminetreg restored the feature/encode-struct-names branch September 9, 2016 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant