Skip to content

Commit

Permalink
Remove location namespace in third_party/nearby.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 500023196
  • Loading branch information
suetfei authored and copybara-github committed Jan 6, 2023
1 parent 7afea00 commit 084f7eb
Show file tree
Hide file tree
Showing 714 changed files with 2,714 additions and 3,742 deletions.
2 changes: 0 additions & 2 deletions connections/advertising_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <string>

namespace location {
namespace nearby {
namespace connections {

Expand Down Expand Up @@ -49,4 +48,3 @@ AdvertisingOptions AdvertisingOptions::CompatibleOptions() const {

} // namespace connections
} // namespace nearby
} // namespace location
2 changes: 0 additions & 2 deletions connections/advertising_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "internal/platform/byte_array.h"
#include "proto/connections_enums.pb.h"

namespace location {
namespace nearby {
namespace connections {

Expand Down Expand Up @@ -54,6 +53,5 @@ struct AdvertisingOptions : public OptionsBase {

} // namespace connections
} // namespace nearby
} // namespace location

#endif // CORE_ADVERTISING_OPTIONS_H_
29 changes: 14 additions & 15 deletions connections/clients/ios/Internal/GNCAdvertiser.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@

NS_ASSUME_NONNULL_BEGIN

using ::location::nearby::ByteArrayFromNSData;
using ::location::nearby::CppStringFromObjCString;
using ::location::nearby::ObjCStringFromCppString;
using ::location::nearby::connections::ConnectionListener;
using ::location::nearby::connections::AdvertisingOptions;
using ::location::nearby::connections::ConnectionRequestInfo;
using ::location::nearby::connections::ConnectionResponseInfo;
using ::location::nearby::connections::GNCStrategyToStrategy;
using ::location::nearby::connections::Medium;
using ResultListener = ::location::nearby::connections::ResultCallback;
using ::location::nearby::connections::Status;
using ::nearby::ByteArrayFromNSData;
using ::nearby::CppStringFromObjCString;
using ::nearby::ObjCStringFromCppString;
using ::nearby::connections::AdvertisingOptions;
using ::nearby::connections::ConnectionListener;
using ::nearby::connections::ConnectionRequestInfo;
using ::nearby::connections::ConnectionResponseInfo;
using ::nearby::connections::GNCStrategyToStrategy;
using ::nearby::connections::Medium;
using ResultListener = ::nearby::connections::ResultCallback;
using ::nearby::connections::Status;

/** This is a GNCAdvertiserConnectionInfo that provides storage for its properties. */
@interface GNCAdvertiserConnectionInfo : NSObject
Expand Down Expand Up @@ -108,7 +108,7 @@ @interface GNCAdvertiser ()
@end

/** C++ classes passed to the core library by GNCAdvertiser. */
namespace location {

namespace nearby {
namespace connections {

Expand Down Expand Up @@ -268,9 +268,8 @@ void OnBandwidthChanged(const std::string &endpoint_id, Medium medium) {

} // namespace connections
} // namespace nearby
} // namespace location

using ::location::nearby::connections::GNCAdvertiserConnectionListener;
using ::nearby::connections::GNCAdvertiserConnectionListener;

@interface GNCAdvertiser () {
std::unique_ptr<GNCAdvertiserConnectionListener> advertiserListener;
Expand Down Expand Up @@ -304,7 +303,7 @@ + (instancetype)advertiserWithEndpointInfo:(NSData *)endpointInfo

AdvertisingOptions advertising_options;
advertising_options.strategy = GNCStrategyToStrategy(strategy);
advertising_options.allowed = location::nearby::connections::BooleanMediumSelector();
advertising_options.allowed = nearby::connections::BooleanMediumSelector();
advertising_options.auto_upgrade_bandwidth = true;
advertising_options.enforce_topology_constraints = true;

Expand Down
5 changes: 2 additions & 3 deletions connections/clients/ios/Internal/GNCCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
/** This class contains the C++ Core object. */
@interface GNCCore : NSObject {
@public
std::unique_ptr<::location::nearby::connections::Core> _core;
std::unique_ptr<::location::nearby::connections::ServiceControllerRouter>
_service_controller_router;
std::unique_ptr<::nearby::connections::Core> _core;
std::unique_ptr<::nearby::connections::ServiceControllerRouter> _service_controller_router;
}

@end
Expand Down
4 changes: 2 additions & 2 deletions connections/clients/ios/Internal/GNCCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "connections/implementation/service_controller_router.h"
#import "GoogleToolboxForMac/GTMLogger.h"

using ::location::nearby::connections::Core;
using ::location::nearby::connections::ServiceControllerRouter;
using ::nearby::connections::Core;
using ::nearby::connections::ServiceControllerRouter;

@implementation GNCCore {
}
Expand Down
22 changes: 10 additions & 12 deletions connections/clients/ios/Internal/GNCCoreConnection.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
#import "connections/clients/ios/Public/NearbyConnections/GNCPayload.h"
#import "internal/platform/implementation/apple/utils.h"

using ::location::nearby::ByteArrayFromNSData;
using ::location::nearby::CppStringFromObjCString;
using ::location::nearby::InputFile;
using ::location::nearby::InputStream;
using ::location::nearby::connections::Payload;
using ::location::nearby::PayloadId;
using ResultListener = ::location::nearby::connections::ResultCallback;

namespace location {
using ::nearby::ByteArrayFromNSData;
using ::nearby::CppStringFromObjCString;
using ::nearby::InputFile;
using ::nearby::InputStream;
using ::nearby::PayloadId;
using ::nearby::connections::Payload;
using ResultListener = ::nearby::connections::ResultCallback;

namespace nearby {
namespace connections {

Expand Down Expand Up @@ -83,7 +82,6 @@ Exception Close() override {

} // namespace connections
} // namespace nearby
} // namespace location

@implementation GNCPayloadInfo

Expand Down Expand Up @@ -142,8 +140,8 @@ - (NSProgress *)sendStreamPayload:(GNCStreamPayload *)payload

PayloadId payloadId = payload.identifier;
Payload corePayload(payloadId, [payload]() -> InputStream & {
location::nearby::connections::GNCInputStreamFromNSStream *stream =
new location::nearby::connections::GNCInputStreamFromNSStream(payload.stream);
nearby::connections::GNCInputStreamFromNSStream *stream =
new nearby::connections::GNCInputStreamFromNSStream(payload.stream);
return *stream;
});
return [self sendPayload:std::move(corePayload) size:-1 progress:progress completion:completion];
Expand Down
17 changes: 8 additions & 9 deletions connections/clients/ios/Internal/GNCDiscoverer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@

NS_ASSUME_NONNULL_BEGIN

using ::location::nearby::CppStringFromObjCString;
using ::location::nearby::connections::DiscoveryOptions;
using ::location::nearby::connections::DiscoveryListener;
using ::location::nearby::connections::GNCStrategyToStrategy;
using ResultListener = ::location::nearby::connections::ResultCallback;
using ::location::nearby::connections::Status;
using ::nearby::CppStringFromObjCString;
using ::nearby::connections::DiscoveryListener;
using ::nearby::connections::DiscoveryOptions;
using ::nearby::connections::GNCStrategyToStrategy;
using ResultListener = ::nearby::connections::ResultCallback;
using ::nearby::connections::Status;

/** This is a GNCDiscovererConnectionInfo that provides storage for its properties. */
@interface GNCDiscovererConnectionInfo : NSObject <GNCDiscovererConnectionInfo>
Expand Down Expand Up @@ -123,7 +123,7 @@ @interface GNCDiscoverer ()
@end

/** C++ classes passed to the core library by GNCDiscoverer. */
namespace location {

namespace nearby {
namespace connections {

Expand Down Expand Up @@ -349,9 +349,8 @@ void OnEndpointDistanceChanged_cb(const std::string &endpoint_id, DistanceInfo i

} // namespace connections
} // namespace nearby
} // namespace location

using ::location::nearby::connections::GNCDiscoveryListener;
using ::nearby::connections::GNCDiscoveryListener;

@interface GNCDiscoverer () {
std::unique_ptr<GNCDiscoveryListener> discoveryListener;
Expand Down
4 changes: 2 additions & 2 deletions connections/clients/ios/Internal/GNCPayload.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include <stdlib.h>

using ::location::nearby::connections::Payload;
using ::location::nearby::PayloadId;
using ::nearby::PayloadId;
using ::nearby::connections::Payload;

NS_ASSUME_NONNULL_BEGIN

Expand Down
2 changes: 0 additions & 2 deletions connections/clients/ios/Internal/GNCPayloadListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ NS_ASSUME_NONNULL_BEGIN

@class GNCPayloadInfo;

namespace location {
namespace nearby {
namespace connections {

Expand Down Expand Up @@ -53,7 +52,6 @@ class GNCPayloadListener : public PayloadListener {

} // namespace connections
} // namespace nearby
} // namespace location

NS_ASSUME_NONNULL_END

Expand Down
2 changes: 0 additions & 2 deletions connections/clients/ios/Internal/GNCPayloadListener.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

NS_ASSUME_NONNULL_BEGIN

namespace location {
namespace nearby {
namespace connections {

Expand Down Expand Up @@ -213,6 +212,5 @@

} // namespace connections
} // namespace nearby
} // namespace location

NS_ASSUME_NONNULL_END
2 changes: 0 additions & 2 deletions connections/clients/ios/Internal/GNCUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

NS_ASSUME_NONNULL_BEGIN

namespace location {
namespace nearby {
namespace connections {

Expand All @@ -33,7 +32,6 @@ const Strategy& GNCStrategyToStrategy(GNCStrategy strategy);

} // namespace connections
} // namespace nearby
} // namespace location

/** Internal-only properties of the connection result handlers class. */
@interface GNCConnectionResultHandlers ()
Expand Down
2 changes: 0 additions & 2 deletions connections/clients/ios/Internal/GNCUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

NS_ASSUME_NONNULL_BEGIN

namespace location {
namespace nearby {
namespace connections {

Expand All @@ -37,7 +36,6 @@

} // namespace connections
} // namespace nearby
} // namespace location

@implementation GNCConnectionHandlers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#import <Foundation/Foundation.h>

#ifdef __cplusplus
namespace location {

namespace nearby {
class InputStream;
}
} // namespace location

#endif

@interface CPPInputStreamBinding : NSObject
Expand All @@ -44,7 +44,7 @@ class InputStream;
*
* @param stream The stream that has a c++ pointer associated with it.
*/
+ (location::nearby::InputStream &)getRefFromStream:(NSInputStream *)stream;
+ (nearby::InputStream &)getRefFromStream:(NSInputStream *)stream;
#endif

@end
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
// TODO(b/239758418): Change this to the non-internal version when available.
#include "internal/platform/input_stream.h"

using ::location::nearby::ByteArray;
using ::location::nearby::Exception;
using ::location::nearby::ExceptionOr;
using ::location::nearby::InputStream;
using ::nearby::ByteArray;
using ::nearby::Exception;
using ::nearby::ExceptionOr;
using ::nearby::InputStream;

class CPPInputStream : public InputStream {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
#import "connections/clients/swift/NearbyCoreAdapter/Sources/Public/NearbyCoreAdapter/GNCAdvertisingOptions.h"

#ifdef __cplusplus
namespace location {

namespace nearby {
namespace connections {
class AdvertisingOptions;
}
} // namespace nearby
} // namespace location

#endif

@interface GNCAdvertisingOptions (CppConversions)

#ifdef __cplusplus
- (location::nearby::connections::AdvertisingOptions)toCpp;
- (nearby::connections::AdvertisingOptions)toCpp;
#endif

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#import "connections/clients/swift/NearbyCoreAdapter/Sources/GNCAdvertisingOptions+CppConversions.h"
#import "connections/clients/swift/NearbyCoreAdapter/Sources/GNCStrategy+Internal.h"

using ::location::nearby::connections::AdvertisingOptions;
using ::location::nearby::connections::CppStrategyFromGNCStrategy;
using ::nearby::connections::AdvertisingOptions;
using ::nearby::connections::CppStrategyFromGNCStrategy;

@implementation GNCAdvertisingOptions (CppConversions)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
#import "connections/clients/swift/NearbyCoreAdapter/Sources/Public/NearbyCoreAdapter/GNCConnectionOptions.h"

#ifdef __cplusplus
namespace location {

namespace nearby {
namespace connections {
class ConnectionOptions;
}
} // namespace nearby
} // namespace location

#endif

@interface GNCConnectionOptions (CppConversions)

#ifdef __cplusplus
- (location::nearby::connections::ConnectionOptions)toCpp;
- (nearby::connections::ConnectionOptions)toCpp;
#endif

@end
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#import "connections/clients/swift/NearbyCoreAdapter/Sources/GNCConnectionOptions+CppConversions.h"

using ::location::nearby::connections::ConnectionOptions;
using ::nearby::connections::ConnectionOptions;

@implementation GNCConnectionOptions (CppConversions)

Expand Down
Loading

0 comments on commit 084f7eb

Please sign in to comment.