/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace GameLift { namespace Model { namespace IpProtocolMapper { static const int TCP_HASH = HashingUtils::HashString("TCP"); static const int UDP_HASH = HashingUtils::HashString("UDP"); IpProtocol GetIpProtocolForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == TCP_HASH) { return IpProtocol::TCP; } else if (hashCode == UDP_HASH) { return IpProtocol::UDP; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return IpProtocol::NOT_SET; } Aws::String GetNameForIpProtocol(IpProtocol enumValue) { switch(enumValue) { case IpProtocol::TCP: return "TCP"; case IpProtocol::UDP: return "UDP"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace IpProtocolMapper } // namespace Model } // namespace GameLift } // namespace Aws