Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7ddce42
format: add checks for type alias
tomocy Jun 18, 2020
9159b57
modify using type alias match
tomocy Jun 19, 2020
aa2dd3c
modify to find all of non type alias type in line
tomocy Jun 19, 2020
c70a52e
add non type alias allowed type list
tomocy Jun 19, 2020
bf581d4
add trailing newline
tomocy Jun 22, 2020
658dc57
compile and combine regexs
tomocy Jun 22, 2020
a49224b
compile regexs
tomocy Jun 23, 2020
0387590
refactor names
tomocy Jun 23, 2020
06fe468
modify regex
tomocy Jun 23, 2020
143d0db
add check line format hook
tomocy Jun 25, 2020
cd5235b
add line format check for type alias
tomocy Jun 25, 2020
09a8d13
modify to check only source lines
tomocy Jun 25, 2020
7aef23a
fix
tomocy Jun 25, 2020
04c7681
format
tomocy Jun 25, 2020
50b3f10
add aggressive option
tomocy Jun 29, 2020
85d0cec
cherry pick check for type alias
tomocy Jun 29, 2020
c10380f
fix with type alias aggressively
tomocy Jun 29, 2020
9f9a80d
replace with type alias aggressively
tomocy Jun 29, 2020
3cfca33
declare type aliases
tomocy Jul 2, 2020
3818a44
fix format
tomocy Jul 2, 2020
2f6214e
declare type aliases
tomocy Jul 3, 2020
b9d2664
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 3, 2020
9fc4db1
delete line format check
tomocy Jul 3, 2020
f40c5c0
replace with type aliases
tomocy Jul 3, 2020
344eb82
fix not to replace type alias decl with template
tomocy Jul 3, 2020
9b1e477
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 7, 2020
6ace91c
replace with type aliases
tomocy Jul 7, 2020
e45a2a3
fix
tomocy Jul 9, 2020
5da95c9
fix
tomocy Jul 9, 2020
7005a0b
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 9, 2020
d7a323c
fix
tomocy Jul 9, 2020
934e9d3
replace with type aliases
tomocy Jul 10, 2020
5fdc789
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 11, 2020
91db93f
replace with type aliases
tomocy Jul 12, 2020
da9da08
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 12, 2020
02a46bd
fix
tomocy Jul 12, 2020
3c94bf2
replace with type aliases
tomocy Jul 12, 2020
4eb323d
fix
tomocy Jul 13, 2020
a66968a
fix not to fix typedef
tomocy Jul 13, 2020
47630b3
fix
tomocy Jul 13, 2020
1e9fffd
Merge branch 'master' of github.com:envoyproxy/envoy into format-add-…
tomocy Jul 14, 2020
5c20a6f
fix
tomocy Jul 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions include/envoy/buffer/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ class Instance {
};

using InstancePtr = std::unique_ptr<Instance>;
using InstanceSharedPtr = std::shared_ptr<Instance>;

/**
* A factory for creating buffers which call callbacks when reaching high and low watermarks.
Expand Down
5 changes: 4 additions & 1 deletion include/envoy/config/grpc_mux.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <memory>

#include "envoy/common/exception.h"
#include "envoy/common/pure.h"
#include "envoy/config/subscription.h"
Expand Down Expand Up @@ -119,6 +121,7 @@ class GrpcMux {
using GrpcMuxPtr = std::unique_ptr<GrpcMux>;
using GrpcMuxSharedPtr = std::shared_ptr<GrpcMux>;

template <class ResponseProto> using ResponseProtoPtr = std::unique_ptr<ResponseProto>;
/**
* A grouping of callbacks that a GrpcMux should provide to its GrpcStream.
*/
Expand All @@ -141,7 +144,7 @@ template <class ResponseProto> class GrpcStreamCallbacks {
/**
* For the GrpcStream to pass received protos to the context.
*/
virtual void onDiscoveryResponse(std::unique_ptr<ResponseProto>&& message,
virtual void onDiscoveryResponse(ResponseProtoPtr<ResponseProto>&& message,
ControlPlaneStats& control_plane_stats) PURE;

/**
Expand Down
7 changes: 5 additions & 2 deletions include/envoy/config/typed_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class TypedMetadata {
virtual ~Object() = default;
};

using ObjectConstPtr = std::unique_ptr<const Object>;

virtual ~TypedMetadata() = default;

/**
Expand All @@ -47,6 +49,8 @@ class TypedMetadata {
virtual const Object* getData(const std::string& key) const PURE;
};

using TypedMetadataPtr = std::unique_ptr<TypedMetadata>;

/**
* Typed metadata should implement this factory and register via Registry::registerFactory or the
* convenience class RegisterFactory.
Expand All @@ -62,8 +66,7 @@ class TypedMetadataFactory : public UntypedFactory {
* @return a derived class object pointer of TypedMetadata.
* @throw EnvoyException if the parsing can't be done.
*/
virtual std::unique_ptr<const TypedMetadata::Object>
parse(const ProtobufWkt::Struct& data) const PURE;
virtual TypedMetadata::ObjectConstPtr parse(const ProtobufWkt::Struct& data) const PURE;

std::string category() const override { return "envoy.typed_metadata"; }
};
Expand Down
4 changes: 4 additions & 0 deletions include/envoy/event/dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ struct DispatcherStats {
ALL_DISPATCHER_STATS(GENERATE_HISTOGRAM_STRUCT)
};

using DispatcherStatsPtr = std::unique_ptr<DispatcherStats>;

/**
* Callback invoked when a dispatcher post() runs.
*/
using PostCb = std::function<void()>;

using PostCbSharedPtr = std::shared_ptr<PostCb>;

/**
* Abstract event dispatching loop.
*/
Expand Down
2 changes: 2 additions & 0 deletions include/envoy/filesystem/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class Instance {
virtual bool illegalPath(const std::string& path) PURE;
};

using InstancePtr = std::unique_ptr<Instance>;

enum class FileType { Regular, Directory, Other };

struct DirectoryEntry {
Expand Down
8 changes: 8 additions & 0 deletions include/envoy/http/header_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class LowerCaseString {
std::string string_;
};

using LowerCaseStringPtr = std::unique_ptr<LowerCaseString>;

/**
* Convenient type for a vector of lower case string and string pair.
*/
Expand Down Expand Up @@ -717,6 +719,8 @@ class RequestOrResponseHeaderMap : public HeaderMap {
INLINE_REQ_RESP_HEADERS(DEFINE_INLINE_HEADER)
};

using RequestOrResponseHeaderMapPtr = std::unique_ptr<RequestOrResponseHeaderMap>;

// Request headers.
class RequestHeaderMap
: public RequestOrResponseHeaderMap,
Expand Down Expand Up @@ -748,14 +752,18 @@ class ResponseHeaderMap
public:
INLINE_RESP_HEADERS(DEFINE_INLINE_HEADER)
};

using ResponseHeaderMapPtr = std::unique_ptr<ResponseHeaderMap>;
using ResponseHeaderMapSharedPtr = std::shared_ptr<ResponseHeaderMap>;

// Response trailers.
class ResponseTrailerMap
: public ResponseHeaderOrTrailerMap,
public HeaderMap,
public CustomInlineHeaderBase<CustomInlineHeaderRegistry::Type::ResponseTrailers> {};

using ResponseTrailerMapPtr = std::unique_ptr<ResponseTrailerMap>;
using ResponseTrailerMapSharedPtr = std::shared_ptr<ResponseTrailerMap>;

/**
* Convenient container type for storing Http::LowerCaseString and std::string key/value pairs.
Expand Down
4 changes: 3 additions & 1 deletion include/envoy/http/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace Envoy {
namespace Http {

template <class TrailerType> using TrailerTypePtr = std::unique_ptr<TrailerType>;

/**
* Wraps an HTTP message including its headers, body, and any trailers.
*/
Expand Down Expand Up @@ -36,7 +38,7 @@ template <class HeaderType, class TrailerType> class Message {
* Set the trailers.
* @param trailers supplies the new trailers.
*/
virtual void trailers(std::unique_ptr<TrailerType>&& trailers) PURE;
virtual void trailers(TrailerTypePtr<TrailerType>&& trailers) PURE;

/**
* @return std::string the message body as a std::string.
Expand Down
2 changes: 2 additions & 0 deletions include/envoy/http/metadata_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class MetadataMapVector : public VectorMetadataMapPtr {
}
};

using MetadataMapVectorPtr = std::unique_ptr<MetadataMapVector>;

using MetadataCallback = std::function<void(MetadataMapPtr&&)>;

} // namespace Http
Expand Down
4 changes: 4 additions & 0 deletions include/envoy/init/manager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <memory>

#include "envoy/common/pure.h"
#include "envoy/init/target.h"
#include "envoy/init/watcher.h"
Expand Down Expand Up @@ -75,5 +77,7 @@ struct Manager {
virtual void initialize(const Watcher& watcher) PURE;
};

using ManagerPtr = std::unique_ptr<Manager>;

} // namespace Init
} // namespace Envoy
2 changes: 2 additions & 0 deletions include/envoy/network/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Connection : public Event::DeferredDeletable, public FilterManager {
Stats::Counter* delayed_close_timeouts_;
};

using ConnectionStatsPtr = std::unique_ptr<ConnectionStats>;

~Connection() override = default;

/**
Expand Down
1 change: 1 addition & 0 deletions include/envoy/network/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class FilterChain {
};

using FilterChainSharedPtr = std::shared_ptr<FilterChain>;
using FilterChainOptConstRef = absl::optional<std::reference_wrapper<const FilterChain>>;

/**
* A filter chain that can be drained.
Expand Down
1 change: 1 addition & 0 deletions include/envoy/network/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class Socket {

using OptionConstSharedPtr = std::shared_ptr<const Option>;
using Options = std::vector<OptionConstSharedPtr>;
using OptionsPtr = std::unique_ptr<Options>;
using OptionsSharedPtr = std::shared_ptr<Options>;

static OptionsSharedPtr& appendOptions(OptionsSharedPtr& to, const OptionsSharedPtr& from) {
Expand Down
4 changes: 4 additions & 0 deletions include/envoy/registry/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <algorithm>
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <vector>

Expand Down Expand Up @@ -70,6 +71,9 @@ template <class Base> class FactoryRegistryProxyImpl : public FactoryRegistryPro
}
};

template <class Base>
using FactoryRegistryProxyImplPtr = std::unique_ptr<FactoryRegistryProxyImpl<Base>>;

/**
* BaseFactoryCategoryRegistry holds the static factory map for
* FactoryCategoryRegistry, ensuring that friends of that class
Expand Down
4 changes: 4 additions & 0 deletions include/envoy/router/route_config_provider_manager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <memory>
#include <string>

#include "envoy/config/route/v3/route.pb.h"
Expand Down Expand Up @@ -55,5 +56,8 @@ class RouteConfigProviderManager {
ProtobufMessage::ValidationVisitor& validator) PURE;
};

using RouteConfigProviderManagerPtr = std::unique_ptr<RouteConfigProviderManager>;
using RouteConfigProviderManagerSharedPtr = std::shared_ptr<RouteConfigProviderManager>;

} // namespace Router
} // namespace Envoy
5 changes: 4 additions & 1 deletion include/envoy/router/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ using MetadataMatchCriterionConstSharedPtr = std::shared_ptr<const MetadataMatch

class MetadataMatchCriteria;
using MetadataMatchCriteriaConstPtr = std::unique_ptr<const MetadataMatchCriteria>;
using MetadataMatchCriteriaSharedPtr = std::shared_ptr<MetadataMatchCriteria>;

class MetadataMatchCriteria {
public:
Expand Down Expand Up @@ -1098,6 +1099,8 @@ using ConfigConstSharedPtr = std::shared_ptr<const Config>;
class GenericConnectionPoolCallbacks;
class GenericUpstream;

using GenericUpstreamPtr = std::unique_ptr<GenericUpstream>;

/**
* An API for wrapping either an HTTP or a TCP connection pool.
*
Expand Down Expand Up @@ -1184,7 +1187,7 @@ class GenericConnectionPoolCallbacks {
* @param upstream_local_address supplies the local address of the upstream connection.
* @param info supplies the stream info object associated with the upstream connection.
*/
virtual void onPoolReady(std::unique_ptr<GenericUpstream>&& upstream,
virtual void onPoolReady(GenericUpstreamPtr&& upstream,
Upstream::HostDescriptionConstSharedPtr host,
const Network::Address::InstanceConstSharedPtr& upstream_local_address,
const StreamInfo::StreamInfo& info) PURE;
Expand Down
2 changes: 2 additions & 0 deletions include/envoy/router/router_ratelimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class RateLimitPolicyEntry {
const envoy::config::core::v3::Metadata* dynamic_metadata) const PURE;
};

using RateLimitPolicyEntryPtr = std::unique_ptr<RateLimitPolicyEntry>;

/**
* Rate limiting policy.
*/
Expand Down
1 change: 1 addition & 0 deletions include/envoy/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ using LoaderPtr = std::unique_ptr<Loader>;
// protos being enabled or disabled by default.
using LoaderSingleton = InjectableSingleton<Loader>;
using ScopedLoaderSingleton = ScopedInjectableLoader<Loader>;
using ScopedLoaderSingletonPtr = std::unique_ptr<ScopedLoaderSingleton>;

} // namespace Runtime
} // namespace Envoy
3 changes: 3 additions & 0 deletions include/envoy/secret/secret_manager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <memory>
#include <string>

#include "envoy/config/core/v3/config_source.pb.h"
Expand Down Expand Up @@ -156,5 +157,7 @@ class SecretManager {
Server::Configuration::TransportSocketFactoryContext& secret_provider_context) PURE;
};

using SecretManagerPtr = std::unique_ptr<SecretManager>;

} // namespace Secret
} // namespace Envoy
3 changes: 3 additions & 0 deletions include/envoy/server/config_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ConfigTracker {
public:
using Cb = std::function<ProtobufTypes::MessagePtr()>;
using CbsMap = std::map<std::string, Cb>;
using CbsMapSharedPtr = std::shared_ptr<CbsMap>;

/**
* EntryOwner supplies RAII semantics for entries in the map.
Expand Down Expand Up @@ -55,5 +56,7 @@ class ConfigTracker {
virtual EntryOwnerPtr add(const std::string& key, Cb cb) PURE;
};

using ConfigTrackerSharedPtr = std::shared_ptr<ConfigTracker>;

} // namespace Server
} // namespace Envoy
3 changes: 3 additions & 0 deletions include/envoy/server/factory_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class CommonFactoryContext {
virtual Api::Api& api() PURE;
};

using CommonFactoryContextPtr = std::unique_ptr<CommonFactoryContext>;

/**
* ServerFactoryContext is an specialization of common interface for downstream and upstream network
* filters. The implementation guarantees the lifetime is no shorter than server. It could be used
Expand Down Expand Up @@ -249,6 +251,7 @@ class FilterChainFactoryContext : public virtual FactoryContext {
};

using FilterChainFactoryContextPtr = std::unique_ptr<FilterChainFactoryContext>;
using FilterChainFactoryContextSharedPtr = std::shared_ptr<FilterChainFactoryContext>;

/**
* An implementation of FactoryContext. The life time should cover the lifetime of the filter chains
Expand Down
4 changes: 4 additions & 0 deletions include/envoy/server/guarddog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <memory>

#include "envoy/common/pure.h"
#include "envoy/server/watchdog.h"

Expand Down Expand Up @@ -42,5 +44,7 @@ class GuardDog {
virtual void stopWatching(WatchDogSharedPtr wd) PURE;
};

using GuardDogPtr = std::unique_ptr<GuardDog>;

} // namespace Server
} // namespace Envoy
4 changes: 4 additions & 0 deletions include/envoy/server/health_checker_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <memory>

#include "envoy/common/random_generator.h"
#include "envoy/config/core/v3/health_check.pb.h"
#include "envoy/config/typed_config.h"
Expand Down Expand Up @@ -53,6 +55,8 @@ class HealthCheckerFactoryContext {
virtual Api::Api& api() PURE;
};

using HealthCheckerFactoryContextPtr = std::unique_ptr<HealthCheckerFactoryContext>;

/**
* Implemented by each custom health checker and registered via Registry::registerFactory()
* or the convenience class RegisterFactory.
Expand Down
3 changes: 3 additions & 0 deletions include/envoy/server/hot_restart.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <cstdint>
#include <memory>
#include <string>

#include "envoy/common/pure.h"
Expand Down Expand Up @@ -101,6 +102,8 @@ class HotRestart {
virtual Thread::BasicLockable& accessLogLock() PURE;
};

using HotRestartPtr = std::unique_ptr<HotRestart>;

/**
* HotRestartDomainSocketInUseException is thrown during HotRestart construction only when the
* underlying domain socket is in use.
Expand Down
3 changes: 3 additions & 0 deletions include/envoy/server/listener_manager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <memory>
#include <vector>

#include "envoy/admin/v3/config_dump.pb.h"
Expand Down Expand Up @@ -223,5 +224,7 @@ class ListenerManager {
virtual ApiListenerOptRef apiListener() PURE;
};

using ListenerManagerPtr = std::unique_ptr<ListenerManager>;

} // namespace Server
} // namespace Envoy
3 changes: 3 additions & 0 deletions include/envoy/server/overload_manager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <memory>
#include <string>
#include <unordered_map>

Expand Down Expand Up @@ -91,5 +92,7 @@ class OverloadManager {
virtual ThreadLocalOverloadState& getThreadLocalOverloadState() PURE;
};

using OverloadManagerPtr = std::unique_ptr<OverloadManager>;

} // namespace Server
} // namespace Envoy
Loading