AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CapabilityTag.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYTAG_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYTAG_H_
18 
19 #include <ostream>
20 #include <string>
21 
23 
24 namespace alexaClientSDK {
25 namespace avsCommon {
26 namespace avs {
27 
32 struct CapabilityTag {
43  const std::string& nameSpace,
44  const std::string& name,
45  const std::string& endpointId,
47 
53  CapabilityTag(const CapabilityTag& other) = default;
54 
56  const std::string nameSpace;
57 
59  const std::string name;
60 
62  const std::string endpointId;
63 
66 
75  bool operator<(const CapabilityTag& rhs) const;
77  bool operator==(const CapabilityTag& rhs) const;
78  bool operator!=(const CapabilityTag& rhs) const;
80 };
81 
89 inline std::ostream& operator<<(std::ostream& stream, const CapabilityTag& identifier) {
90  stream << "{endpointId:" << identifier.endpointId << ",namespace:" << identifier.nameSpace
91  << ",name:" << identifier.name;
92  if (identifier.instance.hasValue()) {
93  stream << ",instance:" << identifier.instance.value();
94  }
95  stream << "}";
96  return stream;
97 }
98 
99 } // namespace avs
100 } // namespace avsCommon
101 } // namespace alexaClientSDK
102 
103 namespace std {
104 
109 template <>
110 struct hash<alexaClientSDK::avsCommon::avs::CapabilityTag> {
111  size_t operator()(const alexaClientSDK::avsCommon::avs::CapabilityTag& in) const;
112 };
113 
114 } // namespace std
115 
116 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYTAG_H_
const std::string nameSpace
The namespace value of this message.
Definition: CapabilityTag.h:56
bool operator==(const CapabilityTag &rhs) const
Definition: CapabilityTag.cpp:41
CapabilityTag(const std::string &nameSpace, const std::string &name, const std::string &endpointId, const utils::Optional< std::string > &instanceId=utils::Optional< std::string >())
Definition: CapabilityTag.cpp:25
Definition: CapabilityTag.h:32
Definition: CapabilityConfiguration.h:190
bool operator!=(const CapabilityTag &rhs) const
Definition: CapabilityTag.cpp:46
const std::string name
The name value of this message.
Definition: CapabilityTag.h:59
bool hasValue() const
Definition: Optional.h:203
const std::string endpointId
The endpoint id of this message.
Definition: CapabilityTag.h:62
std::ostream & operator<<(std::ostream &stream, AlexaResponseType responseType)
Definition: AlexaResponseType.h:93
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
const utils::Optional< std::string > instance
The capability instance relative to this message if applicable; otherwise, an empty object...
Definition: CapabilityTag.h:65
ValueT value() const
Definition: Optional.h:208
bool operator<(const CapabilityTag &rhs) const
Definition: CapabilityTag.cpp:36

AlexaClientSDK 1.25.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0