File tree Expand file tree Collapse file tree
include/smithy/client/schema
source/smithy/client/schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,5 +21,7 @@ class JsonNameTrait : public Trait {
2121 Aws::String m_value;
2222};
2323
24+ extern template class TraitKey <JsonNameTrait>;
25+
2426} // namespace schema
2527} // namespace smithy
Original file line number Diff line number Diff line change @@ -22,5 +22,7 @@ class TimestampFormatTrait : public Trait {
2222 Format m_format;
2323};
2424
25+ extern template class TraitKey <TimestampFormatTrait>;
26+
2527} // namespace schema
2628} // namespace smithy
Original file line number Diff line number Diff line change @@ -20,10 +20,7 @@ SMITHY_API int NextTraitKey();
2020template <typename T>
2121class TraitKey : public TraitKeyBase {
2222 public:
23- static const TraitKey& Instance () {
24- static const TraitKey instance (NextTraitKey ());
25- return instance;
26- }
23+ static const TraitKey& Instance ();
2724
2825 private:
2926 explicit TraitKey (int id) : TraitKeyBase(id) {}
Original file line number Diff line number Diff line change @@ -83,5 +83,14 @@ class XmlMapValueNameTrait : public Trait {
8383 Aws::String m_value;
8484};
8585
86+ extern template class TraitKey <XmlNameTrait>;
87+ extern template class TraitKey <XmlFlattenedTrait>;
88+ extern template class TraitKey <XmlAttributeTrait>;
89+ extern template class TraitKey <XmlNamespaceTrait>;
90+ extern template class TraitKey <XmlListItemNameTrait>;
91+ extern template class TraitKey <XmlMapEntryNameTrait>;
92+ extern template class TraitKey <XmlMapKeyNameTrait>;
93+ extern template class TraitKey <XmlMapValueNameTrait>;
94+
8695} // namespace schema
8796} // namespace smithy
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ * SPDX-License-Identifier: Apache-2.0.
4+ */
5+ #include < smithy/client/schema/JsonTraits.h>
6+ #include < smithy/client/schema/SerdeTraits.h>
17#include < smithy/client/schema/TraitKey.h>
8+ #include < smithy/client/schema/XmlTraits.h>
29
310#include < atomic>
411
@@ -8,5 +15,23 @@ namespace schema {
815static std::atomic<int > s_traitIdCounter{0 };
916
1017int NextTraitKey () { return s_traitIdCounter.fetch_add (1 , std::memory_order_relaxed); }
18+
19+ template <typename T>
20+ const TraitKey<T>& TraitKey<T>::Instance() {
21+ static const TraitKey instance (NextTraitKey ());
22+ return instance;
23+ }
24+
25+ template class TraitKey <JsonNameTrait>;
26+ template class TraitKey <TimestampFormatTrait>;
27+ template class TraitKey <XmlNameTrait>;
28+ template class TraitKey <XmlFlattenedTrait>;
29+ template class TraitKey <XmlAttributeTrait>;
30+ template class TraitKey <XmlNamespaceTrait>;
31+ template class TraitKey <XmlListItemNameTrait>;
32+ template class TraitKey <XmlMapEntryNameTrait>;
33+ template class TraitKey <XmlMapKeyNameTrait>;
34+ template class TraitKey <XmlMapValueNameTrait>;
35+
1136} // namespace schema
12- } // namespace smithy
37+ } // namespace smithy
You can’t perform that action at this time.
0 commit comments