diff --git a/.gitignore b/.gitignore index 57ab92c5d7c..e5d34760c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ util/all_util.cpp util/charset/all_charset.cpp cmake-build-debug +llvm.sh diff --git a/client/draft/ydb_dynamic_config.cpp b/client/draft/ydb_dynamic_config.cpp index e8f288d1491..e4cfceb0d07 100644 --- a/client/draft/ydb_dynamic_config.cpp +++ b/client/draft/ydb_dynamic_config.cpp @@ -58,7 +58,7 @@ class TDynamicConfigClient::TImpl : public TClientImplCommon& ids, const TClusterConfigSettings& settings = {}) { + TAsyncStatus RemoveVolatileConfig(const TString& cluster, ui64 version, const std::vector& ids, const TClusterConfigSettings& settings = {}) { auto request = MakeOperationRequest(settings); request.mutable_identity()->set_cluster(cluster); @@ -87,7 +87,7 @@ class TDynamicConfigClient::TImpl : public TClientImplCommon& ids, const TClusterConfigSettings& settings = {}) { + TAsyncStatus ForceRemoveVolatileConfig(const std::vector& ids, const TClusterConfigSettings& settings = {}) { auto request = MakeOperationRequest(settings); for (auto& id: ids) { @@ -308,9 +308,9 @@ class TDynamicConfigClient::TImpl : public TClientImplCommonUnpackTo(&result)) { for (auto& config : result.configs()) { - TSet> labelSets; + TSet> labelSets; for (auto& labelSet : config.label_sets()) { - TVector set; + std::vector set; for (auto& label : labelSet.labels()) { labels.insert(label.label()); set.push_back(TVerboseResolveConfigResult::TLabel{convert(label.type()), label.value()}); @@ -373,7 +373,7 @@ TAsyncStatus TDynamicConfigClient::AddVolatileConfig( TAsyncStatus TDynamicConfigClient::RemoveVolatileConfig( const TString& cluster, ui64 version, - const TVector& ids, + const std::vector& ids, const TClusterConfigSettings& settings) { return Impl_->RemoveVolatileConfig(cluster, version, ids, settings); } @@ -386,7 +386,7 @@ TAsyncStatus TDynamicConfigClient::RemoveAllVolatileConfigs( } TAsyncStatus TDynamicConfigClient::ForceRemoveVolatileConfig( - const TVector& ids, + const std::vector& ids, const TClusterConfigSettings& settings) { return Impl_->ForceRemoveVolatileConfig(ids, settings); } diff --git a/client/draft/ydb_dynamic_config.h b/client/draft/ydb_dynamic_config.h index ea5ea2670d5..25c9457b38c 100644 --- a/client/draft/ydb_dynamic_config.h +++ b/client/draft/ydb_dynamic_config.h @@ -140,7 +140,7 @@ struct TVerboseResolveConfigResult : public TStatus { } }; - using ConfigByLabelSet = TMap>, TString>; + using ConfigByLabelSet = TMap>, TString>; TVerboseResolveConfigResult( TStatus&& status, @@ -200,7 +200,7 @@ class TDynamicConfigClient { TAsyncStatus RemoveVolatileConfig( const TString& cluster, ui64 version, - const TVector& ids, + const std::vector& ids, const TClusterConfigSettings& settings = {}); // Remove all volatile config @@ -211,7 +211,7 @@ class TDynamicConfigClient { // Remove specific volatile configs TAsyncStatus ForceRemoveVolatileConfig( - const TVector& ids, + const std::vector& ids, const TClusterConfigSettings& settings = {}); // Remove all volatile config diff --git a/client/draft/ydb_scripting.cpp b/client/draft/ydb_scripting.cpp index a642be090a6..7c464120cd1 100644 --- a/client/draft/ydb_scripting.cpp +++ b/client/draft/ydb_scripting.cpp @@ -14,13 +14,13 @@ namespace NScripting { using namespace NThreading; -TExecuteYqlResult::TExecuteYqlResult(TStatus&& status, TVector&& resultSets, +TExecuteYqlResult::TExecuteYqlResult(TStatus&& status, std::vector&& resultSets, const TMaybe& queryStats) : TStatus(std::move(status)) , ResultSets_(std::move(resultSets)) , QueryStats_(queryStats) {} -const TVector& TExecuteYqlResult::GetResultSets() const { +const std::vector& TExecuteYqlResult::GetResultSets() const { return ResultSets_; } @@ -163,7 +163,7 @@ class TScriptingClient::TImpl : public TClientImplCommon res; + std::vector res; TMaybe queryStats; if (any) { Ydb::Scripting::ExecuteYqlResult result; diff --git a/client/draft/ydb_scripting.h b/client/draft/ydb_scripting.h index 1b848a78c0d..c3b39282009 100644 --- a/client/draft/ydb_scripting.h +++ b/client/draft/ydb_scripting.h @@ -9,10 +9,10 @@ namespace NScripting { class TExecuteYqlResult : public TStatus { public: - TExecuteYqlResult(TStatus&& status, TVector&& resultSets, + TExecuteYqlResult(TStatus&& status, std::vector&& resultSets, const TMaybe& queryStats); - const TVector& GetResultSets() const; + const std::vector& GetResultSets() const; TResultSet GetResultSet(size_t resultIndex) const; TResultSetParser GetResultSetParser(size_t resultIndex) const; @@ -20,7 +20,7 @@ class TExecuteYqlResult : public TStatus { const TMaybe& GetStats() const; private: - TVector ResultSets_; + std::vector ResultSets_; TMaybe QueryStats_; }; diff --git a/client/extensions/solomon_stats/pull_client.cpp b/client/extensions/solomon_stats/pull_client.cpp index ec7b0f0db68..2e779c9a1d2 100644 --- a/client/extensions/solomon_stats/pull_client.cpp +++ b/client/extensions/solomon_stats/pull_client.cpp @@ -7,7 +7,7 @@ TSolomonStatPullExtension::TParams::TParams(const TString& host , const TString& project , const TString& service , const TString& cluster - , const TVector>& labels) + , const std::vector>& labels) : Host_(host), Port_(port), Labels_() { Labels_.Add("project", project); diff --git a/client/extensions/solomon_stats/pull_client.h b/client/extensions/solomon_stats/pull_client.h index 6fbc36326d2..43382367450 100644 --- a/client/extensions/solomon_stats/pull_client.h +++ b/client/extensions/solomon_stats/pull_client.h @@ -9,8 +9,6 @@ #include #include -#include - namespace NSolomonStatExtension { class TSolomonStatPullExtension: public NYdb::IExtension { @@ -26,7 +24,7 @@ class TSolomonStatPullExtension: public NYdb::IExtension { , const TString& project , const TString& service , const TString& cluster - , const TVector>& labels = {}); + , const std::vector>& labels = {}); NMonitoring::TLabels GetLabels() const; diff --git a/client/impl/ydb_endpoints/endpoints_ut.cpp b/client/impl/ydb_endpoints/endpoints_ut.cpp index e131c6cb16f..562df0059f5 100644 --- a/client/impl/ydb_endpoints/endpoints_ut.cpp +++ b/client/impl/ydb_endpoints/endpoints_ut.cpp @@ -60,7 +60,7 @@ class TDiscoveryEmulator : public TThread { void Exec() { for (ui64 i = 0; i < MaxEvents_; i++) { ui8 mask = RandomNumber(16); - TVector endpoints; + std::vector endpoints; for (size_t i = 0; i < Pool_.size(); i++) { if (mask & (1 << i)) @@ -76,7 +76,7 @@ class TDiscoveryEmulator : public TThread { Finished_.store(true); } - const TVector& GetPool() const { + const std::vector& GetPool() const { return Pool_; } @@ -89,10 +89,10 @@ class TDiscoveryEmulator : public TThread { ui64 MaxEvents_; std::atomic_bool Finished_; - static const TVector Pool_; + static const std::vector Pool_; }; -const TVector TDiscoveryEmulator::Pool_ = TVector{{"One", 1}, {"Two", 2}, {"Three", 3}, {"Four", 4}}; +const std::vector TDiscoveryEmulator::Pool_ = std::vector{{"One", 1}, {"Two", 2}, {"Three", 3}, {"Four", 4}}; Y_UNIT_TEST_SUITE(CheckUtils) { @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(EndpointElector) { Y_UNIT_TEST(GetEndpoint) { TEndpointElectorSafe elector; - elector.SetNewState(TVector{{"Two", 0, "", 2}, {"One", 0, "", 1}}); + elector.SetNewState(std::vector{{"Two", 0, "", 2}, {"One", 0, "", 1}}); UNIT_ASSERT_VALUES_EQUAL(elector.GetEndpoint(TEndpointKey("One", 0), true).Endpoint, "One"); UNIT_ASSERT_VALUES_EQUAL(elector.GetEndpoint(TEndpointKey("Two", 0), true).Endpoint, "Two"); UNIT_ASSERT_VALUES_EQUAL(elector.GetEndpoint(TEndpointKey("", 1), true).NodeId, 1); @@ -127,26 +127,26 @@ Y_UNIT_TEST_SUITE(EndpointElector) { Y_UNIT_TEST(DiffOnRemove) { TEndpointElectorSafe elector; - auto removed = elector.SetNewState(TVector{{"Two", 2}, {"One", 1}}); + auto removed = elector.SetNewState(std::vector{{"Two", 2}, {"One", 1}}); UNIT_ASSERT_VALUES_EQUAL(removed.size(), 0); - removed = elector.SetNewState(TVector{{"One", 1}}); + removed = elector.SetNewState(std::vector{{"One", 1}}); UNIT_ASSERT_VALUES_EQUAL(removed.size(), 1); UNIT_ASSERT_VALUES_EQUAL(removed[0], TString("Two")); } Y_UNIT_TEST(Pessimization) { TEndpointElectorSafe elector; - elector.SetNewState(TVector{{"Two", 2}, {"One", 1}}); + elector.SetNewState(std::vector{{"Two", 2}, {"One", 1}}); UNIT_ASSERT_VALUES_EQUAL(elector.GetPessimizationRatio(), 0); elector.PessimizeEndpoint("One"); UNIT_ASSERT_VALUES_EQUAL(elector.GetPessimizationRatio(), 50); - elector.SetNewState(TVector{{"Two", 2}}); + elector.SetNewState(std::vector{{"Two", 2}}); UNIT_ASSERT_VALUES_EQUAL(elector.GetPessimizationRatio(), 0); } Y_UNIT_TEST(Election) { TEndpointElectorSafe elector; - elector.SetNewState(TVector{{"Two", 2}, {"One_A", 1}, {"Three", 3}, {"One_B", 1}}); + elector.SetNewState(std::vector{{"Two", 2}, {"One_A", 1}, {"Three", 3}, {"One_B", 1}}); std::unordered_set endpoints; // Just to make sure no possible to get more than expected size_t extra_attempts = 1000; @@ -158,7 +158,7 @@ Y_UNIT_TEST_SUITE(EndpointElector) { UNIT_ASSERT(endpoints.find("One_A") != endpoints.end()); UNIT_ASSERT(endpoints.find("One_B") != endpoints.end()); - elector.SetNewState(TVector{{"One", 1}}); + elector.SetNewState(std::vector{{"One", 1}}); // no preferred endpoint, expect avaliable UNIT_ASSERT_VALUES_EQUAL(elector.GetEndpoint(TEndpointKey("Three", 0)).Endpoint, "One"); UNIT_ASSERT_VALUES_EQUAL(elector.GetEndpoint(TEndpointKey()).Endpoint, "One"); @@ -174,7 +174,7 @@ Y_UNIT_TEST_SUITE(EndpointElector) { int counter1 = 0; int counter2 = 0; - TVector> storage; + std::vector> storage; while (!emulator.Finished()) { auto obj = std::make_unique(counter2); if (elector.LinkObjToEndpoint(TEndpointKey("Two", 2), obj.get(), nullptr)) { @@ -194,7 +194,7 @@ Y_UNIT_TEST_SUITE(EndpointElector) { Y_UNIT_TEST(EndpointAssiciationSingleThread) { TEndpointElectorSafe elector; - elector.SetNewState(TVector{{"Two", 2, "", 2}, {"One_A", 10, "", 10}, {"Three", 3, "", 3}, {"One_B", 4, "", 4}}); + elector.SetNewState(std::vector{{"Two", 2, "", 2}, {"One_A", 10, "", 10}, {"Three", 3, "", 3}, {"One_B", 4, "", 4}}); auto obj1 = std::make_unique(); auto obj2 = std::make_unique(); @@ -280,7 +280,7 @@ Y_UNIT_TEST_SUITE(EndpointElector) { obj1.reset(new TTestObj()); elector.LinkObjToEndpoint(TEndpointKey("Two", 2), obj1.get(), nullptr); - elector.SetNewState(TVector{{"Two", 2, "", 2}, {"One_A", 10, "", 10}, {"One_C", 1, "", 1}}); + elector.SetNewState(std::vector{{"Two", 2, "", 2}, {"One_A", 10, "", 10}, {"One_C", 1, "", 1}}); UNIT_ASSERT_VALUES_EQUAL(obj1->HostRemoved(), false); UNIT_ASSERT_VALUES_EQUAL(obj2->HostRemoved(), true); diff --git a/client/impl/ydb_internal/scheme_helpers/helpers.h b/client/impl/ydb_internal/scheme_helpers/helpers.h index 783c0c3c91f..d5a1de5324a 100644 --- a/client/impl/ydb_internal/scheme_helpers/helpers.h +++ b/client/impl/ydb_internal/scheme_helpers/helpers.h @@ -1,13 +1,14 @@ #pragma once #include +#include namespace NYdb { template -inline void PermissionToSchemeEntry(const TFrom& from, TVector* to) { +inline void PermissionToSchemeEntry(const TFrom& from, std::vector* to) { for (const auto& effPerm : from) { - to->push_back(NScheme::TPermissions{effPerm.subject(), TVector()}); + to->push_back(NScheme::TPermissions{effPerm.subject(), std::vector()}); for (const auto& permName : effPerm.permission_names()) { to->back().PermissionNames.push_back(permName); } diff --git a/client/impl/ydb_internal/session_pool/session_pool.cpp b/client/impl/ydb_internal/session_pool/session_pool.cpp index 4861d911d36..f623cf5e0f6 100644 --- a/client/impl/ydb_internal/session_pool/session_pool.cpp +++ b/client/impl/ydb_internal/session_pool/session_pool.cpp @@ -77,7 +77,7 @@ std::unique_ptr TSessionPool::TWaitersQueue::TryGet() { return result; } -void TSessionPool::TWaitersQueue::GetOld(TInstant now, TVector>& oldWaiters) { +void TSessionPool::TWaitersQueue::GetOld(TInstant now, std::vector>& oldWaiters) { auto it = Waiters_.begin(); while (it != Waiters_.end()) { if (now < it->first + MaxWaitSessionTimeout_) @@ -265,11 +265,11 @@ TPeriodicCb TSessionPool::CreatePeriodicTask(std::weak_ptr weakC return false; } else { auto keepAliveBatchSize = PERIODIC_ACTION_BATCH_SIZE; - TVector> sessionsToTouch; + std::vector> sessionsToTouch; sessionsToTouch.reserve(keepAliveBatchSize); - TVector> sessionsToDelete; + std::vector> sessionsToDelete; sessionsToDelete.reserve(keepAliveBatchSize); - TVector> waitersToReplyError; + std::vector> waitersToReplyError; waitersToReplyError.reserve(keepAliveBatchSize); const auto now = TInstant::Now(); { diff --git a/client/impl/ydb_internal/session_pool/session_pool.h b/client/impl/ydb_internal/session_pool/session_pool.h index ad5c8d2e215..0451c94a9f5 100644 --- a/client/impl/ydb_internal/session_pool/session_pool.h +++ b/client/impl/ydb_internal/session_pool/session_pool.h @@ -90,7 +90,7 @@ class TSessionPool { // otherwise returns false and doesn't not touch ctx bool TryPush(std::unique_ptr& p); std::unique_ptr TryGet(); - void GetOld(TInstant now, TVector>& oldWaiters); + void GetOld(TInstant now, std::vector>& oldWaiters); ui32 Size() const; private: diff --git a/client/ydb_coordination/coordination.cpp b/client/ydb_coordination/coordination.cpp index 48fbaf6fd20..ef7da8baa8c 100644 --- a/client/ydb_coordination/coordination.cpp +++ b/client/ydb_coordination/coordination.cpp @@ -93,7 +93,7 @@ struct TNodeDescription::TImpl { EConsistencyMode AttachConsistencyMode_; ERateLimiterCountersMode RateLimiterCountersMode_; TString Owner_; - TVector EffectivePermissions_; + std::vector EffectivePermissions_; Ydb::Coordination::DescribeNodeResult Proto_; }; @@ -126,7 +126,7 @@ const TString& TNodeDescription::GetOwner() const { return Impl_->Owner_; } -const TVector& TNodeDescription::GetEffectivePermissions() const { +const std::vector& TNodeDescription::GetEffectivePermissions() const { return Impl_->EffectivePermissions_; } diff --git a/client/ydb_coordination/coordination.h b/client/ydb_coordination/coordination.h index 82343594a2c..9e09a9f7708 100644 --- a/client/ydb_coordination/coordination.h +++ b/client/ydb_coordination/coordination.h @@ -106,7 +106,7 @@ class TNodeDescription { ERateLimiterCountersMode GetRateLimiterCountersMode() const; const TString& GetOwner() const; - const TVector& GetEffectivePermissions() const; + const std::vector& GetEffectivePermissions() const; const Ydb::Coordination::DescribeNodeResult& GetProto() const; private: @@ -150,8 +150,8 @@ class TSemaphoreDescription { const TString& GetData() const { return Data_; } ui64 GetCount() const { return Count_; } ui64 GetLimit() const { return Limit_; } - const TVector& GetOwners() const { return Owners_; } - const TVector& GetWaiters() const { return Waiters_; } + const std::vector& GetOwners() const { return Owners_; } + const std::vector& GetWaiters() const { return Waiters_; } bool IsEphemeral() const { return IsEphemeral_; } private: @@ -159,8 +159,8 @@ class TSemaphoreDescription { TString Data_; ui64 Count_; ui64 Limit_; - TVector Owners_; - TVector Waiters_; + std::vector Owners_; + std::vector Waiters_; bool IsEphemeral_; }; diff --git a/client/ydb_discovery/discovery.cpp b/client/ydb_discovery/discovery.cpp index 543ec565c4b..c569864feb3 100644 --- a/client/ydb_discovery/discovery.cpp +++ b/client/ydb_discovery/discovery.cpp @@ -34,7 +34,7 @@ TListEndpointsResult::TListEndpointsResult(TStatus&& status, const Ydb::Discover } } -const TVector& TListEndpointsResult::GetEndpointsInfo() const { +const std::vector& TListEndpointsResult::GetEndpointsInfo() const { return Info_; } @@ -53,7 +53,7 @@ const TString& TWhoAmIResult::GetUserName() const { return UserName_; } -const TVector& TWhoAmIResult::GetGroups() const { +const std::vector& TWhoAmIResult::GetGroups() const { return Groups_; } @@ -122,7 +122,7 @@ bool TNodeRegistrationResult::HasScopePathId() const { return ScopePathId_.value(); } -const TVector& TNodeRegistrationResult::GetNodes() const { +const std::vector& TNodeRegistrationResult::GetNodes() const { return Nodes_; } diff --git a/client/ydb_discovery/discovery.h b/client/ydb_discovery/discovery.h index 708e0e063f2..f5083b350fd 100644 --- a/client/ydb_discovery/discovery.h +++ b/client/ydb_discovery/discovery.h @@ -55,20 +55,20 @@ struct TEndpointInfo { ui32 Port = 0; float LoadFactor = 0.0; bool Ssl = false; - TVector Services; + std::vector Services; TString Location; ui32 NodeId = 0; - TVector IPv4Addrs; - TVector IPv6Addrs; + std::vector IPv4Addrs; + std::vector IPv6Addrs; TString SslTargetNameOverride; }; class TListEndpointsResult : public TStatus { public: TListEndpointsResult(TStatus&& status, const Ydb::Discovery::ListEndpointsResult& endpoints); - const TVector& GetEndpointsInfo() const; + const std::vector& GetEndpointsInfo() const; private: - TVector Info_; + std::vector Info_; }; using TAsyncListEndpointsResult = NThreading::TFuture; @@ -77,10 +77,10 @@ class TWhoAmIResult : public TStatus { public: TWhoAmIResult(TStatus&& status, const Ydb::Discovery::WhoAmIResult& proto); const TString& GetUserName() const; - const TVector& GetGroups() const; + const std::vector& GetGroups() const; private: TString UserName_; - TVector Groups_; + std::vector Groups_; }; using TAsyncWhoAmIResult = NThreading::TFuture; @@ -109,7 +109,7 @@ class TNodeRegistrationResult : public TStatus { bool HasScopeTabletId() const; const ui64& GetScopePathId() const; bool HasScopePathId() const; - const TVector& GetNodes() const; + const std::vector& GetNodes() const; private: ui32 NodeId_; @@ -117,7 +117,7 @@ class TNodeRegistrationResult : public TStatus { ui64 Expire_; std::optional ScopeTableId_; std::optional ScopePathId_; - TVector Nodes_; + std::vector Nodes_; }; using TAsyncNodeRegistrationResult = NThreading::TFuture; diff --git a/client/ydb_driver/driver_ut.cpp b/client/ydb_driver/driver_ut.cpp index 631362adb05..b0bd4b54da8 100644 --- a/client/ydb_driver/driver_ut.cpp +++ b/client/ydb_driver/driver_ut.cpp @@ -126,7 +126,7 @@ Y_UNIT_TEST_SUITE(CppGrpcClientSimpleTest) { return result.GetStatus(); }; - TVector InvalidTokens = { + std::vector InvalidTokens = { TString('\t'), TString('\n'), TString('\r') @@ -135,7 +135,7 @@ Y_UNIT_TEST_SUITE(CppGrpcClientSimpleTest) { UNIT_ASSERT_EQUAL(checkToken(t), EStatus::CLIENT_UNAUTHENTICATED); } - TVector ValidTokens = { + std::vector ValidTokens = { TString("qwerty 1234 <>,.?/:;\"'\\|}{~`!@#$%^&*()_+=-"), TString() }; diff --git a/client/ydb_export/export.cpp b/client/ydb_export/export.cpp index f1aaf589708..23f73e1914f 100644 --- a/client/ydb_export/export.cpp +++ b/client/ydb_export/export.cpp @@ -30,8 +30,8 @@ TInstant ProtoTimestampToInstant(const NProtoBuf::Timestamp& timestamp) { return TInstant::MicroSeconds(us); } -TVector ItemsProgressFromProto(const google::protobuf::RepeatedPtrField& proto) { - TVector result(Reserve(proto.size())); +std::vector ItemsProgressFromProto(const google::protobuf::RepeatedPtrField& proto) { + std::vector result(proto.size()); for (const auto& protoItem : proto) { auto& item = result.emplace_back(); diff --git a/client/ydb_export/export.h b/client/ydb_export/export.h index 3c5974d3c23..df3e01385a6 100644 --- a/client/ydb_export/export.h +++ b/client/ydb_export/export.h @@ -48,7 +48,7 @@ class TExportToYtResponse : public TOperation { struct TMetadata { TExportToYtSettings Settings; EExportProgress Progress; - TVector ItemsProgress; + std::vector ItemsProgress; }; public: @@ -97,7 +97,7 @@ class TExportToS3Response : public TOperation { struct TMetadata { TExportToS3Settings Settings; EExportProgress Progress; - TVector ItemsProgress; + std::vector ItemsProgress; }; public: diff --git a/client/ydb_federated_topic/federated_topic.h b/client/ydb_federated_topic/federated_topic.h index d179d20cfe3..76a1f3c7d52 100644 --- a/client/ydb_federated_topic/federated_topic.h +++ b/client/ydb_federated_topic/federated_topic.h @@ -111,7 +111,7 @@ struct TReadSessionEvent { public: TDataReceivedEvent(NTopic::TReadSessionEvent::TDataReceivedEvent event, std::shared_ptr db); - TDataReceivedEvent(TVector messages, TVector compressedMessages, + TDataReceivedEvent(std::vector messages, std::vector compressedMessages, NTopic::TPartitionSession::TPtr partitionSession, std::shared_ptr db); const NTopic::TPartitionSession::TPtr& GetPartitionSession() const override { @@ -127,23 +127,23 @@ struct TReadSessionEvent { } //! Get messages. - TVector& GetMessages() { + std::vector& GetMessages() { CheckMessagesFilled(false); return Messages; } - const TVector& GetMessages() const { + const std::vector& GetMessages() const { CheckMessagesFilled(false); return Messages; } //! Get compressed messages. - TVector& GetCompressedMessages() { + std::vector& GetCompressedMessages() { CheckMessagesFilled(true); return CompressedMessages; } - const TVector& GetCompressedMessages() const { + const std::vector& GetCompressedMessages() const { CheckMessagesFilled(true); return CompressedMessages; } @@ -163,8 +163,8 @@ struct TReadSessionEvent { } private: - TVector Messages; - TVector CompressedMessages; + std::vector Messages; + std::vector CompressedMessages; std::vector> OffsetRanges; }; @@ -400,7 +400,7 @@ class IFederatedReadSession { //! //! If maxEventsCount is not specified, //! read session chooses event batch size automatically. - virtual TVector + virtual std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), size_t maxByteSize = std::numeric_limits::max()) = 0; diff --git a/client/ydb_federated_topic/impl/federated_read_session.cpp b/client/ydb_federated_topic/impl/federated_read_session.cpp index aee21b0698a..31d674af3de 100644 --- a/client/ydb_federated_topic/impl/federated_read_session.cpp +++ b/client/ydb_federated_topic/impl/federated_read_session.cpp @@ -129,7 +129,7 @@ NThreading::TFuture TFederatedReadSessionImpl::WaitEvent() { }); } -TVector TFederatedReadSessionImpl::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { +std::vector TFederatedReadSessionImpl::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { if (block) { WaitEvent().Wait(); } @@ -146,7 +146,7 @@ TVector TFederatedReadSessionImpl::GetEvents(bool blo return {}; } } - TVector result; + std::vector result; with_lock(Lock) { do { auto sub = SubSessions[SubsessionIndex]; diff --git a/client/ydb_federated_topic/impl/federated_read_session.h b/client/ydb_federated_topic/impl/federated_read_session.h index b5b1f41811d..6b6906aaa6f 100644 --- a/client/ydb_federated_topic/impl/federated_read_session.h +++ b/client/ydb_federated_topic/impl/federated_read_session.h @@ -33,7 +33,7 @@ class TFederatedReadSessionImpl : public NPersQueue::TEnableSelfContext WaitEvent(); - TVector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize); + std::vector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize); bool Close(TDuration timeout); @@ -104,7 +104,7 @@ class TFederatedReadSession : public IFederatedReadSession, return TryGetImpl()->WaitEvent(); } - TVector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) override { + std::vector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) override { return TryGetImpl()->GetEvents(block, maxEventsCount, maxByteSize); } diff --git a/client/ydb_federated_topic/impl/federated_read_session_event.cpp b/client/ydb_federated_topic/impl/federated_read_session_event.cpp index 7594e9cba8a..034c4c2fd94 100644 --- a/client/ydb_federated_topic/impl/federated_read_session_event.cpp +++ b/client/ydb_federated_topic/impl/federated_read_session_event.cpp @@ -179,7 +179,7 @@ TReadSessionEvent::TDataReceivedEvent::TDataReceivedEvent(NTopic::TReadSessionEv } TReadSessionEvent::TDataReceivedEvent::TDataReceivedEvent( - TVector messages, TVector compressedMessages, + std::vector messages, std::vector compressedMessages, NTopic::TPartitionSession::TPtr partitionSession, std::shared_ptr db) : NTopic::TReadSessionEvent::TPartitionSessionAccessor(partitionSession) , TFederatedPartitionSessionAccessor(partitionSession, db) diff --git a/client/ydb_federated_topic/impl/federated_write_session.cpp b/client/ydb_federated_topic/impl/federated_write_session.cpp index 7a0858c4046..daabbfa8a54 100644 --- a/client/ydb_federated_topic/impl/federated_write_session.cpp +++ b/client/ydb_federated_topic/impl/federated_write_session.cpp @@ -198,7 +198,7 @@ NThreading::TFuture TFederatedWriteSession::WaitEvent() { return ClientEventsQueue->WaitEvent(); } -TVector TFederatedWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { +std::vector TFederatedWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { return ClientEventsQueue->GetEvents(block, maxEventsCount); } diff --git a/client/ydb_federated_topic/impl/federated_write_session.h b/client/ydb_federated_topic/impl/federated_write_session.h index 4149614f0e0..d79750fe672 100644 --- a/client/ydb_federated_topic/impl/federated_write_session.h +++ b/client/ydb_federated_topic/impl/federated_write_session.h @@ -43,7 +43,7 @@ class TFederatedWriteSession : public NTopic::IWriteSession, NThreading::TFuture WaitEvent() override; TMaybe GetEvent(bool block) override; - TVector GetEvents(bool block, TMaybe maxEventsCount) override; + std::vector GetEvents(bool block, TMaybe maxEventsCount) override; virtual NThreading::TFuture GetInitSeqNo() override; diff --git a/client/ydb_federated_topic/ut/basic_usage_ut.cpp b/client/ydb_federated_topic/ut/basic_usage_ut.cpp index 1d55de29349..74e7166f2c7 100644 --- a/client/ydb_federated_topic/ut/basic_usage_ut.cpp +++ b/client/ydb_federated_topic/ut/basic_usage_ut.cpp @@ -450,7 +450,7 @@ Y_UNIT_TEST_SUITE(BasicUsage) { ui64 count = 300u; TString messageBase = "message----"; - TVector sentMessages; + std::vector sentMessages; for (auto i = 0u; i < count; i++) { // sentMessages.emplace_back(messageBase * (i+1) + ToString(i)); diff --git a/client/ydb_import/import.cpp b/client/ydb_import/import.cpp index 0fd32a0a260..1875556f4b2 100644 --- a/client/ydb_import/import.cpp +++ b/client/ydb_import/import.cpp @@ -25,8 +25,9 @@ TInstant ProtoTimestampToInstant(const NProtoBuf::Timestamp& timestamp) { return TInstant::MicroSeconds(us); } -TVector ItemsProgressFromProto(const google::protobuf::RepeatedPtrField& proto) { - TVector result(Reserve(proto.size())); +std::vector ItemsProgressFromProto(const google::protobuf::RepeatedPtrField& proto) { + std::vector result; + result.reserve(proto.size()); for (const auto& protoItem : proto) { auto& item = result.emplace_back(); diff --git a/client/ydb_import/import.h b/client/ydb_import/import.h index ace770e631c..e2fd694b993 100644 --- a/client/ydb_import/import.h +++ b/client/ydb_import/import.h @@ -48,7 +48,7 @@ class TImportFromS3Response : public TOperation { struct TMetadata { TImportFromS3Settings Settings; EImportProgress Progress; - TVector ItemsProgress; + std::vector ItemsProgress; }; public: diff --git a/client/ydb_operation/operation.cpp b/client/ydb_operation/operation.cpp index 8d8fa689531..bb2943e6859 100644 --- a/client/ydb_operation/operation.cpp +++ b/client/ydb_operation/operation.cpp @@ -91,7 +91,8 @@ class TOperationClient::TImpl : public TClientImplCommonissues(), opIssues); TStatus st(static_cast(response->status()), std::move(opIssues)); - TVector operations(Reserve(response->operations_size())); + std::vector operations; + operations.reserve(response->operations_size()); for (auto& operation : *response->mutable_operations()) { NYql::TIssues opIssues; NYql::IssuesFromMessage(operation.issues(), opIssues); diff --git a/client/ydb_operation/operation.h b/client/ydb_operation/operation.h index 7793a035655..14c0b509b78 100644 --- a/client/ydb_operation/operation.h +++ b/client/ydb_operation/operation.h @@ -16,14 +16,14 @@ class TOperationsList : public TStatus { { } - TOperationsList(TStatus&& status, TVector&& operations, const TString& nextPageToken) + TOperationsList(TStatus&& status, std::vector&& operations, const TString& nextPageToken) : TStatus(std::move(status)) , Operations_(std::move(operations)) , NextPageToken_(nextPageToken) { } - const TVector& GetList() const { return Operations_; } + const std::vector& GetList() const { return Operations_; } const TString& NextPageToken() const { return NextPageToken_; } TString ToJsonString() const { @@ -41,7 +41,7 @@ class TOperationsList : public TStatus { } private: - TVector Operations_; + std::vector Operations_; TString NextPageToken_; }; diff --git a/client/ydb_persqueue_core/impl/common.cpp b/client/ydb_persqueue_core/impl/common.cpp index 194f2810b04..16fc3432494 100644 --- a/client/ydb_persqueue_core/impl/common.cpp +++ b/client/ydb_persqueue_core/impl/common.cpp @@ -114,7 +114,7 @@ IAsyncExecutor::TPtr CreateDefaultExecutor() { return CreateThreadPoolExecutor(1); } -void TThreadPoolExecutor::PostImpl(TVector&& fs) { +void TThreadPoolExecutor::PostImpl(std::vector&& fs) { for (auto& f : fs) { ThreadPool->SafeAddFunc(std::move(f)); } @@ -130,7 +130,7 @@ TSerialExecutor::TSerialExecutor(IAsyncExecutor::TPtr executor) Y_ABORT_UNLESS(executor); } -void TSerialExecutor::PostImpl(TVector&& fs) { +void TSerialExecutor::PostImpl(std::vector&& fs) { for (auto& f : fs) { PostImpl(std::move(f)); } diff --git a/client/ydb_persqueue_core/impl/common.h b/client/ydb_persqueue_core/impl/common.h index 2f57ad32dcc..eca83ed4c2f 100644 --- a/client/ydb_persqueue_core/impl/common.h +++ b/client/ydb_persqueue_core/impl/common.h @@ -421,7 +421,7 @@ class TBaseSessionEventsQueue : public ISignalable { class IAsyncExecutor : public IExecutor { private: - virtual void PostImpl(TVector>&&) = 0; + virtual void PostImpl(std::vector>&&) = 0; virtual void PostImpl(std::function&&) = 0; public: @@ -455,7 +455,7 @@ class TThreadPoolExecutor : public IAsyncExecutor { } private: - void PostImpl(TVector&& fs) override; + void PostImpl(std::vector&& fs) override; void PostImpl(TFunction&& f) override; private: @@ -475,7 +475,7 @@ class TSerialExecutor : public IAsyncExecutor, public std::enable_shared_from_th ~TSerialExecutor() = default; private: - void PostImpl(TVector&& fs) override; + void PostImpl(std::vector&& fs) override; void PostImpl(TFunction&& f) override; void PostNext(); }; diff --git a/client/ydb_persqueue_core/impl/persqueue.cpp b/client/ydb_persqueue_core/impl/persqueue.cpp index e1da4300fa0..b806158806f 100644 --- a/client/ydb_persqueue_core/impl/persqueue.cpp +++ b/client/ydb_persqueue_core/impl/persqueue.cpp @@ -11,8 +11,8 @@ namespace NYdb::NPersQueue { -const TVector& GetDefaultCodecs() { - static const TVector codecs = {}; +const std::vector& GetDefaultCodecs() { + static const std::vector codecs = {}; return codecs; } diff --git a/client/ydb_persqueue_core/impl/read_session.cpp b/client/ydb_persqueue_core/impl/read_session.cpp index bd343a9bce4..c023e709dae 100644 --- a/client/ydb_persqueue_core/impl/read_session.cpp +++ b/client/ydb_persqueue_core/impl/read_session.cpp @@ -489,7 +489,7 @@ NThreading::TFuture TReadSession::WaitEvent() { return EventsQueue->WaitEvent(); } -TVector TReadSession::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { +std::vector TReadSession::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { auto res = EventsQueue->GetEvents(block, maxEventsCount, maxByteSize); if (EventsQueue->IsClosed()) { Abort(); @@ -589,8 +589,8 @@ TReadSessionEvent::TPartitionStreamClosedEvent::TPartitionStreamClosedEvent(TPar { } -TReadSessionEvent::TDataReceivedEvent::TDataReceivedEvent(TVector messages, - TVector compressedMessages, +TReadSessionEvent::TDataReceivedEvent::TDataReceivedEvent(std::vector messages, + std::vector compressedMessages, TPartitionStream::TPtr partitionStream) : Messages(std::move(messages)) , CompressedMessages(std::move(compressedMessages)) diff --git a/client/ydb_persqueue_core/impl/read_session.h b/client/ydb_persqueue_core/impl/read_session.h index fa3492ec2b9..c2b152881a6 100644 --- a/client/ydb_persqueue_core/impl/read_session.h +++ b/client/ydb_persqueue_core/impl/read_session.h @@ -359,8 +359,8 @@ class TDataDecompressionEvent { } void TakeData(TIntrusivePtr> partitionStream, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, size_t& maxByteSize, size_t& dataSize) const; @@ -526,16 +526,16 @@ class TRawPartitionStreamEventQueue { void GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator); private: static void GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator, std::deque>& queue); @@ -722,8 +722,8 @@ class TPartitionStreamImpl : public TAPartitionStream { static void GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator); TMutex& GetLock() { @@ -765,7 +765,7 @@ class TReadSessionEventsQueue: public TBaseSessionEventsQueue& accumulator); - TVector::TEvent> + std::vector::TEvent> GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), size_t maxByteSize = std::numeric_limits::max()); @@ -1206,7 +1206,7 @@ class TReadSession : public IReadSession, TString ClusterName; // In lower case TSingleClusterReadSessionImpl::TPtr Session; - TVector Topics; + std::vector Topics; TString ClusterEndpoint; }; @@ -1221,7 +1221,7 @@ class TReadSession : public IReadSession, void Start(); NThreading::TFuture WaitEvent() override; - TVector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) override; + std::vector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) override; TMaybe GetEvent(bool block, size_t maxByteSize) override; bool Close(TDuration timeout) override; @@ -1246,7 +1246,7 @@ class TReadSession : public IReadSession, ThrowFatalError("Method \"RemoveTopic\" is not implemented"); } - void RemoveTopic(const TString& path, const TVector& partitionGruops) /*override*/ { + void RemoveTopic(const TString& path, const std::vector& partitionGruops) /*override*/ { Y_UNUSED(path); Y_UNUSED(partitionGruops); // TODO: implement. diff --git a/client/ydb_persqueue_core/impl/read_session.ipp b/client/ydb_persqueue_core/impl/read_session.ipp index f6b90c9fd2a..46885d59426 100644 --- a/client/ydb_persqueue_core/impl/read_session.ipp +++ b/client/ydb_persqueue_core/impl/read_session.ipp @@ -133,8 +133,8 @@ template void TPartitionStreamImpl::GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator) { partitionStream->EventsQueue.GetDataEventImpl(partitionStream, @@ -165,8 +165,8 @@ void TRawPartitionStreamEventQueue::SignalReadyEvents(TInt if (front.IsDataEvent()) { if (queue.HasDataEventCallback()) { - TVector::TDataReceivedEvent::TMessage> messages; - TVector::TDataReceivedEvent::TCompressedMessage> compressedMessages; + std::vector::TDataReceivedEvent::TMessage> messages; + std::vector::TDataReceivedEvent::TCompressedMessage> compressedMessages; TUserRetrievedEventsInfoAccumulator accumulator; auto maxEventsCount = Max(); auto maxByteSize = Max(); @@ -1919,8 +1919,8 @@ template void TRawPartitionStreamEventQueue::GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator) { GetDataEventImpl(partitionStream, @@ -1936,8 +1936,8 @@ template void TRawPartitionStreamEventQueue::GetDataEventImpl(TIntrusivePtr> partitionStream, size_t& maxEventsCount, size_t& maxByteSize, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, TUserRetrievedEventsInfoAccumulator& accumulator, std::deque>& queue) { @@ -1972,8 +1972,8 @@ TReadSessionEventsQueue::GetDataEventImpl(TIntrusivePtr& accumulator) // Assumes that we're under lock. { - TVector::TDataReceivedEvent::TMessage> messages; - TVector::TDataReceivedEvent::TCompressedMessage> compressedMessages; + std::vector::TDataReceivedEvent::TMessage> messages; + std::vector::TDataReceivedEvent::TCompressedMessage> compressedMessages; Y_ABORT_UNLESS(!TParent::Events.empty()); @@ -2035,14 +2035,14 @@ TReadSessionEventsQueue::GetEventImpl(size_t& maxByteSize, } template -TVector::TEvent> +std::vector::TEvent> TReadSessionEventsQueue::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { if (!maxByteSize) { ThrowFatalError("the maxByteSize value must be greater than 0"); } - TVector> eventInfos; + std::vector> eventInfos; const size_t maxCount = maxEventsCount ? *maxEventsCount : std::numeric_limits::max(); TUserRetrievedEventsInfoAccumulator accumulator; @@ -2065,7 +2065,7 @@ TReadSessionEventsQueue::GetEvents(bool block, TMaybe::TEvent> result; + std::vector::TEvent> result; result.reserve(eventInfos.size()); for (TReadSessionEventInfo& eventInfo : eventInfos) { result.emplace_back(std::move(eventInfo.GetEvent())); @@ -2395,8 +2395,8 @@ void TDataDecompressionInfo::PlanDecompressionTasks(double template void TDataDecompressionEvent::TakeData(TIntrusivePtr> partitionStream, - TVector::TDataReceivedEvent::TMessage>& messages, - TVector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, + std::vector::TDataReceivedEvent::TMessage>& messages, + std::vector::TDataReceivedEvent::TCompressedMessage>& compressedMessages, size_t& maxByteSize, size_t& dataSize) const { @@ -2437,7 +2437,7 @@ void TDataDecompressionEvent::TakeData(TIntrusivePtr(messageData.codec()), messageData.data(), - TVector{messageInfo}, + std::vector{messageInfo}, partitionStream, messageData.partition_key(), messageData.explicit_hash()); diff --git a/client/ydb_persqueue_core/impl/read_session_messages.cpp b/client/ydb_persqueue_core/impl/read_session_messages.cpp index 8b24920d1e3..d5f64b1b037 100644 --- a/client/ydb_persqueue_core/impl/read_session_messages.cpp +++ b/client/ydb_persqueue_core/impl/read_session_messages.cpp @@ -223,7 +223,7 @@ void TReadSessionEvent::TDataReceivedEvent::TCompressedMessage::DebugString(TStr TReadSessionEvent::TDataReceivedEvent::TCompressedMessage::TCompressedMessage(ECodec codec, const TString& data, - const TVector& information, + const std::vector& information, TPartitionStream::TPtr partitionStream, const TString& partitionKey, const TString& explicitHash) diff --git a/client/ydb_persqueue_core/impl/write_session.cpp b/client/ydb_persqueue_core/impl/write_session.cpp index 9cc33ef63f5..ed2a8266630 100644 --- a/client/ydb_persqueue_core/impl/write_session.cpp +++ b/client/ydb_persqueue_core/impl/write_session.cpp @@ -35,7 +35,7 @@ TMaybe TWriteSession::GetEvent(bool block) { return TryGetImpl()->EventsQueue->GetEvent(block); } -TVector TWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { +std::vector TWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { return TryGetImpl()->EventsQueue->GetEvents(block, maxEventsCount); } diff --git a/client/ydb_persqueue_core/impl/write_session.h b/client/ydb_persqueue_core/impl/write_session.h index 5ce81dbcfc7..e90eeadbc8c 100644 --- a/client/ydb_persqueue_core/impl/write_session.h +++ b/client/ydb_persqueue_core/impl/write_session.h @@ -34,7 +34,7 @@ class TWriteSession : public IWriteSession, TDbDriverStatePtr dbDriverState); TMaybe GetEvent(bool block = false) override; - TVector GetEvents(bool block = false, + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) override; NThreading::TFuture GetInitSeqNo() override; diff --git a/client/ydb_persqueue_core/impl/write_session_impl.cpp b/client/ydb_persqueue_core/impl/write_session_impl.cpp index 20e40007012..1e55564f298 100644 --- a/client/ydb_persqueue_core/impl/write_session_impl.cpp +++ b/client/ydb_persqueue_core/impl/write_session_impl.cpp @@ -311,7 +311,7 @@ TMaybe TWriteSessionImpl::GetEvent(bool block) { } // Client method -TVector TWriteSessionImpl::GetEvents(bool block, TMaybe maxEventsCount) { +std::vector TWriteSessionImpl::GetEvents(bool block, TMaybe maxEventsCount) { return EventsQueue->GetEvents(block, maxEventsCount); } @@ -890,7 +890,7 @@ TMemoryUsageChange TWriteSessionImpl::OnMemoryUsageChangedImpl(i64 diff) { return {wasOk, nowOk}; } -TBuffer CompressBuffer(TVector& data, ECodec codec, i32 level) { +TBuffer CompressBuffer(std::vector& data, ECodec codec, i32 level) { TBuffer result; THolder coder = NCompressionDetails::CreateCoder(codec, result, level); for (auto& buffer : data) { diff --git a/client/ydb_persqueue_core/impl/write_session_impl.h b/client/ydb_persqueue_core/impl/write_session_impl.h index e3dbeb01f61..8a7e49751ec 100644 --- a/client/ydb_persqueue_core/impl/write_session_impl.h +++ b/client/ydb_persqueue_core/impl/write_session_impl.h @@ -61,8 +61,8 @@ class TWriteSessionEventsQueue: public TBaseSessionEventsQueueEvent); } - TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) { - TVector eventInfos; + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) { + std::vector eventInfos; with_lock (Mutex) { if (block) { WaitEventsImpl(); @@ -79,7 +79,7 @@ class TWriteSessionEventsQueue: public TBaseSessionEventsQueue result; + std::vector result; result.reserve(eventInfos.size()); for (TEventInfo& eventInfo : eventInfos) { eventInfo.OnUserRetrievedEvent(); @@ -190,7 +190,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, struct TMessageBatch { TBuffer Data; - TVector Messages; + std::vector Messages; ui64 CurrentSize = 0; TInstant StartedAt = TInstant::Zero(); bool Acquired = false; @@ -238,7 +238,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, size_t OriginalSize = 0; size_t OriginalMemoryUsage = 0; TString CodecID = GetCodecId(ECodec::RAW); - mutable TVector OriginalDataRefs; + mutable std::vector OriginalDataRefs; mutable TBuffer Data; bool Compressed = false; mutable bool Valid = true; @@ -291,7 +291,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, struct TProcessSrvMessageResult { THandleResult HandleResult; TMaybe InitSeqNo; - TVector Events; + std::vector Events; bool Ok = true; }; @@ -304,7 +304,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, TDbDriverStatePtr dbDriverState); TMaybe GetEvent(bool block = false); - TVector GetEvents(bool block = false, + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()); NThreading::TFuture GetInitSeqNo(); diff --git a/client/ydb_persqueue_core/persqueue.h b/client/ydb_persqueue_core/persqueue.h index 45cb719789c..3075363e2ad 100644 --- a/client/ydb_persqueue_core/persqueue.h +++ b/client/ydb_persqueue_core/persqueue.h @@ -74,7 +74,7 @@ struct TDescribeTopicResult : public TStatus { GETTER(bool, Important); GETTER(TInstant, StartingMessageTimestamp); GETTER(EFormat, SupportedFormat); - const TVector& SupportedCodecs() const { + const std::vector& SupportedCodecs() const { return SupportedCodecs_; } GETTER(ui32, Version); @@ -85,7 +85,7 @@ struct TDescribeTopicResult : public TStatus { bool Important_; TInstant StartingMessageTimestamp_; EFormat SupportedFormat_; - TVector SupportedCodecs_; + std::vector SupportedCodecs_; ui32 Version_; TString ServiceType_; }; @@ -111,7 +111,7 @@ struct TDescribeTopicResult : public TStatus { GETTER(ui32, PartitionsCount); GETTER(TDuration, RetentionPeriod); GETTER(EFormat, SupportedFormat); - const TVector& SupportedCodecs() const { + const std::vector& SupportedCodecs() const { return SupportedCodecs_; } GETTER(ui64, MaxPartitionStorageSize); @@ -127,7 +127,7 @@ struct TDescribeTopicResult : public TStatus { GETTER(TMaybe, AbcSlug); GETTER(TMaybe, FederationAccount); - const TVector& ReadRules() const { + const std::vector& ReadRules() const { return ReadRules_; } GETTER(TMaybe, RemoteMirrorRule); @@ -139,12 +139,12 @@ struct TDescribeTopicResult : public TStatus { ui32 PartitionsCount_; TDuration RetentionPeriod_; EFormat SupportedFormat_; - TVector SupportedCodecs_; + std::vector SupportedCodecs_; ui64 MaxPartitionStorageSize_; ui64 MaxPartitionWriteSpeed_; ui64 MaxPartitionWriteBurst_; bool ClientWriteDisabled_; - TVector ReadRules_; + std::vector ReadRules_; TMaybe RemoteMirrorRule_; // attributes bool AllowUnauthenticatedRead_; @@ -173,7 +173,7 @@ using TAsyncDescribeTopicResult = NThreading::TFuture; -const TVector& GetDefaultCodecs(); +const std::vector& GetDefaultCodecs(); struct TReadRuleSettings { TReadRuleSettings() {} @@ -182,7 +182,7 @@ struct TReadRuleSettings { FLUENT_SETTING_DEFAULT(bool, Important, false); FLUENT_SETTING_DEFAULT(TInstant, StartingMessageTimestamp, TInstant::Zero()); FLUENT_SETTING_DEFAULT(EFormat, SupportedFormat, EFormat::BASE) - FLUENT_SETTING_DEFAULT(TVector, SupportedCodecs, GetDefaultCodecs()); + FLUENT_SETTING_DEFAULT(std::vector, SupportedCodecs, GetDefaultCodecs()); FLUENT_SETTING_DEFAULT(ui32, Version, 0); FLUENT_SETTING(TString, ServiceType); @@ -234,7 +234,7 @@ struct TTopicSettings : public TOperationRequestSettings { FLUENT_SETTING_DEFAULT(ui32, PartitionsCount, 1); FLUENT_SETTING_DEFAULT(TDuration, RetentionPeriod, TDuration::Hours(18)); FLUENT_SETTING_DEFAULT(EFormat, SupportedFormat, EFormat::BASE) - FLUENT_SETTING_DEFAULT(TVector, SupportedCodecs, GetDefaultCodecs()); + FLUENT_SETTING_DEFAULT(std::vector, SupportedCodecs, GetDefaultCodecs()); FLUENT_SETTING_DEFAULT(ui64, MaxPartitionStorageSize, 0); FLUENT_SETTING_DEFAULT(ui64, MaxPartitionWriteSpeed, 2_MB); @@ -251,7 +251,7 @@ struct TTopicSettings : public TOperationRequestSettings { FLUENT_SETTING_OPTIONAL(TString, FederationAccount); //TODO: FLUENT_SETTING_VECTOR - FLUENT_SETTING_DEFAULT(TVector, ReadRules, {}); + FLUENT_SETTING_DEFAULT(std::vector, ReadRules, {}); FLUENT_SETTING_OPTIONAL(TRemoteMirrorRuleSettings, RemoteMirrorRule); TSelf& SetSettings(const TDescribeTopicResult::TTopicSettings& settings) { @@ -325,7 +325,7 @@ struct TMessageMeta : public TThrRefBase { using TPtr = TIntrusivePtr; //! User defined fields. - TVector> Fields; + std::vector> Fields; }; //! Event that is sent to client during session destruction. @@ -644,7 +644,7 @@ struct TReadSessionEvent { virtual ~TCompressedMessage() {} TCompressedMessage(ECodec codec, const TString& data, - const TVector& information, + const std::vector& information, TPartitionStream::TPtr partitionStream, const TString& partitionKey, const TString& explicitHash); @@ -657,7 +657,7 @@ struct TReadSessionEvent { private: ECodec Codec; - TVector Information; + std::vector Information; }; //! Partition stream. @@ -674,23 +674,23 @@ struct TReadSessionEvent { } //! Get messages. - TVector& GetMessages() { + std::vector& GetMessages() { CheckMessagesFilled(false); return Messages; } - const TVector& GetMessages() const { + const std::vector& GetMessages() const { CheckMessagesFilled(false); return Messages; } //! Get compressed messages. - TVector& GetCompressedMessages() { + std::vector& GetCompressedMessages() { CheckMessagesFilled(true); return CompressedMessages; } - const TVector& GetCompressedMessages() const { + const std::vector& GetCompressedMessages() const { CheckMessagesFilled(true); return CompressedMessages; } @@ -700,8 +700,8 @@ struct TReadSessionEvent { TString DebugString(bool printData = false) const; - TDataReceivedEvent(TVector messages, - TVector compressedMessages, + TDataReceivedEvent(std::vector messages, + std::vector compressedMessages, TPartitionStream::TPtr partitionStream); private: @@ -716,8 +716,8 @@ struct TReadSessionEvent { } private: - TVector Messages; - TVector CompressedMessages; + std::vector Messages; + std::vector CompressedMessages; TPartitionStream::TPtr PartitionStream; std::vector> OffsetRanges; }; @@ -1017,7 +1017,7 @@ struct TWriteSessionEvent { //! Acks could be batched from several WriteBatch/Write requests. //! Acks for messages from one WriteBatch request could be emitted as several TAcksEvents - //! they are provided to client as soon as possible. - TVector Acks; + std::vector Acks; TString DebugString() const; @@ -1290,7 +1290,7 @@ struct TReadSessionSettings : public TRequestSettings { } //! Read original topic instances specified in "Topics" from several clusters. - TSelf& ReadOriginal(TVector clusters) { + TSelf& ReadOriginal(std::vector clusters) { Clusters_ = std::move(clusters); return ReadOnlyOriginal(true); } @@ -1400,7 +1400,7 @@ class IWriteSession { //! If blocking = false, instantly returns up to maxEventsCount available events. //! If blocking = true, blocks till maxEventsCount events are available. //! If maxEventsCount is unset, write session decides the count to return itself. - virtual TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) = 0; + virtual std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) = 0; //! Future that is set when initial SeqNo is available. virtual NThreading::TFuture GetInitSeqNo() = 0; @@ -1442,7 +1442,7 @@ class IReadSession { //! //! If maxEventsCount is not specified, //! read session chooses event batch size automatically. - virtual TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), size_t maxByteSize = std::numeric_limits::max()) = 0; + virtual std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), size_t maxByteSize = std::numeric_limits::max()) = 0; //! Get single event. virtual TMaybe GetEvent(bool block = false, size_t maxByteSize = std::numeric_limits::max()) = 0; @@ -1454,7 +1454,7 @@ class IReadSession { // virtual void RemoveTopic(const TString& path) = 0; // Not implemented yet. //! Remove partition groups of topic from session. - // virtual void RemoveTopic(const TString& path, const TVector& partitionGruops) = 0; // Not implemented yet. + // virtual void RemoveTopic(const TString& path, const std::vector& partitionGruops) = 0; // Not implemented yet. //! Stop reading data and process only control events. //! You might need this function if a receiving side diff --git a/client/ydb_persqueue_core/ut/basic_usage_ut.cpp b/client/ydb_persqueue_core/ut/basic_usage_ut.cpp index 7847de40c2a..277b1369c22 100644 --- a/client/ydb_persqueue_core/ut/basic_usage_ut.cpp +++ b/client/ydb_persqueue_core/ut/basic_usage_ut.cpp @@ -31,7 +31,7 @@ Y_UNIT_TEST_SUITE(BasicUsage) { void WriteAndReadAndCommitRandomMessages(TPersQueueYdbSdkTestSetup* setup, TWriteCallable write, bool disableClusterDiscovery = false) { auto log = setup->GetLog(); const TInstant start = TInstant::Now(); - TVector messages; + std::vector messages; const ui32 messageCount = 5; ui32 totalSize = 0; std::queue> writeFutures; @@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(BasicUsage) { auto& client = setup->GetPersQueueClient(); auto session = client.CreateSimpleBlockingWriteSession(writeSettings); TString messageBase = "message-"; - TVector sentMessages; + std::vector sentMessages; for (auto i = 0u; i < count; i++) { sentMessages.emplace_back(messageBase * (i+1) + ToString(i)); diff --git a/client/ydb_persqueue_core/ut/compression_ut.cpp b/client/ydb_persqueue_core/ut/compression_ut.cpp index 46063f880c4..496084bcb35 100644 --- a/client/ydb_persqueue_core/ut/compression_ut.cpp +++ b/client/ydb_persqueue_core/ut/compression_ut.cpp @@ -3,8 +3,8 @@ namespace NYdb::NPersQueue::NTests { Y_UNIT_TEST_SUITE(Compression) { - TVector GetTestMessages(ECodec codec = ECodec::RAW) { - static const TVector> TEST_MESSAGES = { + std::vector GetTestMessages(ECodec codec = ECodec::RAW) { + static const std::vector> TEST_MESSAGES = { { {ECodec::RAW, "Alice and Bob"}, {ECodec::GZIP, TString("\x1F\x8B\x08\x0\x0\x0\x0\x0\x0\x3\x73\xCC\xC9\x4C\x4E\x55\x48\xCC\x4B\x51\x70\xCA\x4F\x2\x0\x2C\xE7\x84\x5D\x0D\x0\x0\x0", 33)}, @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(Compression) { {ECodec::ZSTD, TString("\x28\xB5\x2F\xFD\x0\x58\x61\x0\x0\x59\x61\x6E\x64\x65\x78\x2E\x43\x6C\x6F\x75\x64", 21)} } }; - TVector messages; + std::vector messages; for (auto& m : TEST_MESSAGES) { messages.push_back(m.at(codec)); } @@ -59,7 +59,7 @@ Y_UNIT_TEST_SUITE(Compression) { UNIT_ASSERT_VALUES_EQUAL(response.operation().status(), Ydb::StatusIds::SUCCESS); } - void Write(TPersQueueYdbSdkTestSetup& setup, const TVector& messages, ECodec codec) { + void Write(TPersQueueYdbSdkTestSetup& setup, const std::vector& messages, ECodec codec) { auto& client = setup.GetPersQueueClient(); TWriteSessionSettings writeSettings = setup.GetWriteSessionSettings(); writeSettings.Codec(codec); @@ -74,8 +74,8 @@ Y_UNIT_TEST_SUITE(Compression) { void Read( TPersQueueYdbSdkTestSetup& setup, - const TVector messages, - const TVector codecs, + const std::vector messages, + const std::vector codecs, bool decompress ) { Cerr << Endl << "Start read" << Endl << Endl; @@ -117,8 +117,8 @@ Y_UNIT_TEST_SUITE(Compression) { auto messages = GetTestMessages(); Write(setup, messages, codec); - Read(setup, messages, TVector(messages.size(), ECodec::RAW), true); - Read(setup, GetTestMessages(codec), TVector(messages.size(), codec), false); + Read(setup, messages, std::vector(messages.size(), ECodec::RAW), true); + Read(setup, GetTestMessages(codec), std::vector(messages.size(), codec), false); } Y_UNIT_TEST(WriteRAW) { @@ -141,9 +141,9 @@ Y_UNIT_TEST_SUITE(Compression) { AlterTopic(setup); // add zstd support auto messages = GetTestMessages(); - TVector originalMessages; - TVector targetMessages; - TVector targetCodecs; + std::vector originalMessages; + std::vector targetMessages; + std::vector targetCodecs; auto addToTarget = [&](ECodec codec) { originalMessages.insert(originalMessages.end(), messages.begin(), messages.end()); @@ -158,7 +158,7 @@ Y_UNIT_TEST_SUITE(Compression) { addToTarget(ECodec::GZIP); addToTarget(ECodec::ZSTD); - Read(setup, originalMessages, TVector(originalMessages.size(), ECodec::RAW), true); + Read(setup, originalMessages, std::vector(originalMessages.size(), ECodec::RAW), true); Read(setup, targetMessages, targetCodecs, false); } } diff --git a/client/ydb_persqueue_core/ut/read_session_ut.cpp b/client/ydb_persqueue_core/ut/read_session_ut.cpp index 54cf4ceb451..2269d85edbd 100644 --- a/client/ydb_persqueue_core/ut/read_session_ut.cpp +++ b/client/ydb_persqueue_core/ut/read_session_ut.cpp @@ -1100,7 +1100,7 @@ Y_UNIT_TEST_SUITE(ReadSessionImplTest) { setup.MockProcessor->AddServerResponse(TMockReadSessionProcessor::TServerReadInfo().CreatePartitionStream()); // Callback will be called. { - TVector events = setup.EventsQueue->GetEvents(true); + std::vector events = setup.EventsQueue->GetEvents(true); UNIT_ASSERT_VALUES_EQUAL(events.size(), 1); UNIT_ASSERT_EVENT_TYPE(events[0], TReadSessionEvent::TCreatePartitionStreamEvent); auto& event = std::get(events[0]); @@ -1495,7 +1495,7 @@ Y_UNIT_TEST_SUITE(ReadSessionImplTest) { } { - TVector events = setup.EventsQueue->GetEvents(true); + std::vector events = setup.EventsQueue->GetEvents(true); UNIT_ASSERT_VALUES_EQUAL(events.size(), 1); UNIT_ASSERT_EVENT_TYPE(events[0], TReadSessionEvent::TDataReceivedEvent); TReadSessionEvent::TDataReceivedEvent& dataEvent = std::get(events[0]); @@ -1504,7 +1504,7 @@ Y_UNIT_TEST_SUITE(ReadSessionImplTest) { } { - TVector events = setup.EventsQueue->GetEvents(true); + std::vector events = setup.EventsQueue->GetEvents(true); UNIT_ASSERT_VALUES_EQUAL(events.size(), 1); UNIT_ASSERT_EVENT_TYPE(events[0], TReadSessionEvent::TDataReceivedEvent); TReadSessionEvent::TDataReceivedEvent& dataEvent = std::get(events[0]); diff --git a/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h b/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h index ba8462dcddc..9eb291f436f 100644 --- a/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h +++ b/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h @@ -21,7 +21,7 @@ class SDKTestSetup { public: SDKTestSetup(const TString& testCaseName, bool start = true, - const TVector& logServices = TTestServer::LOGGED_SERVICES, + const std::vector& logServices = TTestServer::LOGGED_SERVICES, NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG, ui32 nodeCount = NKikimr::NPersQueueTests::PQ_DEFAULT_NODE_COUNT, size_t topicPartitionsCount = 1) @@ -155,7 +155,7 @@ class SDKTestSetup { UNIT_ASSERT_C(!initResponse.Response.HasError(), "Failed to start: " << initResponse.Response); } - void WriteToTopic(const TVector& data, bool compress = true) { + void WriteToTopic(const std::vector& data, bool compress = true) { auto client = NYdb::NPersQueue::TPersQueueClient(*(Server.AnnoyingClient->GetDriver())); NYdb::NPersQueue::TWriteSessionSettings settings; diff --git a/client/ydb_persqueue_core/ut/ut_utils/test_server.cpp b/client/ydb_persqueue_core/ut/ut_utils/test_server.cpp index 73ec953b017..8e66bcc8640 100644 --- a/client/ydb_persqueue_core/ut/ut_utils/test_server.cpp +++ b/client/ydb_persqueue_core/ut/ut_utils/test_server.cpp @@ -2,7 +2,7 @@ namespace NPersQueue { -const TVector TTestServer::LOGGED_SERVICES = { +const std::vector TTestServer::LOGGED_SERVICES = { NKikimrServices::PQ_READ_PROXY, NKikimrServices::PQ_WRITE_PROXY, NKikimrServices::PQ_PARTITION_CHOOSER, diff --git a/client/ydb_persqueue_core/ut/ut_utils/test_server.h b/client/ydb_persqueue_core/ut/ut_utils/test_server.h index f7539821d50..baacf4aa01b 100644 --- a/client/ydb_persqueue_core/ut/ut_utils/test_server.h +++ b/client/ydb_persqueue_core/ut/ut_utils/test_server.h @@ -17,7 +17,7 @@ class TTestServer { public: TTestServer(const NKikimr::Tests::TServerSettings& settings, bool start = true, - const TVector& logServices = TTestServer::LOGGED_SERVICES, + const std::vector& logServices = TTestServer::LOGGED_SERVICES, NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG, TMaybe> portManager = Nothing()) : PortManager(portManager.GetOrElse(MakeSimpleShared())) @@ -84,7 +84,7 @@ class TTestServer { return CleverServer->GetRuntime(); } - void EnableLogs(const TVector& services = LOGGED_SERVICES, + void EnableLogs(const std::vector& services = LOGGED_SERVICES, NActors::NLog::EPriority prio = NActors::NLog::PRI_DEBUG) { Y_ABORT_UNLESS(CleverServer != nullptr, "Start server before enabling logs"); for (auto s : services) { @@ -165,7 +165,7 @@ class TTestServer { THolder AnnoyingClient; - static const TVector LOGGED_SERVICES; + static const std::vector LOGGED_SERVICES; }; } // namespace NPersQueue diff --git a/client/ydb_persqueue_core/ut/ut_utils/ut_utils.h b/client/ydb_persqueue_core/ut/ut_utils/ut_utils.h index f046ffea2df..986df0b25aa 100644 --- a/client/ydb_persqueue_core/ut/ut_utils/ut_utils.h +++ b/client/ydb_persqueue_core/ut/ut_utils/ut_utils.h @@ -17,7 +17,7 @@ class TPersQueueYdbSdkTestSetup : public ::NPersQueue::SDKTestSetup { TAdaptiveLock Lock; public: TPersQueueYdbSdkTestSetup(const TString& testCaseName, bool start = true, - const TVector& logServices = ::NPersQueue::TTestServer::LOGGED_SERVICES, + const std::vector& logServices = ::NPersQueue::TTestServer::LOGGED_SERVICES, NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG, ui32 nodeCount = NKikimr::NPersQueueTests::PQ_DEFAULT_NODE_COUNT, size_t topicPartitionsCount = 1) @@ -77,7 +77,7 @@ class TPersQueueYdbSdkTestSetup : public ::NPersQueue::SDKTestSetup { struct TYDBClientEventLoop : public ::NPersQueue::IClientEventLoop { public: std::shared_ptr Setup; - using TAcksCallback = std::function&)>; + using TAcksCallback = std::function&)>; TYDBClientEventLoop( std::shared_ptr setup, @@ -373,7 +373,7 @@ class TYdbPqTestExecutor : public IAsyncExecutor { Stop = true; Thread.Join(); } - void PostImpl(TVector&& fs) override { + void PostImpl(std::vector&& fs) override { for (auto& f : fs) { TasksQueue.Enqueue(std::move(f)); } diff --git a/client/ydb_query/client.cpp b/client/ydb_query/client.cpp index 5e164820878..275e0fa61df 100644 --- a/client/ydb_query/client.cpp +++ b/client/ydb_query/client.cpp @@ -678,7 +678,7 @@ const TTransaction& TBeginTransactionResult::GetTransaction() const { return Transaction_; } -const TVector& TExecuteQueryResult::GetResultSets() const { +const std::vector& TExecuteQueryResult::GetResultSets() const { return ResultSets_; } diff --git a/client/ydb_query/client.h b/client/ydb_query/client.h index 0e997116eb4..6fc2ab25c7e 100644 --- a/client/ydb_query/client.h +++ b/client/ydb_query/client.h @@ -220,7 +220,7 @@ class TExecuteQueryPart : public TStreamPartStatus { class TExecuteQueryResult : public TStatus { public: - const TVector& GetResultSets() const; + const std::vector& GetResultSets() const; TResultSet GetResultSet(size_t resultIndex) const; TResultSetParser GetResultSetParser(size_t resultIndex) const; @@ -232,7 +232,7 @@ class TExecuteQueryResult : public TStatus { : TStatus(std::move(status)) {} - TExecuteQueryResult(TStatus&& status, TVector&& resultSets, + TExecuteQueryResult(TStatus&& status, std::vector&& resultSets, TMaybe&& stats, TMaybe&& tx) : TStatus(std::move(status)) , ResultSets_(std::move(resultSets)) @@ -241,7 +241,7 @@ class TExecuteQueryResult : public TStatus { {} private: - TVector ResultSets_; + std::vector ResultSets_; TMaybe Stats_; TMaybe Transaction_; }; diff --git a/client/ydb_query/impl/exec_query.cpp b/client/ydb_query/impl/exec_query.cpp index 5694667fb0e..b2572eca2dc 100644 --- a/client/ydb_query/impl/exec_query.cpp +++ b/client/ydb_query/impl/exec_query.cpp @@ -125,8 +125,8 @@ struct TExecuteQueryBuffer : public TThrRefBase, TNonCopyable { TPromise Promise_; TExecuteQueryIterator Iterator_; - TVector Issues_; - TVector ResultSets_; + std::vector Issues_; + std::vector ResultSets_; TMaybe Stats_; TMaybe Tx_; @@ -138,8 +138,8 @@ struct TExecuteQueryBuffer : public TThrRefBase, TNonCopyable { if (!part.IsSuccess()) { if (part.EOS()) { - TVector issues; - TVector resultProtos; + std::vector issues; + std::vector resultProtos; TMaybe stats; TMaybe tx; @@ -148,7 +148,7 @@ struct TExecuteQueryBuffer : public TThrRefBase, TNonCopyable { std::swap(self->Stats_, stats); std::swap(self->Tx_, tx); - TVector resultSets; + std::vector resultSets; for (auto& proto : resultProtos) { resultSets.emplace_back(std::move(proto)); } diff --git a/client/ydb_query/query.h b/client/ydb_query/query.h index b2665c37897..84bde5c4022 100644 --- a/client/ydb_query/query.h +++ b/client/ydb_query/query.h @@ -123,7 +123,7 @@ class TScriptExecutionOperation : public TOperation { TQueryContent ScriptContent; Ydb::TableStats::QueryStats ExecStats; - TVector ResultSetsMeta; + std::vector ResultSetsMeta; }; using TOperation::TOperation; diff --git a/client/ydb_rate_limiter/rate_limiter.cpp b/client/ydb_rate_limiter/rate_limiter.cpp index c26ebee3562..60c46c6fac8 100644 --- a/client/ydb_rate_limiter/rate_limiter.cpp +++ b/client/ydb_rate_limiter/rate_limiter.cpp @@ -9,7 +9,7 @@ namespace NYdb::NRateLimiter { -TListResourcesResult::TListResourcesResult(TStatus status, TVector paths) +TListResourcesResult::TListResourcesResult(TStatus status, std::vector paths) : TStatus(std::move(status)) , ResourcePaths_(std::move(paths)) { @@ -111,7 +111,7 @@ class TRateLimiterClient::TImpl : public TClientImplCommon list; + std::vector list; if (any) { Ydb::RateLimiter::ListResourcesResult result; any->UnpackTo(&result); diff --git a/client/ydb_rate_limiter/rate_limiter.h b/client/ydb_rate_limiter/rate_limiter.h index 7728d26d57e..f85056941dc 100644 --- a/client/ydb_rate_limiter/rate_limiter.h +++ b/client/ydb_rate_limiter/rate_limiter.h @@ -68,15 +68,15 @@ struct TDescribeResourceSettings : public TOperationRequestSettings paths); + TListResourcesResult(TStatus status, std::vector paths); // Paths of listed resources inside a specified coordination node. - const TVector& GetResourcePaths() const { + const std::vector& GetResourcePaths() const { return ResourcePaths_; } private: - TVector ResourcePaths_; + std::vector ResourcePaths_; }; // Settings for acquire resource request. diff --git a/client/ydb_result/result.cpp b/client/ydb_result/result.cpp index 23b12a9b394..75f2dc5aae9 100644 --- a/client/ydb_result/result.cpp +++ b/client/ydb_result/result.cpp @@ -56,7 +56,7 @@ class TResultSet::TImpl { public: const Ydb::ResultSet ProtoResultSet_; - TVector ColumnsMeta_; + std::vector ColumnsMeta_; }; //////////////////////////////////////////////////////////////////////////////// @@ -79,7 +79,7 @@ bool TResultSet::Truncated() const { return Impl_->ProtoResultSet_.truncated(); } -const TVector& TResultSet::GetColumnsMeta() const { +const std::vector& TResultSet::GetColumnsMeta() const { return Impl_->ColumnsMeta_; } @@ -185,7 +185,7 @@ class TResultSetParser::TImpl { private: TResultSet ResultSet_; TMap ColumnIndexMap; - TVector ColumnParsers; + std::vector ColumnParsers; size_t RowIndex_ = 0; }; diff --git a/client/ydb_result/result.h b/client/ydb_result/result.h index 6a3d561a93d..2a4b2f9dade 100644 --- a/client/ydb_result/result.h +++ b/client/ydb_result/result.h @@ -2,7 +2,6 @@ #include -#include #include namespace Ydb { @@ -46,7 +45,7 @@ class TResultSet { bool Truncated() const; //! Returns meta information (name, type) for columns - const TVector& GetColumnsMeta() const; + const std::vector& GetColumnsMeta() const; private: const Ydb::ResultSet& GetProto() const; @@ -104,7 +103,7 @@ class TResultSetParser : public TMoveOnly { std::unique_ptr Impl_; }; -using TResultSets = TVector; +using TResultSets = std::vector; } // namespace NYdb diff --git a/client/ydb_scheme/scheme.cpp b/client/ydb_scheme/scheme.cpp index 516eda91527..424899ae7c4 100644 --- a/client/ydb_scheme/scheme.cpp +++ b/client/ydb_scheme/scheme.cpp @@ -174,7 +174,8 @@ class TSchemeClient::TImpl : public TClientImplCommon { any->UnpackTo(&result); } - TVector children(Reserve(result.children().size())); + std::vector children; + children.reserve(result.children().size()); for (const auto& child : result.children()) { children.emplace_back(child); } @@ -252,12 +253,12 @@ const TSchemeEntry& TDescribePathResult::GetEntry() const { //////////////////////////////////////////////////////////////////////////////// -TListDirectoryResult::TListDirectoryResult(TStatus&& status, const TSchemeEntry& self, TVector&& children) +TListDirectoryResult::TListDirectoryResult(TStatus&& status, const TSchemeEntry& self, std::vector&& children) : TDescribePathResult(std::move(status), self) , Children_(std::move(children)) {} -const TVector& TListDirectoryResult::GetChildren() const { +const std::vector& TListDirectoryResult::GetChildren() const { CheckStatusOk("TListDirectoryResult::GetChildren"); return Children_; } diff --git a/client/ydb_scheme/scheme.h b/client/ydb_scheme/scheme.h index ceb23d25540..ad66ea1febc 100644 --- a/client/ydb_scheme/scheme.h +++ b/client/ydb_scheme/scheme.h @@ -18,12 +18,12 @@ struct TPermissions { TPermissions(const TString& subject) : Subject(subject) {} - TPermissions(const TString& subject, const TVector& names) + TPermissions(const TString& subject, const std::vector& names) : Subject(subject) , PermissionNames(names) {} TString Subject; - TVector PermissionNames; + std::vector PermissionNames; }; enum class ESchemeEntryType : i32 { @@ -68,8 +68,8 @@ struct TSchemeEntry { TString Name; TString Owner; ESchemeEntryType Type; - TVector EffectivePermissions; - TVector Permissions; + std::vector EffectivePermissions; + std::vector Permissions; ui64 SizeBytes = 0; TVirtualTimestamp CreatedAt; @@ -124,7 +124,7 @@ struct TModifyPermissionsSettings : public TOperationRequestSettings> Actions_; + std::vector> Actions_; bool ClearAcl_ = false; void AddAction(EModifyPermissionsAction action, const TPermissions& permissions) { Actions_.emplace_back(std::pair{action, permissions}); @@ -169,11 +169,11 @@ class TDescribePathResult : public TStatus { class TListDirectoryResult : public TDescribePathResult { public: - TListDirectoryResult(TStatus&& status, const TSchemeEntry& self, TVector&& children); - const TVector& GetChildren() const; + TListDirectoryResult(TStatus&& status, const TSchemeEntry& self, std::vector&& children); + const std::vector& GetChildren() const; private: - TVector Children_; + std::vector Children_; }; } // namespace NScheme diff --git a/client/ydb_table/impl/table_client.cpp b/client/ydb_table/impl/table_client.cpp index 596e38a8584..ec179922386 100644 --- a/client/ydb_table/impl/table_client.cpp +++ b/client/ydb_table/impl/table_client.cpp @@ -56,7 +56,7 @@ void TTableClient::TImpl::InitStopper() { } NThreading::TFuture TTableClient::TImpl::Drain() { - TVector> sessions; + std::vector> sessions; // No realocations under lock sessions.reserve(Settings_.SessionPoolSettings_.MaxActiveSessions_); auto drainer = [&sessions](std::unique_ptr&& impl) mutable { @@ -64,7 +64,7 @@ NThreading::TFuture TTableClient::TImpl::Drain() { return true; }; SessionPool_.Drain(drainer, true); - TVector closeResults; + std::vector closeResults; for (auto& s : sessions) { if (s->GetId()) { closeResults.push_back(CloseInternal(s.get())); @@ -199,7 +199,7 @@ std::pair TTableClient::TImpl::ScanLocation(std::shared_ptr& in) { - TVector t; + std::vector t; t.reserve(in.size()); std::transform(in.begin(), in.end(), std::back_inserter(t), [](const std::pair& pair) { return pair.second; @@ -801,7 +801,7 @@ NThreading::TFuture& columns, const TReadRowsSettings& settings) { +TAsyncReadRowsResult TTableClient::TImpl::ReadRows(const TString& path, TValue&& keys, const std::vector& columns, const TReadRowsSettings& settings) { auto request = MakeRequest(); request.set_path(path); auto* protoKeys = request.mutable_keys(); diff --git a/client/ydb_table/impl/table_client.h b/client/ydb_table/impl/table_client.h index 09577dcd411..36227188257 100644 --- a/client/ydb_table/impl/table_client.h +++ b/client/ydb_table/impl/table_client.h @@ -123,7 +123,7 @@ class TTableClient::TImpl: public TClientImplCommon, public const TString& sessionId, const TString& path, const TReadTableSettings& settings); - TAsyncReadRowsResult ReadRows(const TString& path, TValue&& keys, const TVector& columns, const TReadRowsSettings& settings); + TAsyncReadRowsResult ReadRows(const TString& path, TValue&& keys, const std::vector& columns, const TReadRowsSettings& settings); TAsyncStatus Close(const TKqpSessionCommon* sessionImpl, const TCloseSessionSettings& settings); TAsyncStatus CloseInternal(const TKqpSessionCommon* sessionImpl); @@ -210,7 +210,7 @@ class TTableClient::TImpl: public TClientImplCommon, public auto sessionPtr = new TSession(session); auto extractor = [promise, sessionPtr, query, fromCache, keepInCache] (google::protobuf::Any* any, TPlainStatus status) mutable { - TVector res; + std::vector res; TMaybe tx; TMaybe dataQuery; TMaybe queryStats; diff --git a/client/ydb_table/table.cpp b/client/ydb_table/table.cpp index 0f711af162e..3e367ba9d8d 100644 --- a/client/ydb_table/table.cpp +++ b/client/ydb_table/table.cpp @@ -440,15 +440,15 @@ class TTableDescription::TImpl { Columns_.emplace_back(name, type, family, notNull); } - void SetPrimaryKeyColumns(const TVector& primaryKeyColumns) { + void SetPrimaryKeyColumns(const std::vector& primaryKeyColumns) { PrimaryKey_ = primaryKeyColumns; } - void AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns) { + void AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns) { Indexes_.emplace_back(TIndexDescription(indexName, type, indexColumns)); } - void AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns, const TVector& dataColumns) { + void AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns, const std::vector& dataColumns) { Indexes_.emplace_back(TIndexDescription(indexName, type, indexColumns, dataColumns)); } @@ -514,19 +514,19 @@ class TTableDescription::TImpl { StoreType_ = type; } - const TVector& GetPrimaryKeyColumns() const { + const std::vector& GetPrimaryKeyColumns() const { return PrimaryKey_; } - const TVector& GetColumns() const { + const std::vector& GetColumns() const { return Columns_; } - const TVector& GetIndexDescriptions() const { + const std::vector& GetIndexDescriptions() const { return Indexes_; } - const TVector& GetChangefeedDescriptions() const { + const std::vector& GetChangefeedDescriptions() const { return Changefeeds_; } @@ -546,19 +546,19 @@ class TTableDescription::TImpl { return Owner_; } - const TVector& GetPermissions() const { + const std::vector& GetPermissions() const { return Permissions_; } - const TVector& GetEffectivePermissions() const { + const std::vector& GetEffectivePermissions() const { return EffectivePermissions_; } - const TVector& GetKeyRanges() const { + const std::vector& GetKeyRanges() const { return Ranges_; } - const TVector& GetPartitionStats() const { + const std::vector& GetPartitionStats() const { return PartitionStats_; } @@ -574,7 +574,7 @@ class TTableDescription::TImpl { return StorageSettings_; } - const TVector& GetColumnFamilies() const { + const std::vector& GetColumnFamilies() const { return ColumnFamilies_; } @@ -613,19 +613,19 @@ class TTableDescription::TImpl { private: Ydb::Table::DescribeTableResult Proto_; TStorageSettings StorageSettings_; - TVector PrimaryKey_; - TVector Columns_; - TVector Indexes_; - TVector Changefeeds_; + std::vector PrimaryKey_; + std::vector Columns_; + std::vector Indexes_; + std::vector Changefeeds_; TMaybe TtlSettings_; TMaybe Tiering_; TString Owner_; - TVector Permissions_; - TVector EffectivePermissions_; - TVector Ranges_; - TVector PartitionStats_; + std::vector Permissions_; + std::vector EffectivePermissions_; + std::vector Ranges_; + std::vector PartitionStats_; TTableStats TableStats; - TVector ColumnFamilies_; + std::vector ColumnFamilies_; THashMap Attributes_; TString CompactionPolicy_; TMaybe UniformPartitions_; @@ -654,29 +654,30 @@ TTableDescription::TTableDescription(const Ydb::Table::CreateTableRequest& reque { } -const TVector& TTableDescription::GetPrimaryKeyColumns() const { +const std::vector& TTableDescription::GetPrimaryKeyColumns() const { return Impl_->GetPrimaryKeyColumns(); } -TVector TTableDescription::GetColumns() const { +std::vector TTableDescription::GetColumns() const { // Conversion to TColumn for API compatibility const auto& columns = Impl_->GetColumns(); - TVector legacy(Reserve(columns.size())); + std::vector legacy; + legacy.reserve(columns.size()); for (const auto& column : columns) { legacy.emplace_back(column.Name, column.Type); } return legacy; } -TVector TTableDescription::GetTableColumns() const { +std::vector TTableDescription::GetTableColumns() const { return Impl_->GetColumns(); } -TVector TTableDescription::GetIndexDescriptions() const { +std::vector TTableDescription::GetIndexDescriptions() const { return Impl_->GetIndexDescriptions(); } -TVector TTableDescription::GetChangefeedDescriptions() const { +std::vector TTableDescription::GetChangefeedDescriptions() const { return Impl_->GetChangefeedDescriptions(); } @@ -696,15 +697,15 @@ const TString& TTableDescription::GetOwner() const { return Impl_->GetOwner(); } -const TVector& TTableDescription::GetPermissions() const { +const std::vector& TTableDescription::GetPermissions() const { return Impl_->GetPermissions(); } -const TVector& TTableDescription::GetEffectivePermissions() const { +const std::vector& TTableDescription::GetEffectivePermissions() const { return Impl_->GetEffectivePermissions(); } -const TVector& TTableDescription::GetKeyRanges() const { +const std::vector& TTableDescription::GetKeyRanges() const { return Impl_->GetKeyRanges(); } @@ -712,47 +713,47 @@ void TTableDescription::AddColumn(const TString& name, const Ydb::Type& type, co Impl_->AddColumn(name, type, family, notNull); } -void TTableDescription::SetPrimaryKeyColumns(const TVector& primaryKeyColumns) { +void TTableDescription::SetPrimaryKeyColumns(const std::vector& primaryKeyColumns) { Impl_->SetPrimaryKeyColumns(primaryKeyColumns); } -void TTableDescription::AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns) { +void TTableDescription::AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns) { Impl_->AddSecondaryIndex(indexName, type, indexColumns); } -void TTableDescription::AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns, const TVector& dataColumns) { +void TTableDescription::AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns, const std::vector& dataColumns) { Impl_->AddSecondaryIndex(indexName, type, indexColumns, dataColumns); } -void TTableDescription::AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +void TTableDescription::AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalSync, indexColumns); } -void TTableDescription::AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +void TTableDescription::AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalSync, indexColumns, dataColumns); } -void TTableDescription::AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +void TTableDescription::AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalAsync, indexColumns); } -void TTableDescription::AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +void TTableDescription::AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalAsync, indexColumns, dataColumns); } -void TTableDescription::AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +void TTableDescription::AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalUnique, indexColumns); } -void TTableDescription::AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +void TTableDescription::AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { AddSecondaryIndex(indexName, EIndexType::GlobalUnique, indexColumns, dataColumns); } -void TTableDescription::AddSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +void TTableDescription::AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { AddSyncSecondaryIndex(indexName, indexColumns); } -void TTableDescription::AddSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +void TTableDescription::AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { AddSyncSecondaryIndex(indexName, indexColumns, dataColumns); } @@ -812,7 +813,7 @@ void TTableDescription::SetStoreType(EStoreType type) { Impl_->SetStoreType(type); } -const TVector& TTableDescription::GetPartitionStats() const { +const std::vector& TTableDescription::GetPartitionStats() const { return Impl_->GetPartitionStats(); } @@ -840,7 +841,7 @@ const TStorageSettings& TTableDescription::GetStorageSettings() const { return Impl_->GetStorageSettings(); } -const TVector& TTableDescription::GetColumnFamilies() const { +const std::vector& TTableDescription::GetColumnFamilies() const { return Impl_->GetColumnFamilies(); } @@ -1135,36 +1136,36 @@ TTableBuilder& TTableBuilder::AddNonNullableColumn(const TString& name, const TP return *this; } -TTableBuilder& TTableBuilder::SetPrimaryKeyColumns(const TVector& primaryKeyColumns) { +TTableBuilder& TTableBuilder::SetPrimaryKeyColumns(const std::vector& primaryKeyColumns) { TableDescription_.SetPrimaryKeyColumns(primaryKeyColumns); return *this; } TTableBuilder& TTableBuilder::SetPrimaryKeyColumn(const TString& primaryKeyColumn) { - TableDescription_.SetPrimaryKeyColumns(TVector{primaryKeyColumn}); + TableDescription_.SetPrimaryKeyColumns(std::vector{primaryKeyColumn}); return *this; } -TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns, const TVector& dataColumns) { +TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns, const std::vector& dataColumns) { TableDescription_.AddSecondaryIndex(indexName, type, indexColumns, dataColumns); return *this; } -TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns) { +TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns) { TableDescription_.AddSecondaryIndex(indexName, type, indexColumns); return *this; } TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, EIndexType type, const TString& indexColumn) { - TableDescription_.AddSecondaryIndex(indexName, type, TVector{indexColumn}); + TableDescription_.AddSecondaryIndex(indexName, type, std::vector{indexColumn}); return *this; } -TTableBuilder& TTableBuilder::AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +TTableBuilder& TTableBuilder::AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalSync, indexColumns, dataColumns); } -TTableBuilder& TTableBuilder::AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +TTableBuilder& TTableBuilder::AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalSync, indexColumns); } @@ -1172,11 +1173,11 @@ TTableBuilder& TTableBuilder::AddSyncSecondaryIndex(const TString& indexName, co return AddSecondaryIndex(indexName, EIndexType::GlobalSync, indexColumn); } -TTableBuilder& TTableBuilder::AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +TTableBuilder& TTableBuilder::AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalAsync, indexColumns, dataColumns); } -TTableBuilder& TTableBuilder::AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +TTableBuilder& TTableBuilder::AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalAsync, indexColumns); } @@ -1184,19 +1185,19 @@ TTableBuilder& TTableBuilder::AddAsyncSecondaryIndex(const TString& indexName, c return AddSecondaryIndex(indexName, EIndexType::GlobalAsync, indexColumn); } -TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { return AddSyncSecondaryIndex(indexName, indexColumns, dataColumns); } -TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +TTableBuilder& TTableBuilder::AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { return AddSyncSecondaryIndex(indexName, indexColumns); } -TTableBuilder& TTableBuilder::AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns) { +TTableBuilder& TTableBuilder::AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalUnique, indexColumns, dataColumns); } -TTableBuilder& TTableBuilder::AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns) { +TTableBuilder& TTableBuilder::AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns) { return AddSecondaryIndex(indexName, EIndexType::GlobalUnique, indexColumns); } @@ -1430,7 +1431,7 @@ TAsyncBulkUpsertResult TTableClient::BulkUpsert(const TString& table, EDataForma return Impl_->BulkUpsert(table, format, data, schema, settings); } -TAsyncReadRowsResult TTableClient::ReadRows(const TString& table, TValue&& rows, const TVector& columns, +TAsyncReadRowsResult TTableClient::ReadRows(const TString& table, TValue&& rows, const std::vector& columns, const TReadRowsSettings& settings) { return Impl_->ReadRows(table, std::move(rows), columns, settings); @@ -1718,7 +1719,7 @@ TAsyncOperation TSession::AlterTableLong(const TString& path, const TAlterTableS GetMinTimeToTouch(Client_->Settings_.SessionPoolSettings_)); } -TAsyncStatus TSession::RenameTables(const TVector& renameItems, const TRenameTablesSettings& settings) { +TAsyncStatus TSession::RenameTables(const std::vector& renameItems, const TRenameTablesSettings& settings) { auto request = MakeOperationRequest(settings); request.set_session_id(SessionImpl_->GetId()); @@ -1736,7 +1737,7 @@ TAsyncStatus TSession::RenameTables(const TVector& renameItems, con GetMinTimeToTouch(Client_->Settings_.SessionPoolSettings_)); } -TAsyncStatus TSession::CopyTables(const TVector& copyItems, const TCopyTablesSettings& settings) { +TAsyncStatus TSession::CopyTables(const std::vector& copyItems, const TCopyTablesSettings& settings) { auto request = MakeOperationRequest(settings); request.set_session_id(SessionImpl_->GetId()); @@ -2070,7 +2071,7 @@ TTableDescription TDescribeTableResult::GetTableDescription() const { //////////////////////////////////////////////////////////////////////////////// -TDataQueryResult::TDataQueryResult(TStatus&& status, TVector&& resultSets, +TDataQueryResult::TDataQueryResult(TStatus&& status, std::vector&& resultSets, const TMaybe& transaction, const TMaybe& dataQuery, bool fromCache, const TMaybe &queryStats) : TStatus(std::move(status)) , Transaction_(transaction) @@ -2080,7 +2081,7 @@ TDataQueryResult::TDataQueryResult(TStatus&& status, TVector&& resul , QueryStats_(queryStats) {} -const TVector& TDataQueryResult::GetResultSets() const { +const std::vector& TDataQueryResult::GetResultSets() const { return ResultSets_; } @@ -2196,14 +2197,14 @@ bool TRenameItem::ReplaceDestination() const { //////////////////////////////////////////////////////////////////////////////// TIndexDescription::TIndexDescription(const TString& name, EIndexType type, - const TVector& indexColumns, const TVector& dataColumns) + const std::vector& indexColumns, const std::vector& dataColumns) : IndexName_(name) , IndexType_(type) , IndexColumns_(indexColumns) , DataColumns_(dataColumns) {} -TIndexDescription::TIndexDescription(const TString& name, const TVector& indexColumns, const TVector& dataColumns) +TIndexDescription::TIndexDescription(const TString& name, const std::vector& indexColumns, const std::vector& dataColumns) : TIndexDescription(name, EIndexType::GlobalSync, indexColumns, dataColumns) {} @@ -2223,11 +2224,11 @@ EIndexType TIndexDescription::GetIndexType() const { return IndexType_; } -const TVector& TIndexDescription::GetIndexColumns() const { +const std::vector& TIndexDescription::GetIndexColumns() const { return IndexColumns_; } -const TVector& TIndexDescription::GetDataColumns() const { +const std::vector& TIndexDescription::GetDataColumns() const { return DataColumns_; } @@ -2238,8 +2239,8 @@ ui64 TIndexDescription::GetSizeBytes() const { template TIndexDescription TIndexDescription::FromProto(const TProto& proto) { EIndexType type; - TVector indexColumns; - TVector dataColumns; + std::vector indexColumns; + std::vector dataColumns; indexColumns.assign(proto.index_columns().begin(), proto.index_columns().end()); dataColumns.assign(proto.data_columns().begin(), proto.data_columns().end()); @@ -2302,7 +2303,7 @@ void TIndexDescription::Out(IOutputStream& o) const { o << ", type: " << IndexType_ << ""; o << ", index_columns: [" << JoinSeq(", ", IndexColumns_) << "]"; - if (DataColumns_) { + if (!DataColumns_.empty()) { o << ", data_columns: [" << JoinSeq(", ", DataColumns_) << "]"; } diff --git a/client/ydb_table/table.h b/client/ydb_table/table.h index 62b43c3c758..7c88c73624c 100644 --- a/client/ydb_table/table.h +++ b/client/ydb_table/table.h @@ -155,15 +155,15 @@ class TIndexDescription { public: TIndexDescription( const TString& name, EIndexType type, - const TVector& indexColumns, - const TVector& dataColumns = TVector()); + const std::vector& indexColumns, + const std::vector& dataColumns = std::vector()); - TIndexDescription(const TString& name, const TVector& indexColumns, const TVector& dataColumns = TVector()); + TIndexDescription(const TString& name, const std::vector& indexColumns, const std::vector& dataColumns = std::vector()); const TString& GetIndexName() const; EIndexType GetIndexType() const; - const TVector& GetIndexColumns() const; - const TVector& GetDataColumns() const; + const std::vector& GetIndexColumns() const; + const std::vector& GetDataColumns() const; ui64 GetSizeBytes() const; void SerializeTo(Ydb::Table::TableIndex& proto) const; @@ -180,8 +180,8 @@ class TIndexDescription { private: TString IndexName_; EIndexType IndexType_; - TVector IndexColumns_; - TVector DataColumns_; + std::vector IndexColumns_; + std::vector DataColumns_; ui64 SizeBytes = 0; }; @@ -480,22 +480,22 @@ class TTableDescription { public: TTableDescription(Ydb::Table::DescribeTableResult&& desc, const TDescribeTableSettings& describeSettings); - const TVector& GetPrimaryKeyColumns() const; + const std::vector& GetPrimaryKeyColumns() const; // DEPRECATED: use GetTableColumns() - TVector GetColumns() const; - TVector GetTableColumns() const; - TVector GetIndexDescriptions() const; - TVector GetChangefeedDescriptions() const; + std::vector GetColumns() const; + std::vector GetTableColumns() const; + std::vector GetIndexDescriptions() const; + std::vector GetChangefeedDescriptions() const; TMaybe GetTtlSettings() const; TMaybe GetTiering() const; EStoreType GetStoreType() const; // Deprecated. Use GetEntry() of TDescribeTableResult instead const TString& GetOwner() const; - const TVector& GetPermissions() const; - const TVector& GetEffectivePermissions() const; + const std::vector& GetPermissions() const; + const std::vector& GetEffectivePermissions() const; - const TVector& GetKeyRanges() const; + const std::vector& GetKeyRanges() const; // Folow options related to table statistics // flag WithTableStatistics must be set @@ -513,13 +513,13 @@ class TTableDescription { // Returns partition statistics for table // flag WithTableStatistics and WithPartitionStatistics must be set - const TVector& GetPartitionStats() const; + const std::vector& GetPartitionStats() const; // Returns storage settings of the table const TStorageSettings& GetStorageSettings() const; // Returns column families of the table - const TVector& GetColumnFamilies() const; + const std::vector& GetColumnFamilies() const; // Attributes const THashMap& GetAttributes() const; @@ -541,24 +541,24 @@ class TTableDescription { explicit TTableDescription(const Ydb::Table::CreateTableRequest& request); void AddColumn(const TString& name, const Ydb::Type& type, const TString& family, std::optional notNull); - void SetPrimaryKeyColumns(const TVector& primaryKeyColumns); + void SetPrimaryKeyColumns(const std::vector& primaryKeyColumns); // common - void AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns); - void AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns, const TVector& dataColumns); + void AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns); + void AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns, const std::vector& dataColumns); // sync - void AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns); - void AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); + void AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns); + void AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); // async - void AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns); - void AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); + void AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns); + void AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); // unique - void AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns); - void AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); + void AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns); + void AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); // default - void AddSecondaryIndex(const TString& indexName, const TVector& indexColumns); - void AddSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); + void AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns); + void AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); void SetTtlSettings(TTtlSettings&& settings); void SetTtlSettings(const TTtlSettings& settings); @@ -752,31 +752,31 @@ class TTableBuilder { TTableBuilder& AddNonNullableColumn(const TString& name, const EPrimitiveType& type, const TString& family = TString()); TTableBuilder& AddNonNullableColumn(const TString& name, const TDecimalType& type, const TString& family = TString()); TTableBuilder& AddNonNullableColumn(const TString& name, const TPgType& type, const TString& family = TString()); - TTableBuilder& SetPrimaryKeyColumns(const TVector& primaryKeyColumns); + TTableBuilder& SetPrimaryKeyColumns(const std::vector& primaryKeyColumns); TTableBuilder& SetPrimaryKeyColumn(const TString& primaryKeyColumn); // common - TTableBuilder& AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns, const TVector& dataColumns); - TTableBuilder& AddSecondaryIndex(const TString& indexName, EIndexType type, const TVector& indexColumns); + TTableBuilder& AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns, const std::vector& dataColumns); + TTableBuilder& AddSecondaryIndex(const TString& indexName, EIndexType type, const std::vector& indexColumns); TTableBuilder& AddSecondaryIndex(const TString& indexName, EIndexType type, const TString& indexColumn); // sync - TTableBuilder& AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); - TTableBuilder& AddSyncSecondaryIndex(const TString& indexName, const TVector& indexColumns); + TTableBuilder& AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); + TTableBuilder& AddSyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns); TTableBuilder& AddSyncSecondaryIndex(const TString& indexName, const TString& indexColumn); // async - TTableBuilder& AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); - TTableBuilder& AddAsyncSecondaryIndex(const TString& indexName, const TVector& indexColumns); + TTableBuilder& AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); + TTableBuilder& AddAsyncSecondaryIndex(const TString& indexName, const std::vector& indexColumns); TTableBuilder& AddAsyncSecondaryIndex(const TString& indexName, const TString& indexColumn); // unique - TTableBuilder& AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns); - TTableBuilder& AddUniqueSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); + TTableBuilder& AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns); + TTableBuilder& AddUniqueSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); // default - TTableBuilder& AddSecondaryIndex(const TString& indexName, const TVector& indexColumns, const TVector& dataColumns); - TTableBuilder& AddSecondaryIndex(const TString& indexName, const TVector& indexColumns); + TTableBuilder& AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns, const std::vector& dataColumns); + TTableBuilder& AddSecondaryIndex(const TString& indexName, const std::vector& indexColumns); TTableBuilder& AddSecondaryIndex(const TString& indexName, const TString& indexColumn); TTableBuilder& SetTtlSettings(TTtlSettings&& settings); @@ -1070,7 +1070,7 @@ class TTableClient { TAsyncBulkUpsertResult BulkUpsert(const TString& table, EDataFormat format, const TString& data, const TString& schema = {}, const TBulkUpsertSettings& settings = TBulkUpsertSettings()); - TAsyncReadRowsResult ReadRows(const TString& table, TValue&& keys, const TVector& columns = {}, + TAsyncReadRowsResult ReadRows(const TString& table, TValue&& keys, const std::vector& columns = {}, const TReadRowsSettings& settings = TReadRowsSettings()); TAsyncScanQueryPartIterator StreamExecuteScanQuery(const TString& query, @@ -1603,10 +1603,10 @@ class TSession { TAsyncStatus CopyTable(const TString& src, const TString& dst, const TCopyTableSettings& settings = TCopyTableSettings()); - TAsyncStatus CopyTables(const TVector& copyItems, + TAsyncStatus CopyTables(const std::vector& copyItems, const TCopyTablesSettings& settings = TCopyTablesSettings()); - TAsyncStatus RenameTables(const TVector& renameItems, + TAsyncStatus RenameTables(const std::vector& renameItems, const TRenameTablesSettings& settings = TRenameTablesSettings()); TAsyncDescribeTableResult DescribeTable(const TString& path, @@ -1814,10 +1814,10 @@ class TDescribeTableResult : public NScheme::TDescribePathResult { class TDataQueryResult : public TStatus { public: - TDataQueryResult(TStatus&& status, TVector&& resultSets, const TMaybe& transaction, + TDataQueryResult(TStatus&& status, std::vector&& resultSets, const TMaybe& transaction, const TMaybe& dataQuery, bool fromCache, const TMaybe& queryStats); - const TVector& GetResultSets() const; + const std::vector& GetResultSets() const; TResultSet GetResultSet(size_t resultIndex) const; TResultSetParser GetResultSetParser(size_t resultIndex) const; @@ -1833,7 +1833,7 @@ class TDataQueryResult : public TStatus { private: TMaybe Transaction_; - TVector ResultSets_; + std::vector ResultSets_; TMaybe DataQuery_; bool FromCache_; TMaybe QueryStats_; diff --git a/client/ydb_topic/impl/executor.cpp b/client/ydb_topic/impl/executor.cpp index 9b682d8319d..88ddbe57e3a 100644 --- a/client/ydb_topic/impl/executor.cpp +++ b/client/ydb_topic/impl/executor.cpp @@ -10,7 +10,7 @@ IAsyncExecutor::TPtr CreateDefaultExecutor() { return CreateThreadPoolExecutor(1); } -void TThreadPoolExecutor::PostImpl(TVector&& fs) { +void TThreadPoolExecutor::PostImpl(std::vector&& fs) { for (auto& f : fs) { ThreadPool->SafeAddFunc(std::move(f)); } @@ -26,7 +26,7 @@ TSerialExecutor::TSerialExecutor(IAsyncExecutor::TPtr executor) Y_ABORT_UNLESS(executor); } -void TSerialExecutor::PostImpl(TVector&& fs) { +void TSerialExecutor::PostImpl(std::vector&& fs) { for (auto& f : fs) { PostImpl(std::move(f)); } diff --git a/client/ydb_topic/impl/executor.h b/client/ydb_topic/impl/executor.h index 1bad2ebb406..e9738514f84 100644 --- a/client/ydb_topic/impl/executor.h +++ b/client/ydb_topic/impl/executor.h @@ -12,7 +12,7 @@ namespace NYdb::NTopic { class IAsyncExecutor : public IExecutor { private: - virtual void PostImpl(TVector>&&) = 0; + virtual void PostImpl(std::vector>&&) = 0; virtual void PostImpl(std::function&&) = 0; public: @@ -46,7 +46,7 @@ class TThreadPoolExecutor : public IAsyncExecutor { } private: - void PostImpl(TVector&& fs) override; + void PostImpl(std::vector&& fs) override; void PostImpl(TFunction&& f) override; private: @@ -66,7 +66,7 @@ class TSerialExecutor : public IAsyncExecutor, public std::enable_shared_from_th ~TSerialExecutor() = default; private: - void PostImpl(TVector&& fs) override; + void PostImpl(std::vector&& fs) override; void PostImpl(TFunction&& f) override; void PostNext(); }; diff --git a/client/ydb_topic/impl/read_session.cpp b/client/ydb_topic/impl/read_session.cpp index 3956d40d13d..061fbac6854 100644 --- a/client/ydb_topic/impl/read_session.cpp +++ b/client/ydb_topic/impl/read_session.cpp @@ -124,7 +124,7 @@ NThreading::TFuture TReadSession::WaitEvent() { return EventsQueue->WaitEvent(); } -TVector TReadSession::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { +std::vector TReadSession::GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) { auto res = EventsQueue->GetEvents(block, maxEventsCount, maxByteSize); if (EventsQueue->IsClosed()) { Abort(EStatus::ABORTED, "Aborted"); @@ -132,7 +132,7 @@ TVector TReadSession::GetEvents(bool block, TMaybe TReadSession::GetEvents(const TReadSessionGetEventSettings& settings) +std::vector TReadSession::GetEvents(const TReadSessionGetEventSettings& settings) { auto events = GetEvents(settings.Block_, settings.MaxEventsCount_, settings.MaxByteSize_); if (!events.empty() && settings.Tx_) { @@ -203,7 +203,7 @@ void TReadSession::UpdateOffsets(const NTable::TTransaction& tx) return; } - TVector topics; + std::vector topics; for (auto& [path, partitions] : p->second) { TTopicOffsets topic; topic.Path = path; diff --git a/client/ydb_topic/impl/read_session.h b/client/ydb_topic/impl/read_session.h index 4b5677be541..432b75d4501 100644 --- a/client/ydb_topic/impl/read_session.h +++ b/client/ydb_topic/impl/read_session.h @@ -20,10 +20,10 @@ class TReadSession : public IReadSession { void Start(); NThreading::TFuture WaitEvent() override; - TVector GetEvents(bool block, + std::vector GetEvents(bool block, TMaybe maxEventsCount, size_t maxByteSize) override; - TVector GetEvents(const TReadSessionGetEventSettings& settings) override; + std::vector GetEvents(const TReadSessionGetEventSettings& settings) override; TMaybe GetEvent(bool block, size_t maxByteSize) override; TMaybe GetEvent(const TReadSessionGetEventSettings& settings) override; @@ -87,7 +87,7 @@ class TReadSession : public IReadSession { std::shared_ptr> EventsQueue; std::shared_ptr>> CbContext; - TVector Topics; + std::vector Topics; std::shared_ptr> CountersLogger; std::shared_ptr>> DumpCountersContext; diff --git a/client/ydb_topic/impl/read_session_event.cpp b/client/ydb_topic/impl/read_session_event.cpp index 3a089ea7a62..e967cd38744 100644 --- a/client/ydb_topic/impl/read_session_event.cpp +++ b/client/ydb_topic/impl/read_session_event.cpp @@ -229,7 +229,7 @@ void TPrintable::DebugString(TStringBuilder& ret, bool print //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NTopic::TReadSessionEvent::TDataReceivedEvent -TDataReceivedEvent::TDataReceivedEvent(TVector messages, TVector compressedMessages, +TDataReceivedEvent::TDataReceivedEvent(std::vector messages, std::vector compressedMessages, TPartitionSession::TPtr partitionSession) : TPartitionSessionAccessor(std::move(partitionSession)) , Messages(std::move(messages)) diff --git a/client/ydb_topic/impl/topic.cpp b/client/ydb_topic/impl/topic.cpp index b86137d5f6c..5034ebb405d 100644 --- a/client/ydb_topic/impl/topic.cpp +++ b/client/ydb_topic/impl/topic.cpp @@ -116,7 +116,7 @@ const TInstant& TConsumer::GetReadFrom() const { return ReadFrom_; } -const TVector& TConsumer::GetSupportedCodecs() const { +const std::vector& TConsumer::GetSupportedCodecs() const { return SupportedCodecs_; } @@ -132,11 +132,11 @@ ui32 TTopicDescription::GetTotalPartitionsCount() const { return Partitions_.size(); } -const TVector& TTopicDescription::GetPartitions() const { +const std::vector& TTopicDescription::GetPartitions() const { return Partitions_; } -const TVector& TConsumerDescription::GetPartitions() const { +const std::vector& TConsumerDescription::GetPartitions() const { return Partitions_; } @@ -148,7 +148,7 @@ const TConsumer& TConsumerDescription::GetConsumer() const { return Consumer_; } -const TVector& TTopicDescription::GetSupportedCodecs() const { +const std::vector& TTopicDescription::GetSupportedCodecs() const { return SupportedCodecs_; } @@ -176,7 +176,7 @@ const TMap& TTopicDescription::GetAttributes() const { return Attributes_; } -const TVector& TTopicDescription::GetConsumers() const { +const std::vector& TTopicDescription::GetConsumers() const { return Consumers_; } @@ -209,11 +209,11 @@ const TTopicStats& TTopicDescription::GetTopicStats() const { return TopicStats_; } -const TVector& TTopicDescription::GetPermissions() const { +const std::vector& TTopicDescription::GetPermissions() const { return Permissions_; } -const TVector& TTopicDescription::GetEffectivePermissions() const { +const std::vector& TTopicDescription::GetEffectivePermissions() const { return EffectivePermissions_; } diff --git a/client/ydb_topic/impl/topic_impl.h b/client/ydb_topic/impl/topic_impl.h index 2f7eb2a6413..957715c890f 100644 --- a/client/ydb_topic/impl/topic_impl.h +++ b/client/ydb_topic/impl/topic_impl.h @@ -21,12 +21,12 @@ struct TOffsetsRange { struct TPartitionOffsets { ui64 PartitionId; - TVector Offsets; + std::vector Offsets; }; struct TTopicOffsets { TString Path; - TVector Partitions; + std::vector Partitions; }; struct TUpdateOffsetsInTransactionSettings : public TOperationRequestSettings { @@ -310,7 +310,7 @@ class TTopicClient::TImpl : public TClientImplCommon { } TAsyncStatus UpdateOffsetsInTransaction(const NTable::TTransaction& tx, - const TVector& topics, + const std::vector& topics, const TString& consumerName, const TUpdateOffsetsInTransactionSettings& settings) { diff --git a/client/ydb_topic/impl/write_session.cpp b/client/ydb_topic/impl/write_session.cpp index 7dfd064fc5d..484f7f31b0c 100644 --- a/client/ydb_topic/impl/write_session.cpp +++ b/client/ydb_topic/impl/write_session.cpp @@ -27,7 +27,7 @@ TMaybe TWriteSession::GetEvent(bool block) { return TryGetImpl()->EventsQueue->GetEvent(block); } -TVector TWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { +std::vector TWriteSession::GetEvents(bool block, TMaybe maxEventsCount) { return TryGetImpl()->EventsQueue->GetEvents(block, maxEventsCount); } diff --git a/client/ydb_topic/impl/write_session.h b/client/ydb_topic/impl/write_session.h index a82019b76ca..d2abdd8c013 100644 --- a/client/ydb_topic/impl/write_session.h +++ b/client/ydb_topic/impl/write_session.h @@ -29,7 +29,7 @@ class TWriteSession : public IWriteSession, TDbDriverStatePtr dbDriverState); TMaybe GetEvent(bool block = false) override; - TVector GetEvents(bool block = false, + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) override; NThreading::TFuture GetInitSeqNo() override; diff --git a/client/ydb_topic/impl/write_session_impl.cpp b/client/ydb_topic/impl/write_session_impl.cpp index 0d19ff1c5b4..54c4e5d8af7 100644 --- a/client/ydb_topic/impl/write_session_impl.cpp +++ b/client/ydb_topic/impl/write_session_impl.cpp @@ -329,7 +329,7 @@ TMaybe TWriteSessionImpl::GetEvent(bool block) { } // Client method -TVector TWriteSessionImpl::GetEvents(bool block, TMaybe maxEventsCount) { +std::vector TWriteSessionImpl::GetEvents(bool block, TMaybe maxEventsCount) { return EventsQueue->GetEvents(block, maxEventsCount); } @@ -951,7 +951,7 @@ TMemoryUsageChange TWriteSessionImpl::OnMemoryUsageChangedImpl(i64 diff) { return {wasOk, nowOk}; } -TBuffer CompressBuffer(TVector& data, ECodec codec, i32 level) { +TBuffer CompressBuffer(std::vector& data, ECodec codec, i32 level) { TBuffer result; THolder coder = NCompressionDetails::CreateCoder(codec, result, level); for (auto& buffer : data) { diff --git a/client/ydb_topic/impl/write_session_impl.h b/client/ydb_topic/impl/write_session_impl.h index 4cf1caf803c..5dd8c80045e 100644 --- a/client/ydb_topic/impl/write_session_impl.h +++ b/client/ydb_topic/impl/write_session_impl.h @@ -59,8 +59,8 @@ class TWriteSessionEventsQueue: public NPersQueue::TBaseSessionEventsQueueEvent); } - TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) { - TVector eventInfos; + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) { + std::vector eventInfos; with_lock (Mutex) { if (block) { WaitEventsImpl(); @@ -77,7 +77,7 @@ class TWriteSessionEventsQueue: public NPersQueue::TBaseSessionEventsQueue result; + std::vector result; result.reserve(eventInfos.size()); for (TEventInfo& eventInfo : eventInfos) { eventInfo.OnUserRetrievedEvent(); @@ -170,11 +170,11 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, TStringBuf DataRef; TMaybe Codec; ui32 OriginalSize; // only for coded messages - TVector> MessageMeta; + std::vector> MessageMeta; const NTable::TTransaction* Tx; TMessage(ui64 id, const TInstant& createdAt, TStringBuf data, TMaybe codec = {}, - ui32 originalSize = 0, const TVector>& messageMeta = {}, + ui32 originalSize = 0, const std::vector>& messageMeta = {}, const NTable::TTransaction* tx = nullptr) : Id(id) , CreatedAt(createdAt) @@ -188,14 +188,14 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, struct TMessageBatch { TBuffer Data; - TVector Messages; + std::vector Messages; ui64 CurrentSize = 0; TInstant StartedAt = TInstant::Zero(); bool Acquired = false; bool FlushRequested = false; void Add(ui64 id, const TInstant& createdAt, TStringBuf data, TMaybe codec, ui32 originalSize, - const TVector>& messageMeta, + const std::vector>& messageMeta, const NTable::TTransaction* tx) { if (StartedAt == TInstant::Zero()) StartedAt = TInstant::Now(); @@ -239,7 +239,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, size_t OriginalSize = 0; size_t OriginalMemoryUsage = 0; ui32 CodecID = static_cast(ECodec::RAW); - mutable TVector OriginalDataRefs; + mutable std::vector OriginalDataRefs; mutable TBuffer Data; bool Compressed = false; mutable bool Valid = true; @@ -269,7 +269,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, ui64 Id; TInstant CreatedAt; size_t Size; - TVector> MessageMeta; + std::vector> MessageMeta; const NTable::TTransaction* Tx; TOriginalMessage(const ui64 id, const TInstant createdAt, const size_t size, @@ -281,7 +281,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, {} TOriginalMessage(const ui64 id, const TInstant createdAt, const size_t size, - TVector>&& messageMeta, + std::vector>&& messageMeta, const NTable::TTransaction* tx) : Id(id) , CreatedAt(createdAt) @@ -307,7 +307,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, struct TProcessSrvMessageResult { THandleResult HandleResult; TMaybe InitSeqNo; - TVector Events; + std::vector Events; bool Ok = true; }; @@ -325,7 +325,7 @@ class TWriteSessionImpl : public TContinuationTokenIssuer, TDbDriverStatePtr dbDriverState); TMaybe GetEvent(bool block = false); - TVector GetEvents(bool block = false, + std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()); NThreading::TFuture GetInitSeqNo(); diff --git a/client/ydb_topic/topic.h b/client/ydb_topic/topic.h index 1e548f2f151..0ae137374ad 100644 --- a/client/ydb_topic/topic.h +++ b/client/ydb_topic/topic.h @@ -57,14 +57,14 @@ class TConsumer { const TString& GetConsumerName() const; bool GetImportant() const; const TInstant& GetReadFrom() const; - const TVector& GetSupportedCodecs() const; + const std::vector& GetSupportedCodecs() const; const TMap& GetAttributes() const; private: TString ConsumerName_; bool Important_; TInstant ReadFrom_; TMap Attributes_; - TVector SupportedCodecs_; + std::vector SupportedCodecs_; }; @@ -151,8 +151,8 @@ class TPartitionInfo { ui64 GetPartitionId() const; bool GetActive() const; - const TVector GetChildPartitionIds() const; - const TVector GetParentPartitionIds() const; + const std::vector GetChildPartitionIds() const; + const std::vector GetParentPartitionIds() const; const TMaybe& GetPartitionStats() const; const TMaybe& GetPartitionConsumerStats() const; @@ -161,8 +161,8 @@ class TPartitionInfo { private: ui64 PartitionId_; bool Active_; - TVector ChildPartitionIds_; - TVector ParentPartitionIds_; + std::vector ChildPartitionIds_; + std::vector ParentPartitionIds_; TMaybe PartitionStats_; TMaybe PartitionConsumerStats_; TMaybe PartitionLocation_; @@ -194,17 +194,17 @@ class TTopicDescription { const NScheme::TVirtualTimestamp& GetCreationTimestamp() const; - const TVector& GetPermissions() const; + const std::vector& GetPermissions() const; - const TVector& GetEffectivePermissions() const; + const std::vector& GetEffectivePermissions() const; const TPartitioningSettings& GetPartitioningSettings() const; ui32 GetTotalPartitionsCount() const; - const TVector& GetPartitions() const; + const std::vector& GetPartitions() const; - const TVector& GetSupportedCodecs() const; + const std::vector& GetSupportedCodecs() const; const TDuration& GetRetentionPeriod() const; @@ -216,7 +216,7 @@ class TTopicDescription { const TMap& GetAttributes() const; - const TVector& GetConsumers() const; + const std::vector& GetConsumers() const; EMeteringMode GetMeteringMode() const; @@ -228,8 +228,8 @@ class TTopicDescription { const Ydb::Topic::DescribeTopicResult& GetProto() const; const Ydb::Topic::DescribeTopicResult Proto_; - TVector Partitions_; - TVector SupportedCodecs_; + std::vector Partitions_; + std::vector SupportedCodecs_; TPartitioningSettings PartitioningSettings_; TDuration RetentionPeriod_; TMaybe RetentionStorageMb_; @@ -237,13 +237,13 @@ class TTopicDescription { ui64 PartitionWriteBurstBytes_; EMeteringMode MeteringMode_; TMap Attributes_; - TVector Consumers_; + std::vector Consumers_; TTopicStats TopicStats_; TString Owner_; NScheme::TVirtualTimestamp CreationTimestamp_; - TVector Permissions_; - TVector EffectivePermissions_; + std::vector Permissions_; + std::vector EffectivePermissions_; }; @@ -253,7 +253,7 @@ class TConsumerDescription { public: TConsumerDescription(Ydb::Topic::DescribeConsumerResult&& desc); - const TVector& GetPartitions() const; + const std::vector& GetPartitions() const; const TConsumer& GetConsumer() const; @@ -263,7 +263,7 @@ class TConsumerDescription { const Ydb::Topic::DescribeConsumerResult Proto_; - TVector Partitions_; + std::vector Partitions_; TConsumer Consumer_; }; @@ -388,12 +388,12 @@ struct TConsumerSettings { return *this; } - TConsumerSettings& SetSupportedCodecs(TVector&& codecs) { + TConsumerSettings& SetSupportedCodecs(std::vector&& codecs) { SupportedCodecs_ = std::move(codecs); return *this; } - TConsumerSettings& SetSupportedCodecs(const TVector& codecs) { + TConsumerSettings& SetSupportedCodecs(const std::vector& codecs) { SupportedCodecs_ = codecs; return *this; } @@ -425,12 +425,12 @@ struct TAlterConsumerSettings { return TAlterConsumerAttributesBuilder(*this); } - TAlterConsumerSettings& SetSupportedCodecs(TVector&& codecs) { + TAlterConsumerSettings& SetSupportedCodecs(std::vector&& codecs) { SetSupportedCodecs_ = std::move(codecs); return *this; } - TAlterConsumerSettings& SetSupportedCodecs(const TVector& codecs) { + TAlterConsumerSettings& SetSupportedCodecs(const std::vector& codecs) { SetSupportedCodecs_ = codecs; return *this; } @@ -464,12 +464,12 @@ struct TCreateTopicSettings : public TOperationRequestSettings&& codecs) { + TCreateTopicSettings& SetSupportedCodecs(std::vector&& codecs) { SupportedCodecs_ = std::move(codecs); return *this; } - TCreateTopicSettings& SetSupportedCodecs(const TVector& codecs) { + TCreateTopicSettings& SetSupportedCodecs(const std::vector& codecs) { SupportedCodecs_ = codecs; return *this; } @@ -534,12 +534,12 @@ struct TAlterTopicSettings : public TOperationRequestSettings&& codecs) { + TAlterTopicSettings& SetSupportedCodecs(std::vector&& codecs) { SetSupportedCodecs_ = std::move(codecs); return *this; } - TAlterTopicSettings& SetSupportedCodecs(const TVector& codecs) { + TAlterTopicSettings& SetSupportedCodecs(const std::vector& codecs) { SetSupportedCodecs_ = codecs; return *this; } @@ -633,7 +633,7 @@ struct TMessageMeta: public TThrRefBase { using TPtr = TIntrusivePtr; //! User defined fields. - TVector> Fields; + std::vector> Fields; }; //! Event that is sent to client during session destruction. @@ -907,7 +907,7 @@ struct TReadSessionEvent { }; public: - TDataReceivedEvent(TVector messages, TVector compressedMessages, + TDataReceivedEvent(std::vector messages, std::vector compressedMessages, TPartitionSession::TPtr partitionSession); bool HasCompressedMessages() const { @@ -919,23 +919,23 @@ struct TReadSessionEvent { } //! Get messages. - TVector& GetMessages() { + std::vector& GetMessages() { CheckMessagesFilled(false); return Messages; } - const TVector& GetMessages() const { + const std::vector& GetMessages() const { CheckMessagesFilled(false); return Messages; } //! Get compressed messages. - TVector& GetCompressedMessages() { + std::vector& GetCompressedMessages() { CheckMessagesFilled(true); return CompressedMessages; } - const TVector& GetCompressedMessages() const { + const std::vector& GetCompressedMessages() const { CheckMessagesFilled(true); return CompressedMessages; } @@ -955,8 +955,8 @@ struct TReadSessionEvent { } private: - TVector Messages; - TVector CompressedMessages; + std::vector Messages; + std::vector CompressedMessages; std::vector> OffsetRanges; }; @@ -1241,7 +1241,7 @@ struct TWriteSessionEvent { struct TAcksEvent : public TPrintable { //! Acks could be batched from several Write requests. //! They are provided to client as soon as possible. - TVector Acks; + std::vector Acks; }; //! Indicates that a writer is ready to accept new message(s). @@ -1574,7 +1574,7 @@ struct TReadSessionSettings: public TRequestSettings { //! Contains the message to write and all the options. struct TWriteMessage { using TSelf = TWriteMessage; - using TMessageMeta = TVector>; + using TMessageMeta = std::vector>; public: TWriteMessage() = delete; TWriteMessage(TStringBuf data) @@ -1666,7 +1666,7 @@ class IWriteSession { //! If blocking = false, instantly returns up to maxEventsCount available events. //! If blocking = true, blocks till maxEventsCount events are available. //! If maxEventsCount is unset, write session decides the count to return itself. - virtual TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) = 0; + virtual std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing()) = 0; //! Future that is set when initial SeqNo is available. virtual NThreading::TFuture GetInitSeqNo() = 0; @@ -1724,10 +1724,10 @@ class IReadSession { //! //! If maxEventsCount is not specified, //! read session chooses event batch size automatically. - virtual TVector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), + virtual std::vector GetEvents(bool block = false, TMaybe maxEventsCount = Nothing(), size_t maxByteSize = std::numeric_limits::max()) = 0; - virtual TVector GetEvents(const TReadSessionGetEventSettings& settings) = 0; + virtual std::vector GetEvents(const TReadSessionGetEventSettings& settings) = 0; //! Get single event. virtual TMaybe GetEvent(bool block = false, diff --git a/client/ydb_topic/ut/basic_usage_ut.cpp b/client/ydb_topic/ut/basic_usage_ut.cpp index eacd141d571..6b2e852a4ff 100644 --- a/client/ydb_topic/ut/basic_usage_ut.cpp +++ b/client/ydb_topic/ut/basic_usage_ut.cpp @@ -264,7 +264,7 @@ Y_UNIT_TEST_SUITE(BasicUsage) { auto& client = setup->GetPersQueueClient(); auto session = client.CreateSimpleBlockingWriteSession(writeSettings); TString messageBase = "message----"; - TVector sentMessages; + std::vector sentMessages; for (auto i = 0u; i < count; i++) { // sentMessages.emplace_back(messageBase * (i+1) + ToString(i)); diff --git a/client/ydb_topic/ut/topic_to_table_ut.cpp b/client/ydb_topic/ut/topic_to_table_ut.cpp index 9e708f3a4f8..e9fd7d84004 100644 --- a/client/ydb_topic/ut/topic_to_table_ut.cpp +++ b/client/ydb_topic/ut/topic_to_table_ut.cpp @@ -222,7 +222,7 @@ Y_UNIT_TEST_F(WriteToTopic, TFixture) auto session = CreateSession(); auto tx = BeginTx(session); - auto writeMessages = [&](const TVector& messages) { + auto writeMessages = [&](const std::vector& messages) { NTopic::TTopicClient client(GetDriver()); auto session = client.CreateSimpleBlockingWriteSession(options); diff --git a/client/ydb_types/fluent_settings_helpers.h b/client/ydb_types/fluent_settings_helpers.h index cda28a75cff..ff1d4094bc0 100644 --- a/client/ydb_types/fluent_settings_helpers.h +++ b/client/ydb_types/fluent_settings_helpers.h @@ -37,16 +37,16 @@ } #define FLUENT_SETTING_VECTOR(type, name) \ - TVector name##_; \ + std::vector name##_; \ TSelf& Append##name(const type& value) { \ name##_.push_back(value); \ return static_cast(*this); \ } #define FLUENT_SETTING_OPTIONAL_VECTOR(type, name) \ - TMaybe> name##_; \ + TMaybe> name##_; \ TSelf& Append##name(const type& value) { \ - if (!name##_) name##_ = TVector{}; \ + if (!name##_) name##_ = std::vector{}; \ name##_->push_back(value); \ return static_cast(*this); \ } diff --git a/examples/basic_example/basic_example_data.cpp b/examples/basic_example/basic_example_data.cpp index 6e9cecc29b9..17045a3c1b0 100644 --- a/examples/basic_example/basic_example_data.cpp +++ b/examples/basic_example/basic_example_data.cpp @@ -47,7 +47,7 @@ struct TEpisode { }; TParams GetTablesDataParams() { - TVector seriesData = { + std::vector seriesData = { TSeries(1, "IT Crowd", TInstant::ParseIso8601("2006-02-03"), "The IT Crowd is a British sitcom produced by Channel 4, written by Graham Linehan, produced by " "Ash Atalla and starring Chris O'Dowd, Richard Ayoade, Katherine Parkinson, and Matt Berry."), @@ -56,7 +56,7 @@ TParams GetTablesDataParams() { "Dave Krinsky. The series focuses on five young men who founded a startup company in Silicon Valley.") }; - TVector seasonsData = { + std::vector seasonsData = { TSeason(1, 1, "Season 1", TInstant::ParseIso8601("2006-02-03"), TInstant::ParseIso8601("2006-03-03")), TSeason(1, 2, "Season 2", TInstant::ParseIso8601("2007-08-24"), TInstant::ParseIso8601("2007-09-28")), TSeason(1, 3, "Season 3", TInstant::ParseIso8601("2008-11-21"), TInstant::ParseIso8601("2008-12-26")), @@ -68,7 +68,7 @@ TParams GetTablesDataParams() { TSeason(2, 5, "Season 5", TInstant::ParseIso8601("2018-03-25"), TInstant::ParseIso8601("2018-05-13")) }; - TVector episodesData = { + std::vector episodesData = { TEpisode(1, 1, 1, "Yesterday's Jam", TInstant::ParseIso8601("2006-02-03")), TEpisode(1, 1, 2, "Calamity Jen", TInstant::ParseIso8601("2006-02-03")), TEpisode(1, 1, 3, "Fifty-Fifty", TInstant::ParseIso8601("2006-02-10")), diff --git a/examples/bulk_upsert_simple/main.cpp b/examples/bulk_upsert_simple/main.cpp index e277d6899c8..926169dedcd 100644 --- a/examples/bulk_upsert_simple/main.cpp +++ b/examples/bulk_upsert_simple/main.cpp @@ -20,7 +20,7 @@ struct TLogMessage { TString Message; }; -void GetLogBatch(ui64 logOffset, TVector& logBatch) { +void GetLogBatch(ui64 logOffset, std::vector& logBatch) { logBatch.clear(); for (size_t i = 0; i < BATCH_SIZE; ++i) { TLogMessage message; @@ -33,7 +33,7 @@ void GetLogBatch(ui64 logOffset, TVector& logBatch) { } } -bool WriteLogBatch(NYdb::NTable::TTableClient& tableClient, const TString& table, const TVector& logBatch, +bool WriteLogBatch(NYdb::NTable::TTableClient& tableClient, const TString& table, const std::vector& logBatch, const NYdb::NTable::TRetryOperationSettings& retrySettings) { NYdb::TValueBuilder rows; @@ -100,7 +100,7 @@ bool Run(const NYdb::TDriver &driver, const TString &table, ui32 batchCount) { .Idempotent(true) .MaxRetries(20); - TVector logBatch; + std::vector logBatch; for (ui32 offset = 0; offset < batchCount; ++offset) { GetLogBatch(offset, logBatch); if (!WriteLogBatch(client, table, logBatch, writeRetrySettings)) { diff --git a/examples/pagination/pagination_data.cpp b/examples/pagination/pagination_data.cpp index 30efd41f43c..b84634fb4f8 100644 --- a/examples/pagination/pagination_data.cpp +++ b/examples/pagination/pagination_data.cpp @@ -15,7 +15,7 @@ struct TSchool { }; TParams GetTablesDataParams() { - TVector schoolsData = { + std::vector schoolsData = { TSchool("Орлов", 1, "Ст.Халтурина, 2"), TSchool("Орлов", 2, "Свободы, 4"), TSchool("Яранск", 1, "Гоголя, 25"), diff --git a/examples/secondary_index/secondary_index_list.cpp b/examples/secondary_index/secondary_index_list.cpp index d06194a38b6..2c9ad4ad0d6 100644 --- a/examples/secondary_index/secondary_index_list.cpp +++ b/examples/secondary_index/secondary_index_list.cpp @@ -8,7 +8,7 @@ using namespace NYdb::NTable; //////////////////////////////////////////////////////////////////////////////// -static void ParseSeries(TVector& results, TResultSetParser&& parser) { +static void ParseSeries(std::vector& results, TResultSetParser&& parser) { results.clear(); while (parser.TryNextRow()) { auto& series = results.emplace_back(); @@ -21,7 +21,7 @@ static void ParseSeries(TVector& results, TResultSetParser&& parser) { } static TStatus ListByViews( - TVector& results, + std::vector& results, TSession& session, const TString& prefix, ui64 limit, @@ -99,7 +99,7 @@ static TStatus ListByViews( } static TStatus ListByViews( - TVector& results, + std::vector& results, TSession& session, const TString& prefix, ui64 limit) @@ -148,7 +148,7 @@ static TStatus ListByViews( } static TStatus ListById( - TVector& results, + std::vector& results, TSession& session, const TString& prefix, ui64 limit, @@ -196,7 +196,7 @@ static TStatus ListById( } static TStatus ListById( - TVector& results, + std::vector& results, TSession& session, const TString& prefix, ui64 limit) @@ -255,7 +255,7 @@ int RunListSeries(TDriver& driver, const TString& prefix, int argc, char** argv) TOptsParseResult res(&opts, argc, argv); - TVector results; + std::vector results; TTableClient client(driver); ThrowOnError(client.RetryOperationSync([&](TSession session) -> TStatus { if (byViews) { @@ -274,7 +274,7 @@ int RunListSeries(TDriver& driver, const TString& prefix, int argc, char** argv) })); size_t rows = results.size() + 1; - TVector columns[5]; + std::vector columns[5]; for (size_t i = 0; i < 5; ++i) { columns[i].reserve(rows); } diff --git a/examples/secondary_index_builtin/secondary_index.cpp b/examples/secondary_index_builtin/secondary_index.cpp index fd821477128..ee3144808b6 100644 --- a/examples/secondary_index_builtin/secondary_index.cpp +++ b/examples/secondary_index_builtin/secondary_index.cpp @@ -33,7 +33,7 @@ TString JoinPath(const TString& prefix, const TString& path) { } -void ParseSelectSeries(TVector& parseResult, TResultSetParser&& parser) { +void ParseSelectSeries(std::vector& parseResult, TResultSetParser&& parser) { parseResult.clear(); while (parser.TryNextRow()) { auto& series = parseResult.emplace_back(); diff --git a/examples/secondary_index_builtin/secondary_index.h b/examples/secondary_index_builtin/secondary_index.h index a2ecb118ef9..3ebb24c0bd7 100644 --- a/examples/secondary_index_builtin/secondary_index.h +++ b/examples/secondary_index_builtin/secondary_index.h @@ -80,7 +80,7 @@ TString GetCommandsList(); TCommand Parse(const char *stringCmnd); TString JoinPath(const TString& prefix, const TString& path); -void ParseSelectSeries(TVector& parseResult, TResultSetParser&& parser); +void ParseSelectSeries(std::vector& parseResult, TResultSetParser&& parser); int Create(NYdb::TDriver& driver, const TString& path); int Insert(NYdb::TDriver& driver, const TString& path); diff --git a/examples/secondary_index_builtin/secondary_index_fill.cpp b/examples/secondary_index_builtin/secondary_index_fill.cpp index d0f6ce2d12f..75caf27dce4 100644 --- a/examples/secondary_index_builtin/secondary_index_fill.cpp +++ b/examples/secondary_index_builtin/secondary_index_fill.cpp @@ -6,8 +6,8 @@ using namespace NYdb; using namespace NYdb::NTable; -TVector GetSeries() { - TVector series = { +std::vector GetSeries() { + std::vector series = { TSeries(1, "First episode", TInstant::ParseIso8601("2006-01-01"), "Pilot episode.", 1000, 0), TSeries(2, "Second episode", TInstant::ParseIso8601("2006-02-01"), "Jon Snow knows nothing.", 2000, 1), TSeries(3, "Third episode", TInstant::ParseIso8601("2006-03-01"), "Daenerys is the mother of dragons.", 3000, 2), @@ -22,8 +22,8 @@ TVector GetSeries() { return series; } -TVector GetUsers() { - TVector users = { +std::vector GetUsers() { + std::vector users = { TUser(0, "Kit Harrington", 32), TUser(1, "Emilia Clarke", 32), TUser(2, "Jason Momoa", 39), @@ -32,7 +32,7 @@ TVector GetUsers() { return users; } -TParams Build(const TVector& seriesList, const TVector& usersList) { +TParams Build(const std::vector& seriesList, const std::vector& usersList) { TParamsBuilder paramsBuilder; diff --git a/examples/secondary_index_builtin/secondary_index_select.cpp b/examples/secondary_index_builtin/secondary_index_select.cpp index 5d75527f86b..1f2ed559de9 100644 --- a/examples/secondary_index_builtin/secondary_index_select.cpp +++ b/examples/secondary_index_builtin/secondary_index_select.cpp @@ -6,7 +6,7 @@ using namespace NYdb; using namespace NYdb::NTable; using namespace NLastGetopt; -TStatus SelectSeriesWithViews(TSession session, const TString& path, TVector& selectResult, ui64 minViews) { +TStatus SelectSeriesWithViews(TSession session, const TString& path, std::vector& selectResult, ui64 minViews) { auto queryText = Sprintf(R"( --!syntax_v1 PRAGMA TablePathPrefix("%s"); @@ -51,7 +51,7 @@ int Select(TDriver& driver, const TString& path, int argc, char **argv) { TOptsParseResult res(&opts, argc, argv); TTableClient client(driver); - TVector selectResult; + std::vector selectResult; ThrowOnError(client.RetryOperationSync([path, minViews, &selectResult](TSession session) { return SelectSeriesWithViews(session, path, selectResult, minViews); })); diff --git a/examples/secondary_index_builtin/secondary_index_select_join.cpp b/examples/secondary_index_builtin/secondary_index_select_join.cpp index d5f6c8bd2db..5c79fa84cb0 100644 --- a/examples/secondary_index_builtin/secondary_index_select_join.cpp +++ b/examples/secondary_index_builtin/secondary_index_select_join.cpp @@ -7,7 +7,7 @@ using namespace NYdb::NTable; using namespace NLastGetopt; TStatus SelectSeriesWithUserName(TSession session, const TString& path, - TVector& selectResult, const TString& name) { + std::vector& selectResult, const TString& name) { auto queryText = Sprintf(R"( --!syntax_v1 @@ -55,7 +55,7 @@ int SelectJoin(TDriver& driver, const TString& path, int argc, char **argv) { TOptsParseResult res(&opts, argc, argv); TTableClient client(driver); - TVector selectResult; + std::vector selectResult; ThrowOnError(client.RetryOperationSync([path, &selectResult, name](TSession session) { return SelectSeriesWithUserName(session, path, selectResult, name); diff --git a/library/cpp/blockcodecs/codecs_ut.cpp b/library/cpp/blockcodecs/codecs_ut.cpp index bfe5a236909..4d5f0dc1eeb 100644 --- a/library/cpp/blockcodecs/codecs_ut.cpp +++ b/library/cpp/blockcodecs/codecs_ut.cpp @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { } void TestAllAtOnce(size_t n, size_t m) { - TVector datas; + std::vector datas; datas.emplace_back(); datas.push_back(Buffer("na gorshke sidel korol")); @@ -144,7 +144,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { } void TestStreams(size_t n, size_t m) { - TVector datas; + std::vector datas; TString res; for (size_t i = 0; i < 256; ++i) { @@ -274,7 +274,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { UNIT_ASSERT_VALUES_EQUAL(GetMaxPossibleDecompressedLength(), Max()); - TVector input(10001, ' '); + std::vector input(10001, ' '); TCodecList codecs = ListAllCodecs(); SetMaxPossibleDecompressedLength(10000); diff --git a/library/cpp/blockcodecs/core/codecs.cpp b/library/cpp/blockcodecs/core/codecs.cpp index 21506e812b4..3fb0bbad66c 100644 --- a/library/cpp/blockcodecs/core/codecs.cpp +++ b/library/cpp/blockcodecs/core/codecs.cpp @@ -61,7 +61,7 @@ namespace { TDeque Tmp; TNullCodec Null; - TVector Codecs; + std::vector Codecs; typedef THashMap TRegistry; TRegistry Registry; diff --git a/library/cpp/blockcodecs/core/codecs.h b/library/cpp/blockcodecs/core/codecs.h index 9c93c002748..82197e42f65 100644 --- a/library/cpp/blockcodecs/core/codecs.h +++ b/library/cpp/blockcodecs/core/codecs.h @@ -4,7 +4,6 @@ #include #include #include -#include #include namespace NBlockCodecs { @@ -78,7 +77,7 @@ namespace NBlockCodecs { const ICodec* Codec(const TStringBuf& name); // some aux methods - typedef TVector TCodecList; + typedef std::vector TCodecList; TCodecList ListAllCodecs(); TString ListAllCodecsAsString(); diff --git a/library/cpp/cache/cache.h b/library/cpp/cache/cache.h index ee65c30d41c..dcf77cb826f 100644 --- a/library/cpp/cache/cache.h +++ b/library/cpp/cache/cache.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -446,7 +445,7 @@ class TLWList { } private: - TVector Heap; + std::vector Heap; THashSet Removed; size_t Size; diff --git a/library/cpp/cache/ut/cache_ut.cpp b/library/cpp/cache/ut/cache_ut.cpp index 33731988c11..0d2b15a45b0 100644 --- a/library/cpp/cache/ut/cache_ut.cpp +++ b/library/cpp/cache/ut/cache_ut.cpp @@ -490,7 +490,7 @@ Y_UNIT_TEST_SUITE(TThreadSafeCacheUnsafeTest) { Y_UNIT_TEST_SUITE(TThreadSafeLRUCacheTest) { typedef TThreadSafeLRUCache TCache; - TVector Values = {"zero", "one", "two", "three", "four"}; + std::vector Values = {"zero", "one", "two", "three", "four"}; class TCallbacks: public TCache::ICallbacks { public: diff --git a/library/cpp/case_insensitive_string/case_insensitive_string_ut.cpp b/library/cpp/case_insensitive_string/case_insensitive_string_ut.cpp index 49f9c59c95b..7e766b719ab 100644 --- a/library/cpp/case_insensitive_string/case_insensitive_string_ut.cpp +++ b/library/cpp/case_insensitive_string/case_insensitive_string_ut.cpp @@ -55,9 +55,9 @@ Y_UNIT_TEST_SUITE(TCaseInsensitiveStringTestEx) { /* Y_UNIT_TEST(TestSplit) { TCaseInsensitiveStringBuf input("splitAmeAbro"); - TVector expected{"split", "me", "bro"}; + std::vector expected{"split", "me", "bro"}; - TVector split = StringSplitter(input).Split('a'); + std::vector split = StringSplitter(input).Split('a'); UNIT_ASSERT_VALUES_EQUAL(split, expected); } diff --git a/library/cpp/charset/codepage.cpp b/library/cpp/charset/codepage.cpp index d75dbe6b6a4..7117a2f388c 100644 --- a/library/cpp/charset/codepage.cpp +++ b/library/cpp/charset/codepage.cpp @@ -8,7 +8,7 @@ #include #include #include -#include + #include #include #include diff --git a/library/cpp/charset/decodeunknownplane.cpp b/library/cpp/charset/decodeunknownplane.cpp index 201a25cd54b..683f238794a 100644 --- a/library/cpp/charset/decodeunknownplane.cpp +++ b/library/cpp/charset/decodeunknownplane.cpp @@ -3,7 +3,7 @@ #include "recyr.hh" #include -#include + template static inline RECODE_RESULT utf8_read_rune_from_unknown_plane(TxChar& rune, size_t& rune_len, const TxChar* s, const TxChar* end) { @@ -87,7 +87,7 @@ void DoDecodeUnknownPlane(TxChar* str, TxChar*& ee, const ECharset enc) { TxChar* s = str; TxChar* d = str; - TVector buf; + std::vector buf; size_t read = 0; size_t written = 0; diff --git a/library/cpp/charset/iconv.cpp b/library/cpp/charset/iconv.cpp index 0b6dbace9ef..ebd415a8056 100644 --- a/library/cpp/charset/iconv.cpp +++ b/library/cpp/charset/iconv.cpp @@ -20,7 +20,8 @@ TDescriptor::TDescriptor(const char* from, const char* to) TDescriptor::~TDescriptor() { if (!Invalid()) { - iconv_close(Descriptor_); + auto descriptor = static_cast(Descriptor_); + iconv_close(descriptor); } } @@ -33,7 +34,8 @@ size_t NICONVPrivate::RecodeImpl(const TDescriptor& descriptor, const char* in, char* outPtr = out; size_t inSizeMod = inSize; size_t outSizeMod = outSize; - size_t res = iconv(descriptor.Get(), &inPtr, &inSizeMod, &outPtr, &outSizeMod); + auto descr = static_cast(descriptor.Get()); + size_t res = iconv(descr, &inPtr, &inSizeMod, &outPtr, &outSizeMod); read = inSize - inSizeMod; written = outSize - outSizeMod; diff --git a/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp b/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp index c34ed1fd9b4..066e5035ff2 100644 --- a/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp +++ b/library/cpp/containers/intrusive_rb_tree/rb_tree_ut.cpp @@ -51,7 +51,7 @@ class TRedBlackTreeTest: public TTestBase { private: inline void TestStress() { - TVector> nodes; + std::vector> nodes; for (int i = 0; i < 1000; ++i) { nodes.push_back(new TNode(i)); @@ -78,7 +78,7 @@ class TRedBlackTreeTest: public TTestBase { } inline void TestGettingIndexWithDifferentValues() { - TVector> nodes; + std::vector> nodes; size_t N = 1000; for (size_t i = 0; i < N; ++i) { @@ -105,7 +105,7 @@ class TRedBlackTreeTest: public TTestBase { } inline void TestCheckChildrenAfterErase() { - TVector> nodes; + std::vector> nodes; size_t N = 1000; for (size_t i = 0; i < N; ++i) { @@ -138,7 +138,7 @@ class TRedBlackTreeTest: public TTestBase { } inline void TestGettingIndexWithDifferentValuesAfterErase() { - TVector> nodes; + std::vector> nodes; size_t N = 1000; for (size_t i = 0; i < N; ++i) { @@ -176,7 +176,7 @@ class TRedBlackTreeTest: public TTestBase { } inline void TestGettingIndexWithEqualValues() { - TVector> nodes; + std::vector> nodes; size_t N = 1000; for (size_t i = 0; i < N; ++i) { diff --git a/library/cpp/containers/paged_vector/paged_vector.h b/library/cpp/containers/paged_vector/paged_vector.h index 0fe1660763f..e92dc7a7953 100644 --- a/library/cpp/containers/paged_vector/paged_vector.h +++ b/library/cpp/containers/paged_vector/paged_vector.h @@ -147,7 +147,7 @@ namespace std { namespace NPagedVector { //2-level radix tree template - class TPagedVector: private TVector>, A> { + class TPagedVector: TVector>, A> { static_assert(PageSize, "expect PageSize"); typedef TVector TPage; diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h index b6036059b26..2224d1ce398 100644 --- a/library/cpp/containers/stack_vector/stack_vec.h +++ b/library/cpp/containers/stack_vector/stack_vec.h @@ -1,13 +1,13 @@ #pragma once -#include +#include #include #include // A vector preallocated on the stack. // After exceeding the preconfigured stack space falls back to the heap. -// Publicly inherits TVector, but disallows swap (and hence shrink_to_fit, also operator= is reimplemented via copying). +// Publicly inherits std::vector, but disallows swap (and hence shrink_to_fit, also operator= is reimplemented via copying). // // Inspired by: http://qt-project.org/doc/qt-4.8/qvarlengtharray.html#details @@ -93,9 +93,9 @@ namespace NPrivate { } template -class TStackVec: public TVector>> { +class TStackVec: public std::vector>> { private: - using TBase = TVector>>; + using TBase = std::vector>>; using TAllocator = typename TBase::allocator_type; public: @@ -137,7 +137,7 @@ class TStackVec: public TVector - TStackVec(const TVector& src) + TStackVec(const std::vector& src) : TStackVec(src.begin(), src.end()) { } @@ -151,9 +151,9 @@ class TStackVec: public TVector) { @@ -177,7 +177,7 @@ class TStackVec: public TVector - TStackVec& operator=(const TVector& src) { + TStackVec& operator=(const std::vector& src) { TBase::assign(src.begin(), src.end()); return *this; } diff --git a/library/cpp/coroutine/engine/coroutine_ut.cpp b/library/cpp/coroutine/engine/coroutine_ut.cpp index de56d0ed2bb..4f579d0fbcc 100644 --- a/library/cpp/coroutine/engine/coroutine_ut.cpp +++ b/library/cpp/coroutine/engine/coroutine_ut.cpp @@ -160,7 +160,7 @@ void TCoroTest::TestSimpleX1() { } void TCoroTest::TestSimpleX1MultiThread() { - TVector> threads; + std::vector> threads; const size_t nThreads = 0; TAtomic c = 0; for (size_t i = 0; i < nThreads; ++i) { diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp index 4669828a07e..1983e91f405 100644 --- a/library/cpp/coroutine/engine/poller.cpp +++ b/library/cpp/coroutine/engine/poller.cpp @@ -306,7 +306,7 @@ namespace { private: typedef TIndexedArray TFds; TFds S_; - typedef TVector TPollVec; + typedef std::vector TPollVec; TPollVec T_; }; diff --git a/library/cpp/coroutine/engine/poller.h b/library/cpp/coroutine/engine/poller.h index 6116a604a6f..2d6b22e4bd3 100644 --- a/library/cpp/coroutine/engine/poller.h +++ b/library/cpp/coroutine/engine/poller.h @@ -1,7 +1,7 @@ #pragma once #include -#include + #include #include #include @@ -28,7 +28,7 @@ class IPollerFace { ui16 Filter; }; - using TEvents = TVector; + using TEvents = std::vector; virtual ~IPollerFace() { } diff --git a/library/cpp/coroutine/engine/sockmap.h b/library/cpp/coroutine/engine/sockmap.h index fd189e17746..2480123688f 100644 --- a/library/cpp/coroutine/engine/sockmap.h +++ b/library/cpp/coroutine/engine/sockmap.h @@ -1,7 +1,7 @@ #pragma once #include -#include + template class TSocketMap { @@ -19,6 +19,6 @@ class TSocketMap { } private: - TVector V_; + std::vector V_; THashMap H_; }; diff --git a/library/cpp/coroutine/engine/stack/benchmark/alloc_bm.cpp b/library/cpp/coroutine/engine/stack/benchmark/alloc_bm.cpp index 6573dd0dc98..c6e785f4373 100644 --- a/library/cpp/coroutine/engine/stack/benchmark/alloc_bm.cpp +++ b/library/cpp/coroutine/engine/stack/benchmark/alloc_bm.cpp @@ -1,6 +1,6 @@ #include -#include + #include #include @@ -122,7 +122,7 @@ namespace NCoro::NStack::NBenchmark { TPoolAllocatorSettings settings; settings.StacksPerChunk = state.range(2); auto allocator = GetAllocator(settings, (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -143,7 +143,7 @@ namespace NCoro::NStack::NBenchmark { static void BM_DefaultAllocatorManyStacks(benchmark::State& state) { auto allocator = GetAllocator(Nothing(), (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -163,7 +163,7 @@ namespace NCoro::NStack::NBenchmark { TPoolAllocatorSettings settings; settings.StacksPerChunk = state.range(2); auto allocator = GetAllocator(settings, (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -185,7 +185,7 @@ namespace NCoro::NStack::NBenchmark { static void BM_DefaultAllocatorManyStacksReleased(benchmark::State& state) { auto allocator = GetAllocator(Nothing(), (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -206,7 +206,7 @@ namespace NCoro::NStack::NBenchmark { TPoolAllocatorSettings settings; settings.StacksPerChunk = state.range(2); auto allocator = GetAllocator(settings, (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -236,7 +236,7 @@ namespace NCoro::NStack::NBenchmark { static void BM_DefaultAllocatorManyStacksReleasedAndRealloc(benchmark::State& state) { auto allocator = GetAllocator(Nothing(), (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -261,7 +261,7 @@ namespace NCoro::NStack::NBenchmark { TPoolAllocatorSettings settings; settings.StacksPerChunk = state.range(2); auto allocator = GetAllocator(settings, (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { @@ -291,7 +291,7 @@ namespace NCoro::NStack::NBenchmark { static void BM_DefaultAllocatorManyStacksMemoryWriteReleasedAndRealloc(benchmark::State& state) { auto allocator = GetAllocator(Nothing(), (EGuard)state.range(0)); - TVector stacks; // store stacks during benchmark + std::vector stacks; // store stacks during benchmark stacks.reserve(ManyStacks); for (auto _ : state) { for (size_t i = 0; i < ManyStacks; ++i) { diff --git a/library/cpp/coroutine/engine/stack/stack_pool.h b/library/cpp/coroutine/engine/stack/stack_pool.h index d9b38e0ac34..400cc846d0b 100644 --- a/library/cpp/coroutine/engine/stack/stack_pool.h +++ b/library/cpp/coroutine/engine/stack/stack_pool.h @@ -5,7 +5,7 @@ #include #include -#include + namespace NCoro::NStack { @@ -42,7 +42,7 @@ namespace NCoro::NStack { const size_t StackSize_ = 0; size_t RssPagesToKeep_ = 0; const TGuard& Guard_; - TVector Memory_; // memory chunks + std::vector Memory_; // memory chunks THolder Storage_; char* NextToAlloc_ = nullptr; // points to next available stack in the last memory chunk const size_t ChunkSize_ = 0; diff --git a/library/cpp/dbg_output/dumpers.h b/library/cpp/dbg_output/dumpers.h index 86f14849105..66d4e3a940a 100644 --- a/library/cpp/dbg_output/dumpers.h +++ b/library/cpp/dbg_output/dumpers.h @@ -90,10 +90,6 @@ struct TDumper> { }; //sequences -template -struct TDumper>: public TSeqDumper { -}; - template struct TDumper>: public TSeqDumper { }; diff --git a/library/cpp/dbg_output/ut/dbg_output_ut.cpp b/library/cpp/dbg_output/ut/dbg_output_ut.cpp index 7b285c84cb7..e6501d46f55 100644 --- a/library/cpp/dbg_output/ut/dbg_output_ut.cpp +++ b/library/cpp/dbg_output/ut/dbg_output_ut.cpp @@ -34,7 +34,7 @@ DEFINE_DUMPER(TMyNS::TMyStruct, A, B) Y_UNIT_TEST_SUITE(TContainerPrintersTest) { Y_UNIT_TEST(TestVectorInt) { TStringStream out; - out << DbgDump(TVector({1, 2, 3, 4, 5})); + out << DbgDump(std::vector({1, 2, 3, 4, 5})); UNIT_ASSERT_STRINGS_EQUAL(out.Str(), "[1, 2, 3, 4, 5]"); } @@ -53,7 +53,7 @@ Y_UNIT_TEST_SUITE(TContainerPrintersTest) { Y_UNIT_TEST(TestVectorOfVectors) { TStringStream out; - TVector> vec(2); + std::vector> vec(2); vec[0].push_back(0); vec[1] = {wchar16('a')}; out << DbgDump(vec); diff --git a/library/cpp/diff/diff.cpp b/library/cpp/diff/diff.cpp index be57da7f396..64d5b69548c 100644 --- a/library/cpp/diff/diff.cpp +++ b/library/cpp/diff/diff.cpp @@ -7,8 +7,8 @@ template struct TCollectionImpl { - TVector> Words; - TVector Keys; + std::vector> Words; + std::vector Keys; inline bool Consume(const T* b, const T* e, const T*) { if (b < e) { @@ -58,13 +58,13 @@ struct TCollection: public TCollectionImpl { } }; -size_t NDiff::InlineDiff(TVector>& chunks, const TStringBuf& left, const TStringBuf& right, const TString& delims) { +size_t NDiff::InlineDiff(std::vector>& chunks, const TStringBuf& left, const TStringBuf& right, const TString& delims) { if (delims.empty()) { return InlineDiff(chunks, TConstArrayRef(left.data(), left.size()), TConstArrayRef(right.data(), right.size())); } TCollection c1(left, delims); TCollection c2(right, delims); - TVector> diff; + std::vector> diff; const size_t dist = InlineDiff(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk(c1.Remap(it.Left), c2.Remap(it.Right), c1.Remap(it.Common))); @@ -72,13 +72,13 @@ size_t NDiff::InlineDiff(TVector>& chunks, const TStringBuf& left, return dist; } -size_t NDiff::InlineDiff(TVector>& chunks, const TWtringBuf& left, const TWtringBuf& right, const TUtf16String& delims) { +size_t NDiff::InlineDiff(std::vector>& chunks, const TWtringBuf& left, const TWtringBuf& right, const TUtf16String& delims) { if (delims.empty()) { return InlineDiff(chunks, TConstArrayRef(left.data(), left.size()), TConstArrayRef(right.data(), right.size())); } TCollection c1(left, delims); TCollection c2(right, delims); - TVector> diff; + std::vector> diff; const size_t dist = InlineDiff(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk(c1.Remap(it.Left), c2.Remap(it.Right), c1.Remap(it.Common))); diff --git a/library/cpp/diff/diff.h b/library/cpp/diff/diff.h index 94fb00cd0b3..6fb4810207d 100644 --- a/library/cpp/diff/diff.h +++ b/library/cpp/diff/diff.h @@ -5,7 +5,7 @@ #include #include #include -#include + #include #include @@ -27,7 +27,7 @@ namespace NDiff { }; template - size_t InlineDiff(TVector>& chunks, const TConstArrayRef& left, const TConstArrayRef& right) { + size_t InlineDiff(std::vector>& chunks, const TConstArrayRef& left, const TConstArrayRef& right) { TConstArrayRef s1(left); TConstArrayRef s2(right); @@ -39,7 +39,7 @@ namespace NDiff { swapped = true; } - TVector lcs; + std::vector lcs; NLCS::TLCSCtx ctx; NLCS::MakeLCS(s1, s2, &lcs, &ctx); @@ -91,8 +91,8 @@ namespace NDiff { } template - void PrintChunks(IOutputStream& out, const TFormatter& fmt, const TVector>& chunks) { - for (typename TVector>::const_iterator chunk = chunks.begin(); chunk != chunks.end(); ++chunk) { + void PrintChunks(IOutputStream& out, const TFormatter& fmt, const std::vector>& chunks) { + for (typename std::vector>::const_iterator chunk = chunks.begin(); chunk != chunks.end(); ++chunk) { if (!chunk->Left.empty() || !chunk->Right.empty()) { out << fmt.Special("("); out << fmt.Left(chunk->Left); @@ -106,7 +106,7 @@ namespace NDiff { // Without delimiters calculates character-wise diff // With delimiters calculates token-wise diff - size_t InlineDiff(TVector>& chunks, const TStringBuf& left, const TStringBuf& right, const TString& delims = TString()); - size_t InlineDiff(TVector>& chunks, const TWtringBuf& left, const TWtringBuf& right, const TUtf16String& delims = TUtf16String()); + size_t InlineDiff(std::vector>& chunks, const TStringBuf& left, const TStringBuf& right, const TString& delims = TString()); + size_t InlineDiff(std::vector>& chunks, const TWtringBuf& left, const TWtringBuf& right, const TUtf16String& delims = TUtf16String()); } diff --git a/library/cpp/diff/diff_ut.cpp b/library/cpp/diff/diff_ut.cpp index b82a7b000ee..9cdd6304215 100644 --- a/library/cpp/diff/diff_ut.cpp +++ b/library/cpp/diff/diff_ut.cpp @@ -6,7 +6,7 @@ using namespace NDiff; struct TDiffTester { TStringStream Res; - TVector> Chunks; + std::vector> Chunks; TStringBuf Special(const TStringBuf& str) const { return str; @@ -38,7 +38,7 @@ struct TDiffTester { Y_UNIT_TEST_SUITE(DiffTokens) { Y_UNIT_TEST(ReturnValue) { - TVector> res; + std::vector> res; UNIT_ASSERT_VALUES_EQUAL(InlineDiff(res, "aaa", "aaa"), 0); UNIT_ASSERT_VALUES_EQUAL(InlineDiff(res, "aaa", "aa"), 1); UNIT_ASSERT_VALUES_EQUAL(InlineDiff(res, "aaa", "a"), 2); diff --git a/library/cpp/getopt/last_getopt_demo/demo.cpp b/library/cpp/getopt/last_getopt_demo/demo.cpp index a0e82a936cd..e10020abeaa 100644 --- a/library/cpp/getopt/last_getopt_demo/demo.cpp +++ b/library/cpp/getopt/last_getopt_demo/demo.cpp @@ -41,7 +41,7 @@ class TMain: public TMainClassArgs { TString UserAgent_; TMaybe PostData_; TMaybe PostFile_; - TVector Headers_; + std::vector Headers_; protected: void RegisterOptions(NLastGetopt::TOpts& opts) override { diff --git a/library/cpp/getopt/small/completer.cpp b/library/cpp/getopt/small/completer.cpp index 43ceabe25b3..b52eac505b6 100644 --- a/library/cpp/getopt/small/completer.cpp +++ b/library/cpp/getopt/small/completer.cpp @@ -46,7 +46,7 @@ namespace NLastGetopt::NComp { class TAlternativeCompleter: public ICompleter { public: - TAlternativeCompleter(TVector alternatives) + TAlternativeCompleter(std::vector alternatives) : Alternatives_(std::move(alternatives)) { } @@ -96,10 +96,10 @@ namespace NLastGetopt::NComp { } private: - TVector Alternatives_; + std::vector Alternatives_; }; - ICompleterPtr Alternative(TVector alternatives) { + ICompleterPtr Alternative(std::vector alternatives) { return MakeSimpleShared(std::move(alternatives)); } @@ -130,7 +130,7 @@ namespace NLastGetopt::NComp { TString Action; }; - ICompleterPtr Choice(TVector choices) { + ICompleterPtr Choice(std::vector choices) { auto bash = TStringBuilder() << "COMPREPLY+=( $(compgen -W '"; TStringBuf sep = ""; for (auto& choice : choices) { diff --git a/library/cpp/getopt/small/completer.h b/library/cpp/getopt/small/completer.h index 20f190c41af..1d4b4f6d439 100644 --- a/library/cpp/getopt/small/completer.h +++ b/library/cpp/getopt/small/completer.h @@ -24,7 +24,7 @@ namespace NLastGetopt::NComp { private: TStringBuf Command_; size_t Id_; - TVector> Queue_; + std::vector> Queue_; }; class ICompleter { @@ -74,7 +74,7 @@ namespace NLastGetopt::NComp { /// Run multiple completers and unite their output. /// Each completer's output placed in a separate group with its own description. - ICompleterPtr Alternative(TVector alternatives); + ICompleterPtr Alternative(std::vector alternatives); struct TChoice { /// Option value. @@ -96,7 +96,7 @@ namespace NLastGetopt::NComp { }; /// Complete items from a predefined list of choices. - ICompleterPtr Choice(TVector choices); + ICompleterPtr Choice(std::vector choices); /// Complete files and directories. May filter results by pattern, e.g. `*.txt`. ICompleterPtr File(TString pattern= ""); diff --git a/library/cpp/getopt/small/formatted_output.h b/library/cpp/getopt/small/formatted_output.h index 6fd16b73f9c..258e1076d72 100644 --- a/library/cpp/getopt/small/formatted_output.h +++ b/library/cpp/getopt/small/formatted_output.h @@ -1,9 +1,9 @@ #pragma once #include -#include #include #include +#include namespace NLastGetopt { /// Utility for printing indented lines. Used by completion generators. @@ -27,6 +27,6 @@ namespace NLastGetopt { private: int IndentLevel_ = 0; - TVector> Lines_; + std::vector> Lines_; }; } diff --git a/library/cpp/getopt/small/last_getopt_opt.cpp b/library/cpp/getopt/small/last_getopt_opt.cpp index 9c53312de8b..b560e55b43c 100644 --- a/library/cpp/getopt/small/last_getopt_opt.cpp +++ b/library/cpp/getopt/small/last_getopt_opt.cpp @@ -98,7 +98,7 @@ namespace NLastGetopt { } TOpt& TOpt::IfPresentDisableCompletionFor(const TOpt& opt) { - if (opt.GetLongNames()) { + if (!opt.GetLongNames().empty()) { IfPresentDisableCompletionFor(opt.GetName()); } else { IfPresentDisableCompletionFor(opt.GetChar()); diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h index 8754ebb7eeb..9fafddac778 100644 --- a/library/cpp/getopt/small/last_getopt_opt.h +++ b/library/cpp/getopt/small/last_getopt_opt.h @@ -8,7 +8,7 @@ #include #include #include -#include + #include #include @@ -45,8 +45,8 @@ namespace NLastGetopt { */ class TOpt { public: - typedef TVector TShortNames; - typedef TVector TLongNames; + typedef std::vector TShortNames; + typedef std::vector TLongNames; protected: TShortNames Chars_; @@ -54,7 +54,7 @@ namespace NLastGetopt { private: typedef TMaybe TdOptVal; - typedef TVector> TOptHandlers; + typedef std::vector> TOptHandlers; public: bool Hidden_ = false; // is visible in help @@ -73,7 +73,7 @@ namespace NLastGetopt { bool DisableCompletionForFreeArgs_ = false; TShortNames DisableCompletionForChar_; TLongNames DisableCompletionForLongName_; - TVector DisableCompletionForFreeArg_; + std::vector DisableCompletionForFreeArg_; NComp::ICompleterPtr Completer_; private: @@ -728,7 +728,7 @@ namespace NLastGetopt { // Emplaces TString arg to *target for each argument template - TOpt& EmplaceTo(TVector* target) { + TOpt& EmplaceTo(std::vector* target) { return Handler1T([target](TString arg) { target->emplace_back(std::move(arg)); } ); } @@ -770,7 +770,7 @@ namespace NLastGetopt { }); } - TOpt& Choices(TVector choices) { + TOpt& Choices(std::vector choices) { return Choices( THashSet{ std::make_move_iterator(choices.begin()), @@ -778,7 +778,7 @@ namespace NLastGetopt { }); } - TOpt& ChoicesWithCompletion(TVector choices) { + TOpt& ChoicesWithCompletion(std::vector choices) { Completer(NComp::Choice(choices)); THashSet choicesSet; choicesSet.reserve(choices.size()); diff --git a/library/cpp/getopt/small/last_getopt_opts.cpp b/library/cpp/getopt/small/last_getopt_opts.cpp index 984927a0387..f49ec9ca9f7 100644 --- a/library/cpp/getopt/small/last_getopt_opts.cpp +++ b/library/cpp/getopt/small/last_getopt_opts.cpp @@ -369,8 +369,8 @@ namespace NLastGetopt { PrintCmdLine(program, os, colors); - TVector leftColumn(Opts_.size()); - TVector leftColumnSizes(leftColumn.size()); + std::vector leftColumn(Opts_.size()); + std::vector leftColumnSizes(leftColumn.size()); const size_t kMaxLeftWidth = 25; size_t leftWidth = 0; size_t requiredOptionsCount = 0; diff --git a/library/cpp/getopt/small/last_getopt_opts.h b/library/cpp/getopt/small/last_getopt_opts.h index 718dbfcb893..b32c48a3deb 100644 --- a/library/cpp/getopt/small/last_getopt_opts.h +++ b/library/cpp/getopt/small/last_getopt_opts.h @@ -41,9 +41,9 @@ namespace NLastGetopt { public: static constexpr const ui32 UNLIMITED_ARGS = Max(); - typedef TVector> TOptsVector; + typedef std::vector> TOptsVector; TOptsVector Opts_; // infomation about named (short and long) options - TVector> ArgBindings_; + std::vector> ArgBindings_; EArgPermutation ArgPermutation_ = DEFAULT_ARG_PERMUTATION; // determines how to parse positions of named and free options. See information below. bool AllowSingleDashForLong_ = false; // @@ -68,7 +68,7 @@ namespace NLastGetopt { TString CustomCmdLineDescr; // user defined help string TString CustomUsage; // user defined usage string - TVector> Sections; // additional help entries to print after usage + std::vector> Sections; // additional help entries to print after usage public: /** @@ -615,8 +615,9 @@ namespace NLastGetopt { /** * Get list of options in order of definition. */ - TVector GetOpts() const { - auto ret = TVector(Reserve(Opts_.size())); + std::vector GetOpts() const { + std::vector ret; + ret.reserve(Opts_.size()); for (auto& opt : Opts_) { ret.push_back(opt.Get()); } diff --git a/library/cpp/getopt/small/last_getopt_parse_result.cpp b/library/cpp/getopt/small/last_getopt_parse_result.cpp index 60effba41b4..3585735586d 100644 --- a/library/cpp/getopt/small/last_getopt_parse_result.cpp +++ b/library/cpp/getopt/small/last_getopt_parse_result.cpp @@ -107,8 +107,8 @@ namespace NLastGetopt { return Parser_->Pos_; } - TVector TOptsParseResult::GetFreeArgs() const { - TVector v; + std::vector TOptsParseResult::GetFreeArgs() const { + std::vector v; for (size_t i = GetFreeArgsPos(); i < Parser_->Argc_; ++i) { v.push_back(Parser_->Argv_[i]); } @@ -152,7 +152,7 @@ namespace NLastGetopt { } if (options->CheckUserTypos_) { - for (auto arg: TVector(argv, std::next(argv, argc))) { + for (auto arg: std::vector(argv, std::next(argv, argc))) { FindUserTypos(arg, options); } } diff --git a/library/cpp/getopt/small/last_getopt_parse_result.h b/library/cpp/getopt/small/last_getopt_parse_result.h index c6e768c4617..07808f7a409 100644 --- a/library/cpp/getopt/small/last_getopt_parse_result.h +++ b/library/cpp/getopt/small/last_getopt_parse_result.h @@ -12,7 +12,7 @@ namespace NLastGetopt { */ class TOptParseResult { public: - typedef TVector TValues; + typedef std::vector TValues; public: TOptParseResult(const TOpt* opt = nullptr) @@ -69,7 +69,7 @@ namespace NLastGetopt { THolder Parser_; //The instance of parser. // XXX: make argc, argv - typedef TVector TdVec; + typedef std::vector TdVec; TdVec Opts_; //Parsing result for all options, that have been explicitly defined in argc/argv TdVec OptsDef_; //Parsing result for options, that have been defined by default values only @@ -180,7 +180,7 @@ namespace NLastGetopt { /** * @return all fetched free arguments */ - TVector GetFreeArgs() const; + std::vector GetFreeArgs() const; /** * @return true if given option exist in results of parsing diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp index 911c76f3425..797d8fa0731 100644 --- a/library/cpp/getopt/small/last_getopt_parser.cpp +++ b/library/cpp/getopt/small/last_getopt_parser.cpp @@ -333,8 +333,8 @@ namespace NLastGetopt { if (optvec.size() == OptsSeen_.size()) return; - TVector missingLong; - TVector missingShort; + std::vector missingLong; + std::vector missingShort; TOpts::TOptsVector::const_iterator it; for (it = optvec.begin(); it != optvec.end(); ++it) { diff --git a/library/cpp/getopt/small/last_getopt_support.h b/library/cpp/getopt/small/last_getopt_support.h index 17bed3e614e..9782e561344 100644 --- a/library/cpp/getopt/small/last_getopt_support.h +++ b/library/cpp/getopt/small/last_getopt_support.h @@ -2,7 +2,7 @@ #include #include -#include + #include #include diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index bc319089b7c..0d861c08b20 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -34,7 +34,7 @@ class PtrvWrapper: public TMainClass { } int operator()(const int argc, const char** argv) override { - TVector nargv(argv, argv + argc); + std::vector nargv(argv, argv + argc); return Main(nargv); } @@ -50,7 +50,7 @@ class ClassWrapper: public TMainClass { } int operator()(const int argc, const char** argv) override { - TVector nargv(argv, argv + argc); + std::vector nargv(argv, argv + argc); return (*Main)(nargv); } @@ -204,7 +204,8 @@ int TModChooser::Run(const int argc, const char** argv) const { if (shiftArgs) { TString firstArg; - TVector nargv(Reserve(argc)); + std::vector nargv; + nargv.reserve(argc); if (PrintShortCommandInUsage) { firstArg = modeIter->second->Name; @@ -227,8 +228,9 @@ int TModChooser::Run(const int argc, const char** argv) const { } } -int TModChooser::Run(const TVector& argv) const { - TVector nargv(Reserve(argv.size() + 1)); +int TModChooser::Run(const std::vector& argv) const { + std::vector nargv; + nargv.reserve(argv.size() + 1); for (auto& arg : argv) { nargv.push_back(arg.c_str()); } @@ -241,7 +243,7 @@ int TModChooser::Run(const TVector& argv) const { size_t TModChooser::TMode::CalculateFullNameLen() const { size_t len = Name.size(); - if (Aliases) { + if (!Aliases.empty()) { len += 2; for (auto& alias : Aliases) { len += alias.size() + 1; @@ -252,7 +254,7 @@ size_t TModChooser::TMode::CalculateFullNameLen() const { TString TModChooser::TMode::FormatFullName(size_t pad) const { TStringBuilder name; - if (Aliases) { + if (!Aliases.empty()) { name << "{"; } @@ -260,7 +262,7 @@ TString TModChooser::TMode::FormatFullName(size_t pad) const { name << Name; name << NColorizer::StdErr().OldColor(); - if (Aliases) { + if (!Aliases.empty()) { for (const auto& alias : Aliases) { name << "|" << NColorizer::StdErr().GreenColor() << alias << NColorizer::StdErr().OldColor(); } diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index 5ed64310c5a..a88f5b92efa 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -4,13 +4,13 @@ #include #include -#include + #include //! Mode function with vector of cli arguments. -using TMainFunctionPtrV = std::function&)> ; -using TMainFunctionRawPtrV = int (*)(const TVector& argv); +using TMainFunctionPtrV = std::function&)> ; +using TMainFunctionRawPtrV = int (*)(const std::vector& argv); //! Mode function with classic argc and argv arguments. using TMainFunctionPtr = std::function ; @@ -19,7 +19,7 @@ using TMainFunctionRawPtr = int (*)(const int argc, const char** argv); //! Mode class with vector of cli arguments. class TMainClassV { public: - virtual int operator()(const TVector& argv) = 0; + virtual int operator()(const std::vector& argv) = 0; virtual ~TMainClassV() = default; }; @@ -103,7 +103,7 @@ class TModChooser { int Run(int argc, const char** argv) const; //! Run appropriate mode. Same as Run(const int, const char**) - int Run(const TVector& argv) const; + int Run(const std::vector& argv) const; void PrintHelp(const TString& progName, bool toStdErr = false) const; @@ -113,7 +113,7 @@ class TModChooser { TString Description; bool Hidden; bool NoCompletion; - TVector Aliases; + std::vector Aliases; TMode() : Main(nullptr) @@ -127,8 +127,9 @@ class TModChooser { TString FormatFullName(size_t pad) const; }; - TVector GetUnsortedModes() const { - auto ret = TVector(Reserve(UnsortedModes.size())); + std::vector GetUnsortedModes() const { + std::vector ret; + ret.reserve(UnsortedModes.size()); for (auto& mode : UnsortedModes) { ret.push_back(mode.Get()); } @@ -147,7 +148,7 @@ class TModChooser { TString ModesHelpOption; //! Wrappers around all modes. - TVector> Wrappers; + std::vector> Wrappers; //! Modes TMap Modes; @@ -170,7 +171,7 @@ class TModChooser { TString SeparationString; //! Unsorted list of options - TVector> UnsortedModes; + std::vector> UnsortedModes; //! Mode that generates completions THolder CompletionsGenerator; diff --git a/library/cpp/getopt/small/opt.h b/library/cpp/getopt/small/opt.h index ecb57439bcf..e6cb338969d 100644 --- a/library/cpp/getopt/small/opt.h +++ b/library/cpp/getopt/small/opt.h @@ -93,7 +93,7 @@ class Opt : TNonCopyable { return Arg; } - TVector GetFreeArgs() const { + std::vector GetFreeArgs() const { return NLastGetopt::TOptsParseResult(&*Opts_, GetArgC(), GetArgV()).GetFreeArgs(); } diff --git a/library/cpp/getopt/small/opt2.cpp b/library/cpp/getopt/small/opt2.cpp index 0cdc774e788..9596561f2d6 100644 --- a/library/cpp/getopt/small/opt2.cpp +++ b/library/cpp/getopt/small/opt2.cpp @@ -198,7 +198,7 @@ const char* Opt2::Arg(char opt, const char* help, TString def, bool required) { } // Options with parameters that can be specified several times -const TVector& Opt2::MArg(char opt, const char* help) { +const std::vector& Opt2::MArg(char opt, const char* help) { Opt2Param& p = GetInternal(opt, nullptr, help, false); p.MultipleUse = true; if (!p.HasArg) diff --git a/library/cpp/getopt/small/opt2.h b/library/cpp/getopt/small/opt2.h index 4d9d9432372..40282f258e2 100644 --- a/library/cpp/getopt/small/opt2.h +++ b/library/cpp/getopt/small/opt2.h @@ -2,7 +2,7 @@ #include #include -#include +#include // simplified options parser // No 'optional argument' (e.g. "a::" in spec.) support; @@ -33,7 +33,7 @@ struct Opt2Param { const char* DefValue; TString DefValueStr; TString HelpUsage; - TVector ActualValue; + std::vector ActualValue; const char* LongOptName; Opt2Param() : HasArg(false) @@ -90,7 +90,7 @@ class Opt2 { const char* Arg(char opt, const char* helpUsage, TString defValue, bool required = false); // Options with parameters that can be specified several times - const TVector& MArg(char opt, const char* helpUsage); + const std::vector& MArg(char opt, const char* helpUsage); // Get() + strtol, may set up HasErrors long Int(char opt, const char* helpUsage, long defValue, bool required = false); @@ -112,7 +112,7 @@ class Opt2 { public: // non-option args - TVector Pos; + std::vector Pos; bool HasErrors; private: @@ -122,14 +122,14 @@ class Opt2 { char OptionMissingArg; char OptionWrongArg; char RequiredOptionMissing; - TVector UserErrorMessages; + std::vector UserErrorMessages; protected: int Argc; char* const* Argv; int MinArgs, MaxArgs; ui8 SpecsMap[256]; - TVector Specs; + std::vector Specs; TString alias_copy; void EatArgv(const char* optspec, const char* long_alias); void Clear(); diff --git a/library/cpp/getopt/small/ygetopt.cpp b/library/cpp/getopt/small/ygetopt.cpp index 1f52827f742..80aa3dd16bf 100644 --- a/library/cpp/getopt/small/ygetopt.cpp +++ b/library/cpp/getopt/small/ygetopt.cpp @@ -2,7 +2,7 @@ #include "ygetopt.h" #include -#include + #include class TGetOpt::TImpl: public TSimpleRefCount { @@ -18,7 +18,7 @@ class TGetOpt::TImpl: public TSimpleRefCount { inline ~TImpl() = default; - TVector args; + std::vector args; const TString format; }; @@ -59,7 +59,7 @@ class TGetOpt::TIterator::TIterImpl: public TSimpleRefCount { } private: - TVector Args_; + std::vector Args_; TArrayHolder ArgsPtrs_; const TString Format_; THolder Opt_; diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index b517ea359d2..8ededc1cac7 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -19,22 +19,22 @@ namespace { }; class TOptsParseResultTestWrapper: public TOptsParseResultException { - TVector Argv_; + std::vector Argv_; public: - TOptsParseResultTestWrapper(const TOpts* opts, TVector argv) + TOptsParseResultTestWrapper(const TOpts* opts, std::vector argv) : Argv_(argv) { Init(opts, (int)Argv_.size(), Argv_.data()); } }; - using V = TVector; + using V = std::vector; } struct TOptsParserTester { TOptsNoDefault Opts_; - TVector Argv_; + std::vector Argv_; THolder Parser_; @@ -517,7 +517,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { Y_UNIT_TEST(TestSplitValue) { TOptsNoDefault opts; - TVector vals; + std::vector vals; opts.AddLongOption('s', "split").SplitHandler(&vals, ','); TOptsParseResultTestWrapper r(&opts, V({"prog", "--split=a,b,c"})); UNIT_ASSERT_EQUAL(vals.size(), 3); @@ -528,7 +528,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { Y_UNIT_TEST(TestRangeSplitValue) { TOptsNoDefault opts; - TVector vals; + std::vector vals; opts.AddLongOption('s', "split").RangeSplitHandler(&vals, ',', '-'); TOptsParseResultTestWrapper r(&opts, V({"prog", "--split=1,8-10", "--split=12-14"})); UNIT_ASSERT_EQUAL(vals.size(), 7); @@ -717,10 +717,10 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { SubstGlobal(printed, TString(colors.CyanColor()), ""); SubstGlobal(printed, TString(colors.OldColor()), ""); } - TVector lines; + std::vector lines; StringSplitter(printed).Split('\n').SkipEmpty().Collect(&lines); UNIT_ASSERT(!lines.empty()); - TVector indents; + std::vector indents; for (const TString& line : lines) { const size_t indent = line.find("description "); if (indent != TString::npos) @@ -735,7 +735,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } Y_UNIT_TEST(TestAppendTo) { - TVector ints; + std::vector ints; std::vector strings; TOptsNoDefault opts; @@ -754,7 +754,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } Y_UNIT_TEST(TestEmplaceTo) { - TVector> richPaths; + std::vector> richPaths; TOptsNoDefault opts; opts.AddLongOption("path").EmplaceTo(&richPaths); diff --git a/library/cpp/getopt/ut/modchooser_ut.cpp b/library/cpp/getopt/ut/modchooser_ut.cpp index a14c8a58535..f5f00ce9f2c 100644 --- a/library/cpp/getopt/ut/modchooser_ut.cpp +++ b/library/cpp/getopt/ut/modchooser_ut.cpp @@ -53,9 +53,9 @@ Y_UNIT_TEST_SUITE(TModChooserTest) { UNIT_ASSERT_EQUAL(static_cast(idx) + 1, chooser.Run(argc, argv)); } - // test TVector argv + // test std::vector argv for (size_t idx = 0; idx < Y_ARRAY_SIZE(NAMES); ++idx) { - const TVector argv = {"UNITTEST", NAMES[idx]}; + const std::vector argv = {"UNITTEST", NAMES[idx]}; UNIT_ASSERT_EQUAL(static_cast(idx) + 1, chooser.Run(argv)); } } diff --git a/library/cpp/getopt/ut/opt2_ut.cpp b/library/cpp/getopt/ut/opt2_ut.cpp index 0e7464747cb..ab5b24a69ba 100644 --- a/library/cpp/getopt/ut/opt2_ut.cpp +++ b/library/cpp/getopt/ut/opt2_ut.cpp @@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(Opt2Test) { bool c = opt.Has('c', "usage of -c"); int d = opt.Int('d', " - usage of -d", 13); const char* e = opt.Arg('e', " - only default is really used", edef); - const TVector& x = opt.MArg('x', " - usage of -x"); + const std::vector& x = opt.MArg('x', " - usage of -x"); UNIT_ASSERT(!opt.AutoUsage(" ")); UNIT_ASSERT_VALUES_EQUAL("aaaa", a); diff --git a/library/cpp/http/fetch/httpfsm_ut.cpp b/library/cpp/http/fetch/httpfsm_ut.cpp index b018e80101b..cfe78b33b76 100644 --- a/library/cpp/http/fetch/httpfsm_ut.cpp +++ b/library/cpp/http/fetch/httpfsm_ut.cpp @@ -495,7 +495,7 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) { return parser; } - static THttpChunkParser parseByteByByte(const TStringBuf& blob, const TVector& states) { + static THttpChunkParser parseByteByByte(const TStringBuf& blob, const std::vector& states) { UNIT_ASSERT(states.size() <= blob.size()); THttpChunkParser parser{initParser()}; for (size_t n = 0; n < states.size(); n++) { @@ -508,7 +508,7 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) { } static THttpChunkParser parseBytesWithLastState(const TStringBuf& blob, const int last_state) { - TVector states(blob.size() - 1, 1); + std::vector states(blob.size() - 1, 1); states.push_back(last_state); return parseByteByByte(blob, states); } @@ -517,7 +517,7 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) { const TStringBuf blob{ "4\r\n" "____\r\n"}; - TVector states{ + std::vector states{ -1, /* 1, -1, 1, -1, 1, -1, 1, -1 */}; // as soon as error happens parser state should be considered @@ -540,7 +540,7 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) { const TStringBuf blob{ "\r\n" "-1"}; - TVector states{ + std::vector states{ 1, 1, -1, /* 1 */}; @@ -570,7 +570,7 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) { "4\r\n" "_" // first byte of the chunk }; - TVector states{ + std::vector states{ 1, 1, 1, 1, 2, -1}; diff --git a/library/cpp/http/fetch/httpload.h b/library/cpp/http/fetch/httpload.h index e22e4b809ea..3743bec6ac4 100644 --- a/library/cpp/http/fetch/httpload.h +++ b/library/cpp/http/fetch/httpload.h @@ -228,7 +228,7 @@ class httpLoadAgent: public httpSpecialAgent { THttpURL URL_; bool PersistentConn_; httpAgentReader* Reader_; - TVector Headers_; + std::vector Headers_; int ErrCode_; char* RealHost_; httpDigestHandler Digest_; diff --git a/library/cpp/http/fetch/sockhandler.h b/library/cpp/http/fetch/sockhandler.h index e18149f6571..6f4fe909894 100644 --- a/library/cpp/http/fetch/sockhandler.h +++ b/library/cpp/http/fetch/sockhandler.h @@ -4,7 +4,7 @@ #include #include -#include + #include #include #include @@ -14,9 +14,9 @@ #include #include -class TAddrList: public TVector { +class TAddrList: public std::vector { private: - using TBase = TVector; + using TBase = std::vector; public: //msvc doesn't support base class constructor inheritance diff --git a/library/cpp/http/io/compression.h b/library/cpp/http/io/compression.h index f16c4a18ebb..35a62330ffa 100644 --- a/library/cpp/http/io/compression.h +++ b/library/cpp/http/io/compression.h @@ -46,7 +46,7 @@ class TCompressionCodecFactory { TDeque Strings_; THashMap Codecs_; - TVector BestCodecs_; + std::vector BestCodecs_; }; namespace NHttp { diff --git a/library/cpp/http/io/fuzz/main.cpp b/library/cpp/http/io/fuzz/main.cpp index 8ded9c7e320..275bce86e01 100644 --- a/library/cpp/http/io/fuzz/main.cpp +++ b/library/cpp/http/io/fuzz/main.cpp @@ -1,6 +1,6 @@ #include -#include + #include extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) { diff --git a/library/cpp/http/io/headers.h b/library/cpp/http/io/headers.h index cfb4a9c054e..44fedaa7b6e 100644 --- a/library/cpp/http/io/headers.h +++ b/library/cpp/http/io/headers.h @@ -3,7 +3,7 @@ #include #include #include -#include + #include class IInputStream; diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp index 02401fffd9d..77720df0c7d 100644 --- a/library/cpp/http/io/stream_ut.cpp +++ b/library/cpp/http/io/stream_ut.cpp @@ -443,7 +443,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { Y_UNIT_TEST(CodecsPriority) { TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n"); - TVector codecs = {"br", "gzip"}; + std::vector codecs = {"br", "gzip"}; THttpInput i(&request); TString result; @@ -466,7 +466,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { Y_UNIT_TEST(CodecsPriority2) { TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n"); - TVector codecs = {"gzip", "br"}; + std::vector codecs = {"gzip", "br"}; THttpInput i(&request); TString result; diff --git a/library/cpp/http/misc/httpreqdata.h b/library/cpp/http/misc/httpreqdata.h index b5c9e446a99..09abd9734fd 100644 --- a/library/cpp/http/misc/httpreqdata.h +++ b/library/cpp/http/misc/httpreqdata.h @@ -13,7 +13,7 @@ #include #include #include -#include + #include using THttpHeadersContainer = THashMap; @@ -97,7 +97,7 @@ class TBaseServerRequestData { SOCKET Socket_; ui64 BeginTime_; mutable TString CurPage_; - TVector ParseBuf_; + std::vector ParseBuf_; TString ModifiedQueryString_; }; diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index a5dfe08e55a..46aaf568509 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -372,7 +372,7 @@ class THttpServer::TImpl { void ListenSocket(size_t threadNum) { TThread::SetCurrentThreadName(Options_.ListenThreadName.c_str()); - TVector events; + std::vector events; events.resize(Options_.EpollMaxEvents); TInstant now = TInstant::Now(); @@ -483,7 +483,7 @@ class THttpServer::TImpl { return Options_.MaxConnections && ((size_t)GetClientCount() >= Options_.MaxConnections); } - TVector> ListenThreads; + std::vector> ListenThreads; std::atomic RunningListeners_ = 0; TIntrusiveListWithAutoDelete Reqs; TPipeHandle ListenWakeupReadFd; diff --git a/library/cpp/http/server/http.h b/library/cpp/http/server/http.h index 62dfd5a50fa..de7ce99a504 100644 --- a/library/cpp/http/server/http.h +++ b/library/cpp/http/server/http.h @@ -7,7 +7,7 @@ #include #include #include -#include + #include class IThreadFactory; @@ -144,7 +144,7 @@ class TClientRequest: public IObjectInQueue { void Process(void* ThreadSpecificResource) override; public: - TVector> ParsedHeaders; + std::vector> ParsedHeaders; TString RequestString; private: diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp index 191a6428ef1..b3c0da44665 100644 --- a/library/cpp/http/server/http_ut.cpp +++ b/library/cpp/http/server/http_ut.cpp @@ -347,7 +347,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { const ui16 port = pm.GetPort(); TEchoServer serverImpl(res); - TVector> servers; + std::vector> servers; for (ui32 i = 0; i < 10; i++) { servers.push_back(MakeHolder(&serverImpl, THttpServer::TOptions(port).EnableReusePort(true))); } @@ -711,7 +711,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { UNIT_ASSERT(server.Lock.TryAcquire()); std::atomic threadsFinished = 0; - TVector> threads; + std::vector> threads; auto func = [port, keepAlive, &threadsFinished]() { try { TTestRequest r(port); @@ -833,9 +833,9 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { Stop(); } private: - TVector> Threads_; + std::vector> Threads_; std::atomic Stopped_ = false; - TVector Counters_; + std::vector Counters_; }; struct TTestConfig { @@ -843,7 +843,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { ui32 ListenerThreads = 1; }; - TVector testConfigs = { + std::vector testConfigs = { {.OneShot = false, .ListenerThreads = 1}, {.OneShot = true, .ListenerThreads = 1}, {.OneShot = true, .ListenerThreads = 4}, diff --git a/library/cpp/http/server/options.h b/library/cpp/http/server/options.h index cacd7ebedaf..d981790704e 100644 --- a/library/cpp/http/server/options.h +++ b/library/cpp/http/server/options.h @@ -5,7 +5,7 @@ #include #include #include -#include + #include class THttpServerOptions { @@ -15,7 +15,7 @@ class THttpServerOptions { { } - using TBindAddresses = TVector; + using TBindAddresses = std::vector; void BindAddresses(TBindAddresses& ret) const; inline THttpServerOptions& AddBindAddress(const TString& address, ui16 port) { @@ -156,7 +156,7 @@ class THttpServerOptions { ui16 Port; }; - typedef TVector TAddrs; + typedef std::vector TAddrs; bool KeepAliveEnabled = true; bool CompressionEnabled = false; diff --git a/library/cpp/http/server/response.cpp b/library/cpp/http/server/response.cpp index 52d64c91cec..719f23b3935 100644 --- a/library/cpp/http/server/response.cpp +++ b/library/cpp/http/server/response.cpp @@ -18,7 +18,7 @@ THttpResponse& THttpResponse::SetContentType(const TStringBuf& contentType) { } void THttpResponse::OutTo(IOutputStream& os) const { - TVector parts; + std::vector parts; const size_t FIRST_LINE_PARTS = 3; const size_t HEADERS_PARTS = Headers.Count() * 4; const size_t CONTENT_PARTS = 5; diff --git a/library/cpp/http/server/response.h b/library/cpp/http/server/response.h index b5ce0f93206..3f52f18ff66 100644 --- a/library/cpp/http/server/response.h +++ b/library/cpp/http/server/response.h @@ -5,6 +5,7 @@ #include #include +#include class THttpHeaders; class IOutputStream; diff --git a/library/cpp/http/simple/http_client.cpp b/library/cpp/http/simple/http_client.cpp index 818dc048ad1..ce2c7fb125f 100644 --- a/library/cpp/http/simple/http_client.cpp +++ b/library/cpp/http/simple/http_client.cpp @@ -77,12 +77,12 @@ void TKeepAliveHttpClient::ResetConnection() { Connection.Reset(); } -TVector TKeepAliveHttpClient::FormRequest(TStringBuf method, +std::vector TKeepAliveHttpClient::FormRequest(TStringBuf method, const TStringBuf relativeUrl, TStringBuf body, const TKeepAliveHttpClient::THeaders& headers, TStringBuf contentLength) const { - TVector parts; + std::vector parts; parts.reserve(16 + 4 * headers.size()); parts.push_back(method); @@ -315,7 +315,7 @@ void TRedirectableHttpClient::PrepareClient(TKeepAliveHttpClient& cl) const { void TRedirectableHttpClient::ProcessResponse(const TStringBuf relativeUrl, THttpInput& input, IOutputStream* output, const unsigned statusCode) const { for (auto i = input.Headers().Begin(), e = input.Headers().End(); i != e; ++i) { if (0 == TString::compare(i->Name(), TStringBuf("Location"))) { - TVector request_url_parts, request_body_parts; + std::vector request_url_parts, request_body_parts; size_t splitted_index = 0; for (auto& iter : StringSplitter(i->Value()).Split('/')) { diff --git a/library/cpp/http/simple/http_client.h b/library/cpp/http/simple/http_client.h index c01b11ba43f..e8bdf577e4a 100644 --- a/library/cpp/http/simple/http_client.h +++ b/library/cpp/http/simple/http_client.h @@ -95,7 +95,7 @@ class TKeepAliveHttpClient { IOutputStream* output, THttpHeaders* outHeaders); - TVector FormRequest(TStringBuf method, const TStringBuf relativeUrl, + std::vector FormRequest(TStringBuf method, const TStringBuf relativeUrl, TStringBuf body, const THeaders& headers, TStringBuf contentLength) const; diff --git a/library/cpp/iterator/README.md b/library/cpp/iterator/README.md index cd92a284c9a..a4a80b49dad 100644 --- a/library/cpp/iterator/README.md +++ b/library/cpp/iterator/README.md @@ -13,7 +13,7 @@ * Работа для всех контейнеров, для которых работает range-based for (для `Enumerate`, `Zip`, `Concatenate`, `CartesianProduct`). Для `Map` и `Filter` есть требование на то, что первый и последний итераторы контейнера имеют один тип * В том числе работает для обычных массивов (`int a[] = {1, 2, 3}; Enumerate(a)`). - * Поддержка rvalue для контейнеров, предикатов и функций-мапперов (`Filter([](auto x){...}, TVector{1, 2, 3})`). + * Поддержка rvalue для контейнеров, предикатов и функций-мапперов (`Filter([](auto x){...}, std::vector{1, 2, 3})`). В этом случае объекты сохраняются внутри view. * Проброс элементов контейнеров по неконстантной ссылке * `TView::iterator` - можно полагаться, что этот тип есть и корректен diff --git a/library/cpp/iterator/ut/filtering_ut.cpp b/library/cpp/iterator/ut/filtering_ut.cpp index 60c20446988..eeac0ecc402 100644 --- a/library/cpp/iterator/ut/filtering_ut.cpp +++ b/library/cpp/iterator/ut/filtering_ut.cpp @@ -2,12 +2,12 @@ #include -#include + using namespace testing; TEST(Filtering, TFilteringRangeTest) { - const TVector x = {1, 2, 3, 4, 5}; + const std::vector x = {1, 2, 3, 4, 5}; EXPECT_THAT( MakeFilteringRange( @@ -19,7 +19,7 @@ TEST(Filtering, TFilteringRangeTest) { } TEST(Filtering, TEmptyFilteringRangeTest) { - TVector x = {1, 2, 3, 4, 5}; + std::vector x = {1, 2, 3, 4, 5}; EXPECT_THAT( MakeFilteringRange( x, @@ -30,7 +30,7 @@ TEST(Filtering, TEmptyFilteringRangeTest) { } TEST(Filtering, TMutableFilteringRangeTest) { - TVector x = {1, 2, 3, 4, 5}; + std::vector x = {1, 2, 3, 4, 5}; for (auto& y : MakeFilteringRange(x, [](int x) { return x % 2 == 0; })) { y = 7; } diff --git a/library/cpp/iterator/ut/functools_ut.cpp b/library/cpp/iterator/ut/functools_ut.cpp index 2dee9a55c85..95a7d4892d6 100644 --- a/library/cpp/iterator/ut/functools_ut.cpp +++ b/library/cpp/iterator/ut/functools_ut.cpp @@ -2,7 +2,7 @@ #include -#include + #include #include @@ -126,9 +126,9 @@ using namespace NFuncTools; TEST(FuncTools, Enumerate) { - TVector a = {1, 2, 4}; - TVector b; - TVector c = {1}; + std::vector a = {1, 2, 4}; + std::vector b; + std::vector c = {1}; for (auto& v : {a, b, c}) { size_t j = 0; FOR_DISPATCH_2(i, x, Enumerate(v)) { @@ -139,7 +139,7 @@ using namespace NFuncTools; EXPECT_EQ(j, v.size()); } - TVector d = {0, 0, 0}; + std::vector d = {0, 0, 0}; FOR_DISPATCH_2(i, x, Enumerate(d)) { x = i; } @@ -150,12 +150,12 @@ using namespace NFuncTools; } TEST(FuncTools, EnumerateTemporary) { - TVector a = {1, 2, 4}; - TVector b; - TVector c = {1}; + std::vector a = {1, 2, 4}; + std::vector b; + std::vector c = {1}; for (auto& v : {a, b, c}) { size_t j = 0; - FOR_DISPATCH_2(i, x, Enumerate(TVector(v))) { + FOR_DISPATCH_2(i, x, Enumerate(std::vector(v))) { EXPECT_EQ(v[i], x); EXPECT_EQ(i, j++); EXPECT_LT(i, v.size()); @@ -163,7 +163,7 @@ using namespace NFuncTools; EXPECT_EQ(j, v.size()); } - FOR_DISPATCH_2(i, x, Enumerate(TVector{1, 2, 3})) { + FOR_DISPATCH_2(i, x, Enumerate(std::vector{1, 2, 3})) { EXPECT_EQ(i + 1, x); } } @@ -186,7 +186,7 @@ using namespace NFuncTools; } TEST(FuncTools, Zip) { - TVector, TVector>> ts = { + std::vector, std::vector>> ts = { {{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {4, 5, 6, 7}}, {{1, 2, 3, 4}, {4, 5, 6}}, @@ -204,8 +204,8 @@ using namespace NFuncTools; } TEST(FuncTools, ZipReference) { - TVector a = {0, 1, 2}; - TVector b = {2, 1, 0, -1}; + std::vector a = {0, 1, 2}; + std::vector b = {2, 1, 0, -1}; FOR_DISPATCH_2(ai, bi, Zip(a, b)) { ai = bi; } @@ -216,7 +216,7 @@ using namespace NFuncTools; } TEST(FuncTools, Zip3) { - TVector, TVector, TVector>> ts = { + std::vector, std::vector, std::vector>> ts = { {{1, 2, 3}, {4, 5, 6}, {11, 3}}, {{1, 2, 3}, {4, 5, 6, 7}, {9, 0}}, {{1, 2, 3, 4}, {9}, {4, 5, 6}}, @@ -225,12 +225,12 @@ using namespace NFuncTools; }; FOR_DISPATCH_3(a, b, c, ts) { - TVector> e; + std::vector> e; for (size_t j = 0; j < a.size() && j < b.size() && j < c.size(); ++j) { e.push_back({a[j], b[j], c[j]}); } - TVector> f; + std::vector> f; FOR_DISPATCH_3(ai, bi, ci, Zip(a, b, c)) { f.push_back({ai, bi, ci}); } @@ -258,7 +258,7 @@ using namespace NFuncTools; } TEST(FuncTools, Filter) { - TVector> ts = { + std::vector> ts = { {}, {1}, {2}, @@ -270,14 +270,14 @@ using namespace NFuncTools; auto pred = [](i32 x) -> bool { return x & 1; }; for (auto& a : ts) { - TVector b; + std::vector b; for (i32 x : a) { if (pred(x)) { b.push_back(x); } } - TVector c; + std::vector c; for (i32 x : Filter(pred, a)) { c.push_back(x); } @@ -295,7 +295,7 @@ using namespace NFuncTools; } TEST(FuncTools, Map) { - TVector> ts = { + std::vector> ts = { {}, {1}, {1, 2}, @@ -305,12 +305,12 @@ using namespace NFuncTools; auto f = [](i32 x) { return x * x; }; for (auto& a : ts) { - TVector b; + std::vector b; for (i32 x : a) { b.push_back(f(x)); } - TVector c; + std::vector c; for (i32 x : Map(f, a)) { c.push_back(x); } @@ -318,11 +318,11 @@ using namespace NFuncTools; EXPECT_EQ(b, c); } - TVector floats = {1.4, 4.1, 13.9}; - TVector ints = {1, 4, 13}; - TVector roundedFloats = {1, 4, 13}; - TVector res; - TVector resFloat; + std::vector floats = {1.4, 4.1, 13.9}; + std::vector ints = {1, 4, 13}; + std::vector roundedFloats = {1, 4, 13}; + std::vector res; + std::vector resFloat; for (auto i : Map(floats)) { res.push_back(i); } @@ -360,7 +360,7 @@ using namespace NFuncTools; } TEST(FuncTools, CartesianProduct) { - TVector, TVector>> ts = { + std::vector, std::vector>> ts = { {{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {4, 5, 6, 7}}, {{1, 2, 3, 4}, {4, 5, 6}}, @@ -369,14 +369,14 @@ using namespace NFuncTools; }; for (auto [a, b] : ts) { - TVector> c; + std::vector> c; for (auto ai : a) { for (auto bi : b) { c.push_back({ai, bi}); } } - TVector> d; + std::vector> d; FOR_DISPATCH_2(ai, bi, CartesianProduct(a, b)) { d.push_back({ai, bi}); } @@ -385,8 +385,8 @@ using namespace NFuncTools; } { - TVector> g = {{}, {}}; - TVector h = {10, 11, 12}; + std::vector> g = {{}, {}}; + std::vector h = {10, 11, 12}; FOR_DISPATCH_2(gi, i, CartesianProduct(g, h)) { gi.push_back(i); } @@ -396,7 +396,7 @@ using namespace NFuncTools; } TEST(FuncTools, CartesianProduct3) { - TVector, TVector, TVector>> ts = { + std::vector, std::vector, std::vector>> ts = { {{1, 2, 3}, {4, 5, 6}, {11, 3}}, {{1, 2, 3}, {4, 5, 6, 7}, {9}}, {{1, 2, 3, 4}, {9}, {4, 5, 6}}, @@ -405,7 +405,7 @@ using namespace NFuncTools; }; FOR_DISPATCH_3(a, b, c, ts) { - TVector> e; + std::vector> e; for (auto ai : a) { for (auto bi : b) { for (auto ci : c) { @@ -414,7 +414,7 @@ using namespace NFuncTools; } } - TVector> f; + std::vector> f; FOR_DISPATCH_3(ai, bi, ci, CartesianProduct(a, b, c)) { f.push_back({ai, bi, ci}); } @@ -443,7 +443,7 @@ using namespace NFuncTools; } TEST(FuncTools, Concatenate2) { - TVector, TVector>> ts = { + std::vector, std::vector>> ts = { {{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {4, 5, 6, 7}}, {{1, 2, 3, 4}, {4, 5, 6}}, @@ -452,7 +452,7 @@ using namespace NFuncTools; }; for (auto [a, b] : ts) { - TVector c; + std::vector c; for (auto ai : a) { c.push_back(ai); } @@ -460,7 +460,7 @@ using namespace NFuncTools; c.push_back(bi); } - TVector d; + std::vector d; for (auto x : Concatenate(a, b)) { d.push_back(x); } @@ -469,12 +469,12 @@ using namespace NFuncTools; } { - TVector a = {1, 2, 3, 4}; - TVector c; - for (auto x : Concatenate(a, TVector{5, 6})) { + std::vector a = {1, 2, 3, 4}; + std::vector c; + for (auto x : Concatenate(a, std::vector{5, 6})) { c.push_back(x); } - EXPECT_EQ(c, (TVector{1, 2, 3, 4, 5, 6})); + EXPECT_EQ(c, (std::vector{1, 2, 3, 4, 5, 6})); } } @@ -503,7 +503,7 @@ using namespace NFuncTools; EXPECT_EQ(std::get<0>(jk), std::get<1>(jk)); } - TVector a = {0, 1, 2}; + std::vector a = {0, 1, 2}; FOR_DISPATCH_2(i, j, Enumerate(Reversed(a))) { EXPECT_EQ(i, 2 - j); } @@ -526,8 +526,8 @@ using namespace NFuncTools; TEST(FuncTools, CopyIterator) { - TVector a = {1, 2, 3, 4}; - TVector b = {4, 5, 6, 7}; + std::vector a = {1, 2, 3, 4}; + std::vector b = {4, 5, 6, 7}; // calls f on 2nd, 3d and 4th positions (numeration from 1st) auto testIterator = [](auto it, auto f) { @@ -588,7 +588,7 @@ using namespace NFuncTools; } { - auto iterable = CartesianProduct(TVector{0, 1}, TVector{2, 3}); + auto iterable = CartesianProduct(std::vector{0, 1}, std::vector{2, 3}); // (0, 2), (0, 3), (1, 2), (1, 3) testIterator(std::begin(iterable), [](auto p2, auto p3, auto p4) { diff --git a/library/cpp/iterator/ut/mapped_ut.cpp b/library/cpp/iterator/ut/mapped_ut.cpp index 440cd37945a..1e2c0b5eb45 100644 --- a/library/cpp/iterator/ut/mapped_ut.cpp +++ b/library/cpp/iterator/ut/mapped_ut.cpp @@ -3,12 +3,12 @@ #include #include -#include + using namespace testing; TEST(TIterator, TMappedIteratorTest) { - TVector x = {1, 2, 3, 4, 5}; + std::vector x = {1, 2, 3, 4, 5}; auto it = MakeMappedIterator(x.begin(), [](int x) { return x + 7; }); EXPECT_EQ(*it, 8); @@ -16,7 +16,7 @@ TEST(TIterator, TMappedIteratorTest) { } TEST(TIterator, TMappedRangeTest) { - TVector x = {1, 2, 3, 4, 5}; + std::vector x = {1, 2, 3, 4, 5}; EXPECT_THAT( MakeMappedRange( @@ -42,7 +42,7 @@ TEST(TIterator, TMutableMappedRangeTest) { TEST(TIterator, TOwningMappedMethodTest) { auto range = MakeMappedRange( - TVector>{std::make_pair(1, 2), std::make_pair(3, 4)}, + std::vector>{std::make_pair(1, 2), std::make_pair(3, 4)}, [](auto& point) -> int& { return point.first; } diff --git a/library/cpp/iterator/ut/zip_ut.cpp b/library/cpp/iterator/ut/zip_ut.cpp index 68d496515c3..1783fe552fa 100644 --- a/library/cpp/iterator/ut/zip_ut.cpp +++ b/library/cpp/iterator/ut/zip_ut.cpp @@ -2,11 +2,11 @@ #include -#include + TEST(TIterator, ZipSimplePostIncrement) { - TVector left{1, 2, 3}; - TVector right{4, 5, 6}; + std::vector left{1, 2, 3}; + std::vector right{4, 5, 6}; auto zipped = Zip(left, right); auto cur = zipped.begin(); diff --git a/library/cpp/json/json_reader.h b/library/cpp/json/json_reader.h index 6c8e8c32e2a..20d74615349 100644 --- a/library/cpp/json/json_reader.h +++ b/library/cpp/json/json_reader.h @@ -91,7 +91,7 @@ namespace NJson { protected: TJsonValue& Value; TString Key; - TVector ValuesStack; + std::vector ValuesStack; bool NotClosedBracketIsError; enum { diff --git a/library/cpp/json/ut/json_reader_fast_ut.cpp b/library/cpp/json/ut/json_reader_fast_ut.cpp index 60dffc91c73..5a89380b48e 100644 --- a/library/cpp/json/ut/json_reader_fast_ut.cpp +++ b/library/cpp/json/ut/json_reader_fast_ut.cpp @@ -84,7 +84,7 @@ namespace NJson { } }; - using TEvents = TVector; + using TEvents = std::vector; struct TTestHandler : TJsonCallbacks { TEvents Events; diff --git a/library/cpp/json/writer/json.h b/library/cpp/json/writer/json.h index 0aae2531b94..5d4c48eb5b6 100644 --- a/library/cpp/json/writer/json.h +++ b/library/cpp/json/writer/json.h @@ -3,11 +3,13 @@ #include #include #include -#include + #include #include #include +#include + namespace NJson { class TJsonValue; } @@ -36,7 +38,7 @@ namespace NJsonWriter { struct TBufState { bool NeedComma; bool NeedNewline; - TVector Stack; + std::vector Stack; }; class TBuf : TNonCopyable { @@ -147,10 +149,10 @@ namespace NJsonWriter { private: IOutputStream* Stream; THolder StringStream; - typedef TVector TKeys; + typedef std::vector TKeys; TKeys Keys; - TVector Stack; + std::vector Stack; bool NeedComma; bool NeedNewline; const EHtmlEscapeMode EscapeMode; diff --git a/library/cpp/json/writer/json_value.h b/library/cpp/json/writer/json_value.h index 80aa59b985c..582baab5288 100644 --- a/library/cpp/json/writer/json_value.h +++ b/library/cpp/json/writer/json_value.h @@ -4,7 +4,7 @@ #include #include -#include + #include #include #include diff --git a/library/cpp/lcs/lcs_via_lis.h b/library/cpp/lcs/lcs_via_lis.h index fe0ac297fc5..22752eb5756 100644 --- a/library/cpp/lcs/lcs_via_lis.h +++ b/library/cpp/lcs/lcs_via_lis.h @@ -4,16 +4,16 @@ #include #include -#include + #include #include namespace NLCS { template struct TLCSCtx { - typedef TVector TSubsequence; + typedef std::vector TSubsequence; typedef THashMap, TEqualTo, ::TPoolAllocator> TEncounterIndex; - typedef TVector> TLastIndex; + typedef std::vector> TLastIndex; typedef NPagedVector::TPagedVector TCover; TMemoryPool Pool; @@ -183,7 +183,7 @@ namespace NLCS { template size_t MeasureLCS(TIter beg1, TIter end1, TIter beg2, TIter end2, TLCSCtx* ctx = nullptr) { - return MakeLCS(beg1, end1, beg2, end2, (TVector*)nullptr, ctx); + return MakeLCS(beg1, end1, beg2, end2, (std::vector*)nullptr, ctx); } template diff --git a/library/cpp/lcs/lcs_via_lis_ut.cpp b/library/cpp/lcs/lcs_via_lis_ut.cpp index f6ad5152b6f..c47370c0cd6 100644 --- a/library/cpp/lcs/lcs_via_lis_ut.cpp +++ b/library/cpp/lcs/lcs_via_lis_ut.cpp @@ -10,7 +10,7 @@ class TLCSTest: public TTestBase { private: size_t Length(TStringBuf s1, TStringBuf s2) { - TVector> c; + std::vector> c; c.resize(s1.size() + 1); for (size_t i = 0; i < c.size(); ++i) { diff --git a/library/cpp/logger/backend.cpp b/library/cpp/logger/backend.cpp index df23067f17a..cf090e5dd9a 100644 --- a/library/cpp/logger/backend.cpp +++ b/library/cpp/logger/backend.cpp @@ -1,5 +1,5 @@ #include "backend.h" -#include + #include #include #include @@ -7,7 +7,7 @@ namespace { class TGlobalLogsStorage { private: - TVector Backends; + std::vector Backends; TMutex Mutex; public: diff --git a/library/cpp/logger/backend.h b/library/cpp/logger/backend.h index d088726d6d4..4b85accb39f 100644 --- a/library/cpp/logger/backend.h +++ b/library/cpp/logger/backend.h @@ -3,7 +3,7 @@ #include "priority.h" #include - +#include #include struct TLogRecord; diff --git a/library/cpp/logger/backend_creator.h b/library/cpp/logger/backend_creator.h index 4f0ca24a4ec..62360f4efc0 100644 --- a/library/cpp/logger/backend_creator.h +++ b/library/cpp/logger/backend_creator.h @@ -3,7 +3,7 @@ #include "backend.h" #include #include -#include + #include #include @@ -31,7 +31,7 @@ class ILogBackendCreator { virtual ~IInitContext() = default; virtual bool GetValue(TStringBuf name, TString& var) const = 0; - virtual TVector> GetChildren(TStringBuf name) const = 0; + virtual std::vector> GetChildren(TStringBuf name) const = 0; }; public: diff --git a/library/cpp/logger/composite.h b/library/cpp/logger/composite.h index 47f3558b75b..e6b680cb10b 100644 --- a/library/cpp/logger/composite.h +++ b/library/cpp/logger/composite.h @@ -3,6 +3,7 @@ #include "backend.h" #include + class TCompositeLogBackend: public TLogBackend { public: virtual void WriteData(const TLogRecord& rec) override; @@ -10,6 +11,6 @@ class TCompositeLogBackend: public TLogBackend { virtual void AddLogBackend(THolder&& backend); private: - TVector> Slaves; + std::vector> Slaves; ELogPriority LogPriority = static_cast(0); // has now it's own priority by default }; diff --git a/library/cpp/logger/composite_creator.h b/library/cpp/logger/composite_creator.h index 877d3a2b330..c8058a2ed7c 100644 --- a/library/cpp/logger/composite_creator.h +++ b/library/cpp/logger/composite_creator.h @@ -1,7 +1,7 @@ #pragma once #include "backend_creator.h" -#include + class TCompositeBackendCreator : public TLogBackendCreatorBase { public: @@ -14,5 +14,5 @@ class TCompositeBackendCreator : public TLogBackendCreatorBase { private: virtual THolder DoCreateLogBackend() const override; - TVector> Children; + std::vector> Children; }; diff --git a/library/cpp/logger/composite_ut.cpp b/library/cpp/logger/composite_ut.cpp index 0b79a41b328..8303813be24 100644 --- a/library/cpp/logger/composite_ut.cpp +++ b/library/cpp/logger/composite_ut.cpp @@ -8,8 +8,8 @@ Y_UNIT_TEST_SUITE(TCompositeLogTest) { - TVector ReadLines(const TString & filename) { - TVector lines; + std::vector ReadLines(const TString & filename) { + std::vector lines; TIFStream fin(filename); TString line; while (fin.ReadLine(line)) { diff --git a/library/cpp/logger/init_context/config.cpp b/library/cpp/logger/init_context/config.cpp index 30efa13333d..7d7c955989b 100644 --- a/library/cpp/logger/init_context/config.cpp +++ b/library/cpp/logger/init_context/config.cpp @@ -12,8 +12,8 @@ bool TLogBackendCreatorInitContextConfig::GetValue(TStringBuf name, TString& var return false; } -TVector> TLogBackendCreatorInitContextConfig::GetChildren(TStringBuf name) const { - TVector> result; +std::vector> TLogBackendCreatorInitContextConfig::GetChildren(TStringBuf name) const { + std::vector> result; const NConfig::TConfig& child = Config[name]; if (child.IsA()) { for (const auto& i: child.Get()) { diff --git a/library/cpp/logger/init_context/config.h b/library/cpp/logger/init_context/config.h index 8227d13176c..d80adb54d7a 100644 --- a/library/cpp/logger/init_context/config.h +++ b/library/cpp/logger/init_context/config.h @@ -7,7 +7,7 @@ class TLogBackendCreatorInitContextConfig : public ILogBackendCreator::IInitCont public: TLogBackendCreatorInitContextConfig(const NConfig::TConfig& config); virtual bool GetValue(TStringBuf name, TString& var) const override; - virtual TVector> GetChildren(TStringBuf name) const override; + virtual std::vector> GetChildren(TStringBuf name) const override; private: const NConfig::TConfig& Config; diff --git a/library/cpp/logger/init_context/yconf.cpp b/library/cpp/logger/init_context/yconf.cpp index c7da1d607cb..115c9149ba4 100644 --- a/library/cpp/logger/init_context/yconf.cpp +++ b/library/cpp/logger/init_context/yconf.cpp @@ -8,8 +8,8 @@ bool TLogBackendCreatorInitContextYConf::GetValue(TStringBuf name, TString& var) return Section.GetDirectives().GetValue(name, var); } -TVector> TLogBackendCreatorInitContextYConf::GetChildren(TStringBuf name) const { - TVector> result; +std::vector> TLogBackendCreatorInitContextYConf::GetChildren(TStringBuf name) const { + std::vector> result; auto children = Section.GetAllChildren(); for (auto range = children.equal_range(TCiString(name)); range.first != range.second; ++range.first) { result.emplace_back(MakeHolder(*range.first->second)); diff --git a/library/cpp/logger/init_context/yconf.h b/library/cpp/logger/init_context/yconf.h index b1867d271d9..907f5318bca 100644 --- a/library/cpp/logger/init_context/yconf.h +++ b/library/cpp/logger/init_context/yconf.h @@ -7,7 +7,7 @@ class TLogBackendCreatorInitContextYConf: public ILogBackendCreator::IInitContex public: TLogBackendCreatorInitContextYConf(const TYandexConfig::Section& section); virtual bool GetValue(TStringBuf name, TString& var) const override; - virtual TVector> GetChildren(TStringBuf name) const override; + virtual std::vector> GetChildren(TStringBuf name) const override; private: const TYandexConfig::Section& Section; }; diff --git a/library/cpp/logger/log_ut.cpp b/library/cpp/logger/log_ut.cpp index 747e5dddf88..e487b4152f0 100644 --- a/library/cpp/logger/log_ut.cpp +++ b/library/cpp/logger/log_ut.cpp @@ -8,7 +8,7 @@ #include #include #include -#include + class TLogTest: public TTestBase { UNIT_TEST_SUITE(TLogTest); @@ -174,7 +174,7 @@ void TLogTest::TestWrite() { TLog log(THolder(new TStreamLogBackend(&data))); for (size_t i = 0; i < 1000; ++i) { - TVector buf(i, (char)i); + std::vector buf(i, (char)i); test.append(buf.data(), buf.size()); log.Write(buf.data(), buf.size()); diff --git a/library/cpp/logger/record.h b/library/cpp/logger/record.h index 9c2062c3eec..54efb995710 100644 --- a/library/cpp/logger/record.h +++ b/library/cpp/logger/record.h @@ -3,13 +3,13 @@ #include "priority.h" #include -#include #include #include +#include struct TLogRecord { - using TMetaFlags = TVector>; + using TMetaFlags = std::vector>; const char* Data; size_t Len; diff --git a/library/cpp/monlib/counters/counters.h b/library/cpp/monlib/counters/counters.h index 2baa6fa0659..3529778d983 100644 --- a/library/cpp/monlib/counters/counters.h +++ b/library/cpp/monlib/counters/counters.h @@ -6,7 +6,7 @@ #include #include #include -#include + #include #include #include @@ -148,7 +148,7 @@ namespace NMonitoring { class TDeprecatedCounterGroups { public: typedef TMap TGroups; - typedef TVector TGroupsNames; + typedef std::vector TGroupsNames; typedef THolder TGroupsNamesPtr; private: diff --git a/library/cpp/monlib/dynamic_counters/counters.h b/library/cpp/monlib/dynamic_counters/counters.h index b15566c0342..338bf53fa3a 100644 --- a/library/cpp/monlib/dynamic_counters/counters.h +++ b/library/cpp/monlib/dynamic_counters/counters.h @@ -225,7 +225,7 @@ namespace NMonitoring { }; using TCounters = TMap; - using TLabels = TVector; + using TLabels = std::vector; /// XXX: hack for deferred removal of expired counters. Remove once Output* functions are not used for serialization mutable TCounters Counters; diff --git a/library/cpp/monlib/dynamic_counters/encode.cpp b/library/cpp/monlib/dynamic_counters/encode.cpp index 26328a44eea..ac3d31de70b 100644 --- a/library/cpp/monlib/dynamic_counters/encode.cpp +++ b/library/cpp/monlib/dynamic_counters/encode.cpp @@ -89,7 +89,7 @@ namespace NMonitoring { private: NMonitoring::IMetricEncoderPtr EncoderImpl_; - TVector ParentLabels_; + std::vector ParentLabels_; TCountableBase::EVisibility Visibility_; }; diff --git a/library/cpp/monlib/dynamic_counters/page.cpp b/library/cpp/monlib/dynamic_counters/page.cpp index c0d523248a7..4c632276fc9 100644 --- a/library/cpp/monlib/dynamic_counters/page.cpp +++ b/library/cpp/monlib/dynamic_counters/page.cpp @@ -36,7 +36,7 @@ void TDynamicCountersPage::Output(NMonitoring::IMonHttpRequest& request) { TCountableBase::EVisibility::Public }; - TVector parts; + std::vector parts; StringSplitter(request.GetPathInfo()) .Split('/') .SkipEmpty() @@ -48,7 +48,7 @@ void TDynamicCountersPage::Output(NMonitoring::IMonHttpRequest& request) { } if (!parts.empty() && parts.back().StartsWith(TStringBuf("name_label="))) { - TVector labels; + std::vector labels; StringSplitter(parts.back()).Split('=').SkipEmpty().Collect(&labels); if (labels.size() == 2U) { nameLabel = labels.back(); @@ -66,7 +66,7 @@ void TDynamicCountersPage::Output(NMonitoring::IMonHttpRequest& request) { for (const auto& escaped : parts) { const auto part = CGIUnescapeRet(escaped); - TVector labels; + std::vector labels; StringSplitter(part).Split('=').SkipEmpty().Collect(&labels); if (labels.size() != 2U) diff --git a/library/cpp/monlib/dynamic_counters/percentile/percentile_base.h b/library/cpp/monlib/dynamic_counters/percentile/percentile_base.h index d3c825c43d8..f5515370a2e 100644 --- a/library/cpp/monlib/dynamic_counters/percentile/percentile_base.h +++ b/library/cpp/monlib/dynamic_counters/percentile/percentile_base.h @@ -12,11 +12,11 @@ namespace NMonitoring { struct TPercentileBase : public TThrRefBase { using TPercentile = std::pair; - using TPercentiles = TVector; + using TPercentiles = std::vector; TPercentiles Percentiles; - void Initialize(const TIntrusivePtr &counters, const TVector &thresholds, + void Initialize(const TIntrusivePtr &counters, const std::vector &thresholds, TCountableBase::EVisibility visibility = TCountableBase::EVisibility::Public) { Percentiles.reserve(thresholds.size()); for (size_t i = 0; i < thresholds.size(); ++i) { @@ -26,7 +26,7 @@ struct TPercentileBase : public TThrRefBase { } void Initialize(const TIntrusivePtr &counters, TString group, TString subgroup, - TString name, const TVector &thresholds, + TString name, const std::vector &thresholds, TCountableBase::EVisibility visibility = TCountableBase::EVisibility::Public) { auto subCounters = counters->GetSubgroup(group, subgroup)->GetSubgroup("sensor", name); Initialize(subCounters, thresholds, visibility); diff --git a/library/cpp/monlib/dynamic_counters/percentile/percentile_ut.cpp b/library/cpp/monlib/dynamic_counters/percentile/percentile_ut.cpp index b8bdd410283..0f01b1642b4 100644 --- a/library/cpp/monlib/dynamic_counters/percentile/percentile_ut.cpp +++ b/library/cpp/monlib/dynamic_counters/percentile/percentile_ut.cpp @@ -128,13 +128,13 @@ void RunPerf() { Y_UNIT_TEST(DifferentPercentiles) { TPercentileTrackerLg<5, 4, 15> tracker; - TVector values({0, 115, 1216, 15, 3234567, 1234567, 216546, 263421, 751654, 96, 224, 223, 225}); - TVector percentiles50({0, 0, 116, 15, 116, 116, 1216, 1216, 217056, 1216, 1216, 224, 232}); - TVector percentiles75({0, 116, 116, 116, 1216, 1245152, 217056, 270304, 753632, 753632, + std::vector values({0, 115, 1216, 15, 3234567, 1234567, 216546, 263421, 751654, 96, 224, 223, 225}); + std::vector percentiles50({0, 0, 116, 15, 116, 116, 1216, 1216, 217056, 1216, 1216, 224, 232}); + std::vector percentiles75({0, 116, 116, 116, 1216, 1245152, 217056, 270304, 753632, 753632, 270304, 270304, 270304}); - TVector percentiles90({ 0, 116, 1216, 1216, 2064352, 1245152, 1245152, 1245152, 1245152, + std::vector percentiles90({ 0, 116, 1216, 1216, 2064352, 1245152, 1245152, 1245152, 1245152, 1245152, 1245152, 1245152, 1245152}); - TVector percentiles100({ 0, 116, 1216, 1216, 2064352, 2064352, 2064352, 2064352, 2064352, + std::vector percentiles100({ 0, 116, 1216, 1216, 2064352, 2064352, 2064352, 2064352, 2064352, 2064352, 2064352, 2064352, 2064352 }); for (size_t i = 0; i < values.size(); ++i) { diff --git a/library/cpp/monlib/encode/buffered/buffered_encoder_base.cpp b/library/cpp/monlib/encode/buffered/buffered_encoder_base.cpp index 87c832d642b..06793866b87 100644 --- a/library/cpp/monlib/encode/buffered/buffered_encoder_base.cpp +++ b/library/cpp/monlib/encode/buffered/buffered_encoder_base.cpp @@ -145,7 +145,7 @@ void TBufferedEncoderBase::OnLogHistogram(TInstant time, TLogHistogramSnapshotPt } TString TBufferedEncoderBase::FormatLabels(const TPooledLabels& labels) const { - auto formattedLabels = TVector(Reserve(labels.size() + CommonLabels_.size())); + auto formattedLabels = std::vector(labels.size() + CommonLabels_.size()); auto addLabel = [&](const TPooledLabel& l) { auto formattedLabel = TStringBuilder() << LabelNamesPool_.Get(l.Key) << '=' << LabelValuesPool_.Get(l.Value); formattedLabels.push_back(std::move(formattedLabel)); diff --git a/library/cpp/monlib/encode/buffered/buffered_encoder_base.h b/library/cpp/monlib/encode/buffered/buffered_encoder_base.h index fe3714e58f0..bb481085373 100644 --- a/library/cpp/monlib/encode/buffered/buffered_encoder_base.h +++ b/library/cpp/monlib/encode/buffered/buffered_encoder_base.h @@ -59,7 +59,7 @@ class TBufferedEncoderBase : public IMetricEncoder { const TPooledStr* Value; }; - using TPooledLabels = TVector; + using TPooledLabels = std::vector; struct TPooledLabelsHash { size_t operator()(const TPooledLabels& val) const { @@ -92,7 +92,7 @@ class TBufferedEncoderBase : public IMetricEncoder { TStringPoolBuilder LabelValuesPool_; TInstant CommonTime_ = TInstant::Zero(); TPooledLabels CommonLabels_; - TVector Metrics_; + std::vector Metrics_; TMetricMap MetricMap_; EMetricsMergingMode MetricsMergingMode_ = EMetricsMergingMode::DEFAULT; }; diff --git a/library/cpp/monlib/encode/buffered/string_pool.h b/library/cpp/monlib/encode/buffered/string_pool.h index b7ab01d2a11..5325f6547ee 100644 --- a/library/cpp/monlib/encode/buffered/string_pool.h +++ b/library/cpp/monlib/encode/buffered/string_pool.h @@ -1,7 +1,7 @@ #pragma once #include -#include + namespace NMonitoring { //////////////////////////////////////////////////////////////////////////////// @@ -63,7 +63,7 @@ namespace NMonitoring { private: THashMap StrMap_; - TVector> StrVector_; + std::vector> StrVector_; bool RequiresSorting_ = false; bool IsBuilt_ = false; size_t BytesSize_ = 0; @@ -94,7 +94,7 @@ namespace NMonitoring { void InitIndex(const char* data, ui32 size); private: - TVector Index_; + std::vector Index_; }; } diff --git a/library/cpp/monlib/encode/buffered/string_pool_ut.cpp b/library/cpp/monlib/encode/buffered/string_pool_ut.cpp index 9fc3421d0bb..ecf7528b67d 100644 --- a/library/cpp/monlib/encode/buffered/string_pool_ut.cpp +++ b/library/cpp/monlib/encode/buffered/string_pool_ut.cpp @@ -63,22 +63,22 @@ Y_UNIT_TEST_SUITE(TStringPoolTest) { strPool.Build(); - TVector strings; - TVector indexes; - TVector frequences; + std::vector strings; + std::vector indexes; + std::vector frequences; strPool.ForEach([&](TStringBuf str, ui32 index, ui32 freq) { strings.emplace_back(str); indexes.push_back(index); frequences.push_back(freq); }); - TVector expectedStrings = {"three", "two", "one"}; + std::vector expectedStrings = {"three", "two", "one"}; UNIT_ASSERT_EQUAL(strings, expectedStrings); - TVector expectedIndexes = {0, 1, 2}; + std::vector expectedIndexes = {0, 1, 2}; UNIT_ASSERT_EQUAL(indexes, expectedIndexes); - TVector expectedFrequences = {3, 2, 1}; + std::vector expectedFrequences = {3, 2, 1}; UNIT_ASSERT_EQUAL(frequences, expectedFrequences); } } diff --git a/library/cpp/monlib/encode/json/json_decoder.cpp b/library/cpp/monlib/encode/json/json_decoder.cpp index 37189900759..31174ffba39 100644 --- a/library/cpp/monlib/encode/json/json_decoder.cpp +++ b/library/cpp/monlib/encode/json/json_decoder.cpp @@ -167,7 +167,7 @@ class TLogHistogramBuilder { double Base_ = 1.5; ui64 ZerosCount_ = 0; int StartPower_ = 0; - TVector Buckets_; + std::vector Buckets_; }; std::pair ParseSpecDouble(TStringBuf string) { @@ -192,7 +192,7 @@ struct TMetricCollector { TSummaryDoubleBuilder SummaryBuilder; TLogHistogramBuilder LogHistBuilder; TTypedPoint LastPoint; - TVector TimeSeries; + std::vector TimeSeries; bool SeenTsOrValue = false; bool SeenTimeseries = false; diff --git a/library/cpp/monlib/encode/json/json_decoder_ut.cpp b/library/cpp/monlib/encode/json/json_decoder_ut.cpp index 4464e1d26a4..a1216f337a8 100644 --- a/library/cpp/monlib/encode/json/json_decoder_ut.cpp +++ b/library/cpp/monlib/encode/json/json_decoder_ut.cpp @@ -59,7 +59,7 @@ void ValidateCommonParts(TCommonParts&& commonParts, bool checkLabels, bool chec } } -void ValidateMetrics(const TVector& metrics) { +void ValidateMetrics(const std::vector& metrics) { UNIT_ASSERT_VALUES_EQUAL(metrics.size(), 1); auto& m = metrics[0]; diff --git a/library/cpp/monlib/encode/json/json_ut.cpp b/library/cpp/monlib/encode/json/json_ut.cpp index 49de352062b..fb5e7042621 100644 --- a/library/cpp/monlib/encode/json/json_ut.cpp +++ b/library/cpp/monlib/encode/json/json_ut.cpp @@ -36,7 +36,7 @@ namespace { return {elem.GetName(), elem.GetValue()}; }); - TVector diff; + std::vector diff; SetSymmetricDifference(std::begin(expectedSet), std::end(expectedSet), std::begin(actualSet), std::end(actualSet), std::back_inserter(diff)); @@ -242,7 +242,7 @@ Y_UNIT_TEST_SUITE(TJsonTest) { } TLogHistogramSnapshotPtr TestLogHistogram(ui32 v = 1) { - TVector buckets{0.5 * v, 0.25 * v, 0.25 * v, 0.5 * v}; + std::vector buckets{0.5 * v, 0.25 * v, 0.25 * v, 0.5 * v}; return MakeIntrusive(1.5, 1u, 0, std::move(buckets)); } diff --git a/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp b/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp index 384ef456dd1..1d3c57b0e76 100644 --- a/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp +++ b/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp @@ -68,12 +68,12 @@ namespace NMonitoring { << " exceeds the limit which is " << HumanReadableSize(LABEL_SIZE_LIMIT, SF_BYTES)); // (2) read string pools - TVector namesBuf(Header_.LabelNamesSize); + std::vector namesBuf(Header_.LabelNamesSize); readBytes = In_->Load(namesBuf.data(), namesBuf.size()); DECODE_ENSURE(readBytes == Header_.LabelNamesSize, "not enough data to read label names pool"); TStringPool labelNames(namesBuf.data(), namesBuf.size()); - TVector valuesBuf(Header_.LabelValuesSize); + std::vector valuesBuf(Header_.LabelValuesSize); readBytes = In_->Load(valuesBuf.data(), valuesBuf.size()); DECODE_ENSURE(readBytes == Header_.LabelValuesSize, "not enough data to read label values pool"); TStringPool labelValues(valuesBuf.data(), valuesBuf.size()); @@ -202,7 +202,7 @@ namespace NMonitoring { // and https://a.yandex-team.ru/arc/trunk/arcadia/infra/yasm/common/points/hgram/normal/normal.h?rev=r8268697#L9 // TODO: share this constant value Y_ENSURE(count <= 100u, "more than 100 buckets in log histogram: " << count); - TVector buckets; + std::vector buckets; buckets.reserve(count); for (ui32 i = 0; i < count; ++i) { buckets.emplace_back(ReadFixed()); diff --git a/library/cpp/monlib/encode/spack/spack_v1_ut.cpp b/library/cpp/monlib/encode/spack/spack_v1_ut.cpp index fe778eb7e02..9bd93e2cc07 100644 --- a/library/cpp/monlib/encode/spack/spack_v1_ut.cpp +++ b/library/cpp/monlib/encode/spack/spack_v1_ut.cpp @@ -253,7 +253,7 @@ Y_UNIT_TEST_SUITE(TSpackTest) { } TLogHistogramSnapshotPtr TestLogHistogram() { - TVector buckets{0.5, 0.25, 0.25, 0.5}; + std::vector buckets{0.5, 0.25, 0.25, 0.5}; return MakeIntrusive(1.5, 1u, 0, std::move(buckets)); } diff --git a/library/cpp/monlib/metrics/atomics_array.h b/library/cpp/monlib/metrics/atomics_array.h index 876c167938b..3df4737fe08 100644 --- a/library/cpp/monlib/metrics/atomics_array.h +++ b/library/cpp/monlib/metrics/atomics_array.h @@ -1,7 +1,7 @@ #pragma once #include -#include + #include @@ -37,8 +37,9 @@ namespace NMonitoring { } } - TVector Copy() const { - TVector copy(Reserve(Size_)); + [[nodiscard]] std::vector Copy() const { + std::vector copy; + copy.reserve(Size_); for (size_t i = 0; i < Size_; i++) { copy.push_back(Values_[i].load(std::memory_order_relaxed)); } diff --git a/library/cpp/monlib/metrics/ewma_ut.cpp b/library/cpp/monlib/metrics/ewma_ut.cpp index d7ff566c708..b76b3f87362 100644 --- a/library/cpp/monlib/metrics/ewma_ut.cpp +++ b/library/cpp/monlib/metrics/ewma_ut.cpp @@ -21,7 +21,7 @@ Y_UNIT_TEST_SUITE(TEwmaTest) { ewma->Update(3); ewma->Tick(); - TVector expectedValues { + std::vector expectedValues { 0.6, 0.22072766, 0.08120117, @@ -53,7 +53,7 @@ Y_UNIT_TEST_SUITE(TEwmaTest) { ewma->Update(3); ewma->Tick(); - TVector expectedValues { + std::vector expectedValues { 0.6, 0.49123845, 0.40219203, @@ -85,7 +85,7 @@ Y_UNIT_TEST_SUITE(TEwmaTest) { ewma->Update(3); ewma->Tick(); - TVector expectedValues { + std::vector expectedValues { 0.6, 0.56130419, 0.52510399, diff --git a/library/cpp/monlib/metrics/histogram_collector_explicit.cpp b/library/cpp/monlib/metrics/histogram_collector_explicit.cpp index a567573a022..914529d5e60 100644 --- a/library/cpp/monlib/metrics/histogram_collector_explicit.cpp +++ b/library/cpp/monlib/metrics/histogram_collector_explicit.cpp @@ -2,7 +2,7 @@ #include "atomics_array.h" #include -#include + #include #include diff --git a/library/cpp/monlib/metrics/histogram_collector_exponential.cpp b/library/cpp/monlib/metrics/histogram_collector_exponential.cpp index c6bbfcfc697..e696d4c32bc 100644 --- a/library/cpp/monlib/metrics/histogram_collector_exponential.cpp +++ b/library/cpp/monlib/metrics/histogram_collector_exponential.cpp @@ -2,7 +2,7 @@ #include "atomics_array.h" #include -#include + #include #include diff --git a/library/cpp/monlib/metrics/histogram_collector_linear.cpp b/library/cpp/monlib/metrics/histogram_collector_linear.cpp index 83424853209..2c708bc9e4f 100644 --- a/library/cpp/monlib/metrics/histogram_collector_linear.cpp +++ b/library/cpp/monlib/metrics/histogram_collector_linear.cpp @@ -2,7 +2,7 @@ #include "atomics_array.h" #include -#include + #include #include diff --git a/library/cpp/monlib/metrics/histogram_snapshot.h b/library/cpp/monlib/metrics/histogram_snapshot.h index 6cd9f1dab5f..a7f9411eabb 100644 --- a/library/cpp/monlib/metrics/histogram_snapshot.h +++ b/library/cpp/monlib/metrics/histogram_snapshot.h @@ -2,20 +2,20 @@ #include #include -#include + #include #include #include - +#include namespace NMonitoring { using TBucketBound = double; using TBucketValue = ui64; - using TBucketBounds = TVector; - using TBucketValues = TVector; + using TBucketBounds = std::vector; + using TBucketValues = std::vector; constexpr ui32 HISTOGRAM_MAX_BUCKETS_COUNT = 51; constexpr TBucketBound HISTOGRAM_INF_BOUND = std::numeric_limits::max(); diff --git a/library/cpp/monlib/metrics/labels.cpp b/library/cpp/monlib/metrics/labels.cpp index 1eaadb7cba0..f8298f2807c 100644 --- a/library/cpp/monlib/metrics/labels.cpp +++ b/library/cpp/monlib/metrics/labels.cpp @@ -51,7 +51,7 @@ namespace NMonitoring { } bool ok = true; - TVector> rawLabels; + std::vector> rawLabels; StringSplitter(sb).SplitBySet(" ,").SkipEmpty().Consume([&] (TStringBuf label) { TStringBuf key, value; ok &= label.TrySplit('=', key, value); diff --git a/library/cpp/monlib/metrics/labels.h b/library/cpp/monlib/metrics/labels.h index 1f86e7ffafc..89bcd6c611b 100644 --- a/library/cpp/monlib/metrics/labels.h +++ b/library/cpp/monlib/metrics/labels.h @@ -5,7 +5,7 @@ #include #include #include -#include + #include #include #include @@ -381,16 +381,16 @@ namespace NMonitoring { using const_iterator = iterator; protected: - TVector>& AsVector() { + std::vector>& AsVector() { return Labels_; } - const TVector>& AsVector() const { + const std::vector>& AsVector() const { return Labels_; } private: - TVector> Labels_; + std::vector> Labels_; }; using TLabels = TLabelsImpl; diff --git a/library/cpp/monlib/metrics/labels_ut.cpp b/library/cpp/monlib/metrics/labels_ut.cpp index f0e4f532aba..d5909fd8f22 100644 --- a/library/cpp/monlib/metrics/labels_ut.cpp +++ b/library/cpp/monlib/metrics/labels_ut.cpp @@ -124,12 +124,12 @@ Y_UNIT_TEST_SUITE(TLabelsTest) { UNIT_ASSERT_EQUAL(labels[0], TLabel("name1", "value1")); UNIT_ASSERT_EQUAL(labels[1], TLabel("name2", "value2")); - TVector labelsCopy; + std::vector labelsCopy; for (auto&& label : labels) { labelsCopy.emplace_back(label.Name(), label.Value()); } - UNIT_ASSERT_EQUAL(labelsCopy, TVector({ + UNIT_ASSERT_EQUAL(labelsCopy, std::vector({ {"name1", "value1"}, {"name2", "value2"}, })); diff --git a/library/cpp/monlib/metrics/log_histogram_collector.h b/library/cpp/monlib/metrics/log_histogram_collector.h index 30beaa19083..427e73923bc 100644 --- a/library/cpp/monlib/metrics/log_histogram_collector.h +++ b/library/cpp/monlib/metrics/log_histogram_collector.h @@ -43,7 +43,7 @@ namespace NMonitoring { private: int StartPower_; ui64 CountZero_; - TVector Buckets_; + std::vector Buckets_; mutable std::mutex Mutex_; static constexpr size_t MAX_BUCKETS = LOG_HIST_MAX_BUCKETS; diff --git a/library/cpp/monlib/metrics/log_histogram_snapshot.h b/library/cpp/monlib/metrics/log_histogram_snapshot.h index 7673b43751e..012f6da9cc1 100644 --- a/library/cpp/monlib/metrics/log_histogram_snapshot.h +++ b/library/cpp/monlib/metrics/log_histogram_snapshot.h @@ -1,8 +1,8 @@ #pragma once #include -#include +#include #include namespace NMonitoring { @@ -11,7 +11,7 @@ namespace NMonitoring { class TLogHistogramSnapshot: public TAtomicRefCount { public: - TLogHistogramSnapshot(double base, ui64 zerosCount, int startPower, TVector buckets) + TLogHistogramSnapshot(double base, ui64 zerosCount, int startPower, std::vector buckets) : Base_(base) , ZerosCount_(zerosCount) , StartPower_(startPower) @@ -62,7 +62,7 @@ namespace NMonitoring { double Base_; ui64 ZerosCount_; int StartPower_; - TVector Buckets_; + std::vector Buckets_; }; using TLogHistogramSnapshotPtr = TIntrusivePtr; diff --git a/library/cpp/monlib/metrics/metric_registry.cpp b/library/cpp/monlib/metrics/metric_registry.cpp index c747ae2b74f..029ab2deef5 100644 --- a/library/cpp/monlib/metrics/metric_registry.cpp +++ b/library/cpp/monlib/metrics/metric_registry.cpp @@ -227,7 +227,7 @@ namespace NMonitoring { consumer->OnLabelsEnd(); } - TVector> tmpMetrics; + std::vector> tmpMetrics; { TReadGuard g{*Lock_}; diff --git a/library/cpp/monlib/metrics/metric_value.h b/library/cpp/monlib/metrics/metric_value.h index be9d3e68dda..29a26d7512f 100644 --- a/library/cpp/monlib/metrics/metric_value.h +++ b/library/cpp/monlib/metrics/metric_value.h @@ -7,7 +7,7 @@ #include #include -#include + #include #include @@ -476,7 +476,7 @@ namespace NMonitoring { private: EMetricValueType ValueType_ = EMetricValueType::UNKNOWN; - TVector Points_; + std::vector Points_; }; template @@ -497,7 +497,7 @@ namespace NMonitoring { } template - static void EraseDuplicates(TVector& points) { + static void EraseDuplicates(std::vector& points) { // we have to manually clean reference to a snapshot from point // while removing duplicates auto result = points.rbegin(); @@ -517,7 +517,7 @@ namespace NMonitoring { } template - void SortPointsByTs(EMetricValueType valueType, TVector& points) { + void SortPointsByTs(EMetricValueType valueType, std::vector& points) { if (points.size() < 2) { return; } diff --git a/library/cpp/monlib/metrics/metric_value_ut.cpp b/library/cpp/monlib/metrics/metric_value_ut.cpp index 49b47c40574..710ad66d9c7 100644 --- a/library/cpp/monlib/metrics/metric_value_ut.cpp +++ b/library/cpp/monlib/metrics/metric_value_ut.cpp @@ -37,7 +37,7 @@ Y_UNIT_TEST_SUITE(TMetricValueTest) { } TLogHistogramSnapshotPtr MakeLogHistogram(ui64 count = 0) { - TVector buckets; + std::vector buckets; for (ui64 i = 0; i < count; ++i) { buckets.push_back(i); } diff --git a/library/cpp/monlib/metrics/summary_collector_ut.cpp b/library/cpp/monlib/metrics/summary_collector_ut.cpp index 191929550f7..17459bba23a 100644 --- a/library/cpp/monlib/metrics/summary_collector_ut.cpp +++ b/library/cpp/monlib/metrics/summary_collector_ut.cpp @@ -11,7 +11,7 @@ namespace NMonitoring { Y_UNIT_TEST_SUITE(SummaryCollectorTest) { - void CheckSnapshot(ISummaryDoubleSnapshotPtr snapshot, const TVector values) { + void CheckSnapshot(ISummaryDoubleSnapshotPtr snapshot, const std::vector values) { const double eps = 1e-9; double sum = std::accumulate(values.begin(), values.end(), 0.0); @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(SummaryCollectorTest) { Y_UNIT_TEST(Simple) { { - TVector test{05, -1.5, 0.0, 2.5, 0.25, -1.0}; + std::vector test{05, -1.5, 0.0, 2.5, 0.25, -1.0}; TSummaryDoubleCollector summary; for (auto value : test) { summary.Collect(value); @@ -37,7 +37,7 @@ Y_UNIT_TEST_SUITE(SummaryCollectorTest) { CheckSnapshot(summary.Snapshot(), test); } { - TVector test{-1.0, 1.0, 9.0, -5000.0, 5000.0, 5.0, -5.0}; + std::vector test{-1.0, 1.0, 9.0, -5000.0, 5000.0, 5.0, -5.0}; TSummaryDoubleCollector summary; for (auto value : test) { summary.Collect(value); @@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(SummaryCollectorTest) { const ui32 attemts = 100; for (ui32 i = 0; i < attemts; ++i) { const ui32 size = 100; - TVector values(size); + std::vector values(size); TSummaryDoubleCollector summary; for (auto& value : values) { value = RandomNumber() - 0.5; diff --git a/library/cpp/monlib/metrics/timer_ut.cpp b/library/cpp/monlib/metrics/timer_ut.cpp index c244a8c9e12..8fa7d33172e 100644 --- a/library/cpp/monlib/metrics/timer_ut.cpp +++ b/library/cpp/monlib/metrics/timer_ut.cpp @@ -95,7 +95,7 @@ Y_UNIT_TEST_SUITE(TTimerTest) { Y_UNIT_TEST(Histogram) { TTestClock::TimePoint = TTestClock::time_point::min(); - auto assertHistogram = [](const TVector& expected, IHistogramSnapshotPtr snapshot) { + auto assertHistogram = [](const std::vector& expected, IHistogramSnapshotPtr snapshot) { UNIT_ASSERT_EQUAL(expected.size(), snapshot->Count()); for (size_t i = 0; i < expected.size(); ++i) { UNIT_ASSERT_EQUAL(expected[i], snapshot->Value(i)); diff --git a/library/cpp/monlib/service/pages/mon_page.cpp b/library/cpp/monlib/service/pages/mon_page.cpp index 929c54b084c..2f83d59e5be 100644 --- a/library/cpp/monlib/service/pages/mon_page.cpp +++ b/library/cpp/monlib/service/pages/mon_page.cpp @@ -11,7 +11,7 @@ IMonPage::IMonPage(const TString& path, const TString& title) } void IMonPage::OutputNavBar(IOutputStream& out) { - TVector parents; + std::vector parents; for (const IMonPage* p = this; p; p = p->Parent) { parents.push_back(p); } diff --git a/library/cpp/openssl/init/init.cpp b/library/cpp/openssl/init/init.cpp index ae68ef08eaa..14ed21cbc89 100644 --- a/library/cpp/openssl/init/init.cpp +++ b/library/cpp/openssl/init/init.cpp @@ -1,7 +1,7 @@ #include "init.h" #include -#include + #include #include @@ -18,6 +18,7 @@ #include #include #include +#include namespace { struct TInitSsl { @@ -40,7 +41,7 @@ namespace { } } - TVector> Mutexes; + std::vector> Mutexes; }; inline TInitSsl() { diff --git a/library/cpp/resource/resource.cpp b/library/cpp/resource/resource.cpp index f21c629d187..f1821d450ca 100644 --- a/library/cpp/resource/resource.cpp +++ b/library/cpp/resource/resource.cpp @@ -52,8 +52,9 @@ TStringBuf NResource::KeyByIndex(size_t idx) { return CommonStore()->KeyByIndex(idx); } -TVector NResource::ListAllKeys() { - TVector res(Reserve(NResource::Count())); +std::vector NResource::ListAllKeys() { + std::vector res; + res.reserve(NResource::Count()); for (auto i : xrange(NResource::Count())) { res.push_back(NResource::KeyByIndex(i)); } diff --git a/library/cpp/resource/resource.h b/library/cpp/resource/resource.h index 335074104a2..ff20110bf4c 100644 --- a/library/cpp/resource/resource.h +++ b/library/cpp/resource/resource.h @@ -2,7 +2,7 @@ #include #include -#include +#include namespace NResource { struct TResource { @@ -10,7 +10,7 @@ namespace NResource { TString Data; }; - typedef TVector TResources; + typedef std::vector TResources; bool Has(const TStringBuf key); TString Find(const TStringBuf key); @@ -19,5 +19,5 @@ namespace NResource { void FindMatch(const TStringBuf subkey, TResources* out); size_t Count() noexcept; TStringBuf KeyByIndex(size_t idx); - TVector ListAllKeys(); + std::vector ListAllKeys(); } diff --git a/library/cpp/string_utils/base64/base64_ut.cpp b/library/cpp/string_utils/base64/base64_ut.cpp index 83775f072c2..42a2e214613 100644 --- a/library/cpp/string_utils/base64/base64_ut.cpp +++ b/library/cpp/string_utils/base64/base64_ut.cpp @@ -9,7 +9,7 @@ #include -#include + #include #include #include @@ -400,7 +400,7 @@ Y_UNIT_TEST_SUITE(TBase64) { constexpr size_t TEST_CASES_COUNT = 1000; constexpr size_t MAX_DATA_SIZE = 1000; TFastRng prng{42}; - TVector xs{TEST_CASES_COUNT}; + std::vector xs{TEST_CASES_COUNT}; TString xEnc; TString xDec; TString yEnc; @@ -445,7 +445,7 @@ Y_UNIT_TEST_SUITE(TBase64) { constexpr size_t MAX_DATA_SIZE = 1000; TFastRng prng{42}; TString x; - TVector buf; + std::vector buf; for (size_t i = 0; i < TEST_CASES_COUNT; ++i) { const size_t size = prng() % MAX_DATA_SIZE; x.clear(); @@ -522,7 +522,7 @@ Y_UNIT_TEST_SUITE(TBase64) { Y_UNIT_TEST(TestDecodeUnevenDst) { const auto x = "How do I convert between big-endian and little-endian values in C++?aa"; TString b64 = "SG93IGRvIEkgY29udmVydCBiZXR3ZWVuIGJpZy1lbmRpYW4gYW5kIGxpdHRsZS1lbmRpYW4gdmFsdWVzIGluIEMrKz9hYQ"; - TVector buf(Base64DecodeBufSize(b64.Size()), '\0'); + std::vector buf(Base64DecodeBufSize(b64.Size()), '\0'); Base64DecodeUneven(buf.begin(), b64); TString res(buf.data()); UNIT_ASSERT_VALUES_EQUAL(x, res); @@ -531,7 +531,7 @@ Y_UNIT_TEST_SUITE(TBase64) { Y_UNIT_TEST(TestDecodeUnevenDst2) { const auto x = "How do I convert between big-endian and little-endian values in C++?"; TString b64 = "SG93IGRvIEkgY29udmVydCBiZXR3ZWVuIGJpZy1lbmRpYW4gYW5kIGxpdHRsZS1lbmRpYW4gdmFsdWVzIGluIEMrKz8"; - TVector buf(Base64DecodeBufSize(b64.Size()), '\0'); + std::vector buf(Base64DecodeBufSize(b64.Size()), '\0'); Base64DecodeUneven(buf.begin(), b64); TString res(buf.data()); UNIT_ASSERT_VALUES_EQUAL(x, res); diff --git a/library/cpp/string_utils/base64/bench/main.cpp b/library/cpp/string_utils/base64/bench/main.cpp index 10e09bc1c75..fd53fa406d5 100644 --- a/library/cpp/string_utils/base64/bench/main.cpp +++ b/library/cpp/string_utils/base64/bench/main.cpp @@ -5,7 +5,7 @@ #include #include #include -#include + #include #include #include diff --git a/library/cpp/testing/common/network.cpp b/library/cpp/testing/common/network.cpp index 9f018f69b72..45ccc25c505 100644 --- a/library/cpp/testing/common/network.cpp +++ b/library/cpp/testing/common/network.cpp @@ -4,7 +4,7 @@ #include #include #include -#include + #include #include #include @@ -70,9 +70,9 @@ namespace { return pair; } - TVector> GetPortRanges() { + std::vector> GetPortRanges() { TString givenRange = GetEnv("VALID_PORT_RANGE"); - TVector> ranges; + std::vector> ranges; if (givenRange.Contains(':')) { auto res = StringSplitter(givenRange).Split(':').Limit(2).ToList(); ranges.emplace_back(FromString(res.front()), FromString(res.back())); @@ -140,9 +140,10 @@ namespace { Y_ABORT("Cannot get free port!"); } - TVector GetFreePortsRange(size_t count) const { + std::vector GetFreePortsRange(size_t count) const { Y_ABORT_UNLESS(count > 0); - TVector ports(Reserve(count)); + std::vector ports; + ports.reserve(count); for (size_t i = 0; i < Retries; ++i) { for (auto[left, right] : Ranges_) { if (right - left < count) { @@ -202,7 +203,7 @@ namespace { private: TFsPath SyncDir_; - TVector> Ranges_; + std::vector> Ranges_; size_t TotalCount_; bool DisableRandomPorts_; }; @@ -221,7 +222,7 @@ namespace NTesting { TPortHolder GetPort( ui16 port ) { return Singleton()->GetPort(port); } - TVector GetFreePortsRange(size_t count) { + std::vector GetFreePortsRange(size_t count) { return Singleton()->GetFreePortsRange(count); } } diff --git a/library/cpp/testing/common/network.h b/library/cpp/testing/common/network.h index 4107145a7cc..12cbb304e7c 100644 --- a/library/cpp/testing/common/network.h +++ b/library/cpp/testing/common/network.h @@ -1,7 +1,7 @@ #pragma once #include -#include + namespace NTesting { @@ -35,7 +35,7 @@ namespace NTesting { namespace NLegacy { // Do not use these methods made for Unittest TPortManager backward compatibility. // Returns continuous sequence of the specified number of ports. - [[nodiscard]] TVector GetFreePortsRange(size_t count); + [[nodiscard]] std::vector GetFreePortsRange(size_t count); //@brief Returns port from parameter if NO_RANDOM_PORTS env var is set, otherwise first free port [[nodiscard]] TPortHolder GetPort(ui16 port); } diff --git a/library/cpp/testing/common/scope.h b/library/cpp/testing/common/scope.h index a2ca0e77e4c..4c1cd83d7ac 100644 --- a/library/cpp/testing/common/scope.h +++ b/library/cpp/testing/common/scope.h @@ -1,10 +1,11 @@ #pragma once #include -#include + #include #include +#include namespace NTesting { // @brief Assigns new values to the given environment variables and restores old values upon destruction. @@ -16,9 +17,10 @@ namespace NTesting { ::SetEnv(name, value); } - TScopedEnvironment(const TVector>& vars) - : PreviousState(Reserve(vars.size())) + TScopedEnvironment(const std::vector>& vars) + : PreviousState{} { + PreviousState.reserve(vars.size()); for (const auto& [k, v] : vars) { PreviousState.emplace_back(k, ::GetEnv(k)); ::SetEnv(k, v); @@ -34,6 +36,6 @@ namespace NTesting { TScopedEnvironment(const TScopedEnvironment&) = delete; TScopedEnvironment& operator=(const TScopedEnvironment&) = delete; private: - TVector> PreviousState; + std::vector> PreviousState; }; } diff --git a/library/cpp/testing/common/ut/network_ut.cpp b/library/cpp/testing/common/ut/network_ut.cpp index 2016e26b092..9f3fda21917 100644 --- a/library/cpp/testing/common/ut/network_ut.cpp +++ b/library/cpp/testing/common/ut/network_ut.cpp @@ -16,7 +16,8 @@ static TTempDir TmpDir; TEST(NetworkTest, FreePort) { NTesting::TScopedEnvironment envGuard("PORT_SYNC_PATH", TmpDir.Name()); NTesting::InitPortManagerFromEnv(); - TVector ports(Reserve(100)); + std::vector ports; + ports.reserve(100); for (size_t i = 0; i < 100; ++i) { ports.push_back(NTesting::GetFreePort()); @@ -77,7 +78,8 @@ TEST(NetworkTest, GetPortNonRandom) { }}; NTesting::InitPortManagerFromEnv(); - TVector ports(Reserve(100)); // keep integers, we don't need the ports to remain allocated + std::vector ports; // keep integers, we don't need the ports to remain allocated + ports.reserve(100); for (size_t i = 0; i < 10; ++i) { auto portHolder = NTesting::GetFreePort(); @@ -97,7 +99,7 @@ TEST(FreePortTest, FreePortsRange) { NTesting::InitPortManagerFromEnv(); for (ui16 i = 2; i < 10; ++i) { - TVector ports = NTesting::NLegacy::GetFreePortsRange(i); + std::vector ports = NTesting::NLegacy::GetFreePortsRange(i); ASSERT_EQ(i, ports.size()); for (ui16 j = 1; j < i; ++j) { EXPECT_EQ(static_cast(ports[j]), static_cast(ports[0]) + j); diff --git a/library/cpp/testing/common/ut/scope_ut.cpp b/library/cpp/testing/common/ut/scope_ut.cpp index 4fb82c2466d..3e9be8e7a67 100644 --- a/library/cpp/testing/common/ut/scope_ut.cpp +++ b/library/cpp/testing/common/ut/scope_ut.cpp @@ -14,7 +14,7 @@ TEST(TScopedEnvironment, SingleValue) { } TEST(TScopedEnvironment, MultiValue) { - TVector before{GetEnv("ARCADIA_SOURCE_ROOT"), GetEnv("ARCADIA_BUILD_ROOT")}; + std::vector before{GetEnv("ARCADIA_SOURCE_ROOT"), GetEnv("ARCADIA_BUILD_ROOT")}; { NTesting::TScopedEnvironment guard{{ {"ARCADIA_SOURCE_ROOT", "source"}, @@ -23,6 +23,6 @@ TEST(TScopedEnvironment, MultiValue) { EXPECT_EQ("source", GetEnv("ARCADIA_SOURCE_ROOT")); EXPECT_EQ("build", GetEnv("ARCADIA_BUILD_ROOT")); } - TVector after{GetEnv("ARCADIA_SOURCE_ROOT"), GetEnv("ARCADIA_BUILD_ROOT")}; + std::vector after{GetEnv("ARCADIA_SOURCE_ROOT"), GetEnv("ARCADIA_BUILD_ROOT")}; EXPECT_EQ(before, after); } diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index ebad1ea4d67..c2e38679506 100644 --- a/library/cpp/testing/unittest/gtest.cpp +++ b/library/cpp/testing/unittest/gtest.cpp @@ -2,7 +2,7 @@ #include "simple.h" #include -#include + #include using namespace NUnitTest; diff --git a/library/cpp/testing/unittest/junit.h b/library/cpp/testing/unittest/junit.h index 3a9a9658906..567558f08e1 100644 --- a/library/cpp/testing/unittest/junit.h +++ b/library/cpp/testing/unittest/junit.h @@ -20,7 +20,7 @@ class TJUnitProcessor : public ITestSuiteProcessor { struct TTestCase { TString Name; bool Success; - TVector Failures; + std::vector Failures; TString StdOut; TString StdErr; double DurationSecods = 0.0; diff --git a/library/cpp/testing/unittest/plugin.cpp b/library/cpp/testing/unittest/plugin.cpp index 543112f7ac6..9eab925af82 100644 --- a/library/cpp/testing/unittest/plugin.cpp +++ b/library/cpp/testing/unittest/plugin.cpp @@ -1,50 +1,48 @@ #include "plugin.h" #include -#include #include - -namespace NUnitTest { - namespace NPlugin { - namespace { - class TPlugins { - public: - void OnStartMain(int argc, char* argv[]) const { - for (const auto& plugin : Plugins) { - plugin->OnStartMain(argc, argv); - } - } - - void OnStopMain(int argc, char* argv[]) const { - for (const auto& plugin : Plugins) { - plugin->OnStopMain(argc, argv); - } +#include + +namespace NUnitTest::NPlugin { + namespace { + class TPlugins { + public: + void OnStartMain(int argc, char* argv[]) const { + for (const auto& plugin : Plugins) { + plugin->OnStartMain(argc, argv); } + } - void Register(TSimpleSharedPtr plugin) { - Plugins.emplace_back(std::move(plugin)); + void OnStopMain(int argc, char* argv[]) const { + for (const auto& plugin : Plugins) { + plugin->OnStopMain(argc, argv); } + } - static TPlugins& Instance() { - return *Singleton(); - } + void Register(TSimpleSharedPtr plugin) { + Plugins.emplace_back(std::move(plugin)); + } - private: - TVector> Plugins; - }; - } // anonymous namespace + static TPlugins& Instance() { + return *Singleton(); + } - TPluginRegistrator::TPluginRegistrator(TSimpleSharedPtr plugin) { - TPlugins::Instance().Register(std::move(plugin)); - } + private: + std::vector> Plugins; + }; + } // anonymous namespace - void OnStartMain(int argc, char* argv[]) { - TPlugins::Instance().OnStartMain(argc, argv); - } + TPluginRegistrator::TPluginRegistrator(TSimpleSharedPtr plugin) { + TPlugins::Instance().Register(std::move(plugin)); + } - void OnStopMain(int argc, char* argv[]) { - TPlugins::Instance().OnStopMain(argc, argv); - } + void OnStartMain(int argc, char* argv[]) { + TPlugins::Instance().OnStartMain(argc, argv); + } + void OnStopMain(int argc, char* argv[]) { + TPlugins::Instance().OnStopMain(argc, argv); } -} + +} \ No newline at end of file diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp index 675d1f60030..825f779a6c7 100644 --- a/library/cpp/testing/unittest/registar.cpp +++ b/library/cpp/testing/unittest/registar.cpp @@ -144,7 +144,7 @@ TString NUnitTest::GetResetTag() { TString NUnitTest::ColoredDiff(TStringBuf s1, TStringBuf s2, const TString& delims, bool reverse) { TStringStream res; - TVector> chunks; + std::vector> chunks; NDiff::InlineDiff(chunks, s1, s2, delims); if (NUnitTest::ShouldColorizeDiff) { NDiff::PrintChunks(res, TDiffColorizer(reverse), chunks); @@ -381,7 +381,7 @@ void NUnitTest::TTestBase::BeforeTest() { void NUnitTest::TTestBase::AfterTest() { TearDown(); - TVector> afterTestFunctions; + std::vector> afterTestFunctions; with_lock (AfterTestFunctionsLock_) { afterTestFunctions.swap(AfterTestFunctions_); } diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 312796ccf03..560c1c88a59 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -10,7 +10,7 @@ #include #include #include -#include + #include #include @@ -254,7 +254,7 @@ namespace NUnitTest { size_t TestErrors_; const char* CurrentSubtest_; TAdaptiveLock AfterTestFunctionsLock_; - TVector> AfterTestFunctions_; + std::vector> AfterTestFunctions_; }; #define UNIT_TEST_SUITE(N) \ @@ -929,7 +929,7 @@ public: \ class TCurrentTest: public T { \ private: \ typedef std::function()> TTestCaseFactory; \ - typedef TVector TTests; \ + typedef std::vector TTests; \ \ static TTests& Tests() { \ static TTests tests; \ diff --git a/library/cpp/testing/unittest/simple.h b/library/cpp/testing/unittest/simple.h index 2a5300d886e..819932315e9 100644 --- a/library/cpp/testing/unittest/simple.h +++ b/library/cpp/testing/unittest/simple.h @@ -4,7 +4,7 @@ namespace NUnitTest { struct TSimpleTestExecutor: public TTestBase { - typedef TVector TTests; + typedef std::vector TTests; TTests Tests; diff --git a/library/cpp/testing/unittest/tests_data.cpp b/library/cpp/testing/unittest/tests_data.cpp index b51cbc4b87c..43cd211dcdb 100644 --- a/library/cpp/testing/unittest/tests_data.cpp +++ b/library/cpp/testing/unittest/tests_data.cpp @@ -65,7 +65,7 @@ class TPortManager::TPortManagerImpl { private: TMutex Lock; - TVector> ReservedPorts; + std::vector> ReservedPorts; const bool EnableReservePortsForCurrentTest; const bool DisableRandomPorts; }; diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp index 0e383e5f38a..f37a471836f 100644 --- a/library/cpp/testing/unittest/utmain.cpp +++ b/library/cpp/testing/unittest/utmain.cpp @@ -130,7 +130,7 @@ class TTraceWriterProcessor: public ITestSuiteProcessor { TAutoPtr TraceFile; TString TraceFilePath; TInstant PrevTime; - TVector ErrorMessages; + std::vector ErrorMessages; inline void Trace(const TString eventName, const NJson::TJsonValue eventValue) { NJsonWriter::TBuf json(NJsonWriter::HEM_UNSAFE); @@ -587,7 +587,7 @@ class TColoredProcessor: public ITestSuiteProcessor, public NColorizer::TColors THashSet EnabledTests_; TInstant PrevTime_; bool ShowFails; - TVector Fails; + std::vector Fails; size_t Start; size_t End; TString AppName; diff --git a/library/cpp/threading/chunk_queue/queue.h b/library/cpp/threading/chunk_queue/queue.h index feee776b872..5b5a1ae2047 100644 --- a/library/cpp/threading/chunk_queue/queue.h +++ b/library/cpp/threading/chunk_queue/queue.h @@ -4,7 +4,7 @@ #include #include #include -#include + #include #include #include diff --git a/library/cpp/threading/equeue/equeue_ut.cpp b/library/cpp/threading/equeue/equeue_ut.cpp index 47b1029a2f9..7ad87d59179 100644 --- a/library/cpp/threading/equeue/equeue_ut.cpp +++ b/library/cpp/threading/equeue/equeue_ut.cpp @@ -5,7 +5,7 @@ #include #include -#include + Y_UNIT_TEST_SUITE(TElasticQueueTest) { const size_t MaxQueueSize = 20; @@ -139,7 +139,7 @@ Y_UNIT_TEST_SUITE(TElasticQueueTest) { { typename TEnv::TQueueSetup setup; - TVector< TAutoPtr > senders; + std::vector< TAutoPtr > senders; for (size_t i = 0; i < ThreadCount; ++i) { senders.push_back(::SystemThreadFactory()->Run(&sender)); } diff --git a/library/cpp/threading/equeue/fast/equeue.h b/library/cpp/threading/equeue/fast/equeue.h index 0a3ba47184d..195628d6416 100644 --- a/library/cpp/threading/equeue/fast/equeue.h +++ b/library/cpp/threading/equeue/fast/equeue.h @@ -5,7 +5,7 @@ #include #include #include -#include + #include #include @@ -143,7 +143,7 @@ class TFastElasticQueue alignas(64) std::atomic GuardCount_ = 0; alignas(64) std::atomic QueueSize_ = 0; - TVector> Threads_; + std::vector> Threads_; THolder> Queue_; NYT::NThreading::TEventCount Event_; diff --git a/library/cpp/threading/future/async_semaphore_ut.cpp b/library/cpp/threading/future/async_semaphore_ut.cpp index 9f8817ea9c1..c883cd62b06 100644 --- a/library/cpp/threading/future/async_semaphore_ut.cpp +++ b/library/cpp/threading/future/async_semaphore_ut.cpp @@ -5,7 +5,7 @@ #include #include -#include + #include using namespace NThreading; @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TSemaphoreAsync) { TSimpleThreadPool pool(TThreadPool::TParams().SetCatching(false)); pool.Start(MAX_IN_PROGRESS * 2); - TVector> futures; + std::vector> futures; auto semaphore = TAsyncSemaphore::Make(MAX_IN_PROGRESS); for (size_t i = 0; i < 100; ++i) { auto f = semaphore->AcquireAsync() @@ -62,7 +62,7 @@ Y_UNIT_TEST_SUITE(TSemaphoreAsync) { std::atomic_uint64_t inProgress = 0; - TVector> futures; + std::vector> futures; auto semaphore = TAsyncSemaphore::Make(MAX_IN_PROGRESS); for (size_t i = 0; i < 100; ++i) { auto f = semaphore->AcquireAsync() @@ -101,7 +101,7 @@ Y_UNIT_TEST_SUITE(TSemaphoreAsync) { std::atomic_size_t latestId = 0; - TVector> futures; + std::vector> futures; auto semaphore = TAsyncSemaphore::Make(MAX_IN_PROGRESS); for (size_t i = 0; i < 100; ++i) { auto f = semaphore->AcquireAsync() diff --git a/library/cpp/threading/future/async_ut.cpp b/library/cpp/threading/future/async_ut.cpp index a3699744e48..c3dd2c4b5b5 100644 --- a/library/cpp/threading/future/async_ut.cpp +++ b/library/cpp/threading/future/async_ut.cpp @@ -3,7 +3,7 @@ #include #include -#include + namespace { struct TMySuperTaskQueue { @@ -51,7 +51,7 @@ Y_UNIT_TEST_SUITE(Async) { NThreading::TFuture f1 = NThreading::Async([]() {}, *queue); NThreading::TFuture f2 = NThreading::Async([]() { return 5; }, *queue); NThreading::TFuture f3 = NThreading::Async([]() { return 5.0; }, *queue); - NThreading::TFuture> f4 = NThreading::Async([]() { return TVector(); }, *queue); + NThreading::TFuture> f4 = NThreading::Async([]() { return std::vector(); }, *queue); NThreading::TFuture f5 = NThreading::Async([]() { return NThreading::MakeFuture(5); }, *queue); } } diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index df6b7c21b2f..7eea6982814 100644 --- a/library/cpp/threading/future/core/future-inl.h +++ b/library/cpp/threading/future/core/future-inl.h @@ -12,7 +12,7 @@ namespace NThreading { using TCallback = std::function&)>; template - using TCallbackList = TVector>; // TODO: small vector + using TCallbackList = std::vector>; // TODO: small vector //////////////////////////////////////////////////////////////////////////////// @@ -158,7 +158,7 @@ namespace NThreading { readyEvent->Signal(); } - if (callbacks) { + if (!callbacks.empty()) { TFuture temp(this); for (auto& callback : callbacks) { callback(temp); @@ -197,7 +197,7 @@ namespace NThreading { readyEvent->Signal(); } - if (callbacks) { + if (!callbacks.empty()) { TFuture temp(this); for (auto& callback : callbacks) { callback(temp); @@ -344,7 +344,7 @@ namespace NThreading { readyEvent->Signal(); } - if (callbacks) { + if (!callbacks.empty()) { TFuture temp(this); for (auto& callback : callbacks) { callback(temp); @@ -383,7 +383,7 @@ namespace NThreading { readyEvent->Signal(); } - if (callbacks) { + if (!callbacks.empty()) { TFuture temp(this); for (auto& callback : callbacks) { callback(temp); diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index 598336282a0..9e8200b8e78 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -8,7 +8,7 @@ #include #include #include -#include + #include #include #include diff --git a/library/cpp/threading/future/future_mt_ut.cpp b/library/cpp/threading/future/future_mt_ut.cpp index 4f390866c11..cc90df03032 100644 --- a/library/cpp/threading/future/future_mt_ut.cpp +++ b/library/cpp/threading/future/future_mt_ut.cpp @@ -54,8 +54,8 @@ namespace { } template - TVector> ToFutures(const TVector>& promises) { - TVector> futures; + std::vector> ToFutures(const std::vector>& promises) { + std::vector> futures; for (auto&& p : promises) { futures.emplace_back(p); @@ -67,7 +67,7 @@ namespace { struct TStateSnapshot { i64 Started = -1; i64 StartedException = -1; - const TVector>* Futures = nullptr; + const std::vector>* Futures = nullptr; }; // note: std::memory_order_relaxed should be enough everywhere, because TFuture::SetValue must provide the @@ -88,7 +88,7 @@ namespace { std::atomic startedException = 0; std::atomic completed = 0; - TVector> promises; + std::vector> promises; for (auto i : xrange(numPromises)) { Y_UNUSED(i); promises.push_back(NewPromise()); diff --git a/library/cpp/threading/future/future_ut.cpp b/library/cpp/threading/future/future_ut.cpp index 26f8fa9e9c3..4d187dbd389 100644 --- a/library/cpp/threading/future/future_ut.cpp +++ b/library/cpp/threading/future/future_ut.cpp @@ -278,7 +278,7 @@ namespace { TPromise promise1 = NewPromise(); TPromise promise2 = NewPromise(); - TVector> promises; + std::vector> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -296,7 +296,7 @@ namespace { TPromise promise1 = NewPromise(); TPromise promise2 = NewPromise(); - TVector> promises; + std::vector> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -329,7 +329,7 @@ namespace { } Y_UNIT_TEST(ShouldWaitExceptionOrAllVectorEmpty) { - TVector> promises; + std::vector> promises; TFuture future = WaitExceptionOrAll(promises); UNIT_ASSERT(future.HasValue()); @@ -339,7 +339,7 @@ namespace { TPromise promise1 = NewPromise(); TPromise promise2 = NewPromise(); - TVector> promises; + std::vector> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -358,7 +358,7 @@ namespace { TPromise promise1 = NewPromise(); TPromise promise2 = NewPromise(); - TVector> promises; + std::vector> promises; promises.push_back(promise1); promises.push_back(promise2); @@ -391,7 +391,7 @@ namespace { } Y_UNIT_TEST(ShouldWaitAnyVectorEmpty) { - TVector> promises; + std::vector> promises; TFuture future = WaitAny(promises); UNIT_ASSERT(future.HasValue()); @@ -540,7 +540,7 @@ namespace { Y_UNIT_TEST(WaitAllowsExtract) { auto future = MakeFuture(42); - TVector vec{future, future, future}; + std::vector vec{future, future, future}; WaitExceptionOrAll(vec).GetValue(); WaitAny(vec).GetValue(); diff --git a/library/cpp/threading/future/wait/wait-inl.h b/library/cpp/threading/future/wait/wait-inl.h index 2753d5446cc..c0fbc0a4a41 100644 --- a/library/cpp/threading/future/wait/wait-inl.h +++ b/library/cpp/threading/future/wait/wait-inl.h @@ -7,8 +7,8 @@ namespace NThreading { namespace NImpl { template - TVector> ToVoidFutures(const TContainer& futures) { - TVector> voidFutures; + std::vector> ToVoidFutures(const TContainer& futures) { + std::vector> voidFutures; voidFutures.reserve(futures.size()); for (const auto& future: futures) { diff --git a/library/cpp/uri/benchmark/main.cpp b/library/cpp/uri/benchmark/main.cpp index 31c6a3be32c..862ea6d589c 100644 --- a/library/cpp/uri/benchmark/main.cpp +++ b/library/cpp/uri/benchmark/main.cpp @@ -2,7 +2,7 @@ #include -#include + const TString URLS[] = { "http://www.TEST.Ru:80/InDex.html", diff --git a/library/cpp/yson/detail.h b/library/cpp/yson/detail.h index 23971d2d698..7dbf8478aec 100644 --- a/library/cpp/yson/detail.h +++ b/library/cpp/yson/detail.h @@ -3,7 +3,7 @@ #include "public.h" #include "zigzag.h" -#include + #include #include #include @@ -375,7 +375,7 @@ namespace NYson { : public TCodedStream>> { private: using TBaseStream = TCodedStream>>; - TVector Buffer_; + std::vector Buffer_; TMaybe MemoryLimit_; void CheckMemoryLimit() { diff --git a/library/cpp/yson/json/json_writer.h b/library/cpp/yson/json/json_writer.h index d84ac0de530..ec5a5142398 100644 --- a/library/cpp/yson/json/json_writer.h +++ b/library/cpp/yson/json/json_writer.h @@ -5,7 +5,7 @@ #include -#include + namespace NYT { //////////////////////////////////////////////////////////////////////////////// @@ -78,7 +78,7 @@ namespace NYT { void LeaveNode(); bool IsWriteAllowed(); - TVector HasUnfoldedStructureStack; + std::vector HasUnfoldedStructureStack; int InAttributesBalance; bool HasAttributes; int Depth; diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 05459ed4724..a1096daa823 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -4,7 +4,7 @@ #include #include #include -#include + #include #include #include @@ -45,7 +45,7 @@ class TNode Null = 8 /*"null"*/, }; - using TListType = TVector; + using TListType = std::vector; using TMapType = THashMap; private: diff --git a/library/cpp/yson/node/node_visitor.cpp b/library/cpp/yson/node/node_visitor.cpp index 258afc21eaf..a92412e5822 100644 --- a/library/cpp/yson/node/node_visitor.cpp +++ b/library/cpp/yson/node/node_visitor.cpp @@ -13,7 +13,7 @@ template void Iterate(const TNode::TMapType& nodeMap, bool sortByKey, Fun action) { if (sortByKey) { - TVector iterators; + std::vector iterators; for (auto it = nodeMap.begin(); it != nodeMap.end(); ++it) { iterators.push_back(it); } diff --git a/tools/archiver/main.cpp b/tools/archiver/main.cpp index 6cda54c1ea8..558f5b2d5c6 100644 --- a/tools/archiver/main.cpp +++ b/tools/archiver/main.cpp @@ -6,7 +6,7 @@ #include #include #include -#include + #include #include #include @@ -241,14 +241,14 @@ namespace { void Finish() { Y_ENSURE(!InitialFillingDone); InitialFillingDone = true; - TMap> bySize; + TMap> bySize; for (const TString& fname: FileNames) { TFile file(fname, OpenExisting | RdOnly); bySize[file.GetLength()].push_back(fname); } for (const auto& bySizeElement: bySize) { if (bySizeElement.second.size() > 1) { - TMap, TMyFileComparator> byContents; + TMap, TMyFileComparator> byContents; for (const TString& fname: bySizeElement.second) { byContents[fname].push_back(fname); } @@ -270,7 +270,7 @@ namespace { } bool InitialFillingDone = false; - TVector FileNames; + std::vector FileNames; THashMap FileNameToRecordName; THashMap Synonyms; }; @@ -601,10 +601,10 @@ int main(int argc, char** argv) { SubstGlobal(append, "\\n", "\n"); SubstGlobal(prepend, "\\n", "\n"); - TVector recs; + std::vector recs; const auto& files = optsRes.GetFreeArgs(); - TVector keys; + std::vector keys; if (forceKeys.size()) StringSplitter(forceKeys).Split(':').SkipEmpty().Collect(&keys); diff --git a/tools/enum_parser/enum_parser/main.cpp b/tools/enum_parser/enum_parser/main.cpp index 433a61a5db9..15ea1c1c33a 100644 --- a/tools/enum_parser/enum_parser/main.cpp +++ b/tools/enum_parser/enum_parser/main.cpp @@ -18,7 +18,7 @@ #include #include #include -#include + #include #include #include @@ -174,9 +174,9 @@ void GenerateEnum( out << "namespace { namespace " << nsName << " {\n"; - TVector nameInitializerPairs; - TVector> valueInitializerPairsUnsorted; // data, sort_key - TVector cppNamesInitializer; + std::vector nameInitializerPairs; + std::vector> valueInitializerPairsUnsorted; // data, sort_key + std::vector cppNamesInitializer; TStringStream jItems; OpenArray(jItems); @@ -193,7 +193,7 @@ void GenerateEnum( OpenArray(jAliases); TString strValue = it.CppName; - if (it.Aliases) { + if (!it.Aliases.empty()) { // first alias is main strValue = it.Aliases[0]; OutKey(jEnumItem, "str_value", strValue); @@ -208,7 +208,7 @@ void GenerateEnum( FinishItems(jAliases); CloseArray(jAliases); - if (!it.Aliases) { + if (it.Aliases.empty()) { valueInitializerPairsUnsorted.emplace_back("TNameBufsBase::EnumStringPair(" + outerScopeStr + it.CppName + ", " + WrapStringBuf(it.CppName) + ")", it.CppName); } OutKey(jEnumItem, "aliases", jAliases.Str(), false); @@ -224,7 +224,7 @@ void GenerateEnum( const TString nsNameBufsClass = nsName + "::TNameBufs"; - auto defineConstArray = [&out, payloadCache = TMap>, TString>()](const TStringBuf indent, const TStringBuf elementType, const TStringBuf name, const TVector& items) mutable { + auto defineConstArray = [&out, payloadCache = TMap>, TString>()](const TStringBuf indent, const TStringBuf elementType, const TStringBuf name, const std::vector& items) mutable { if (items.empty()) { // ISO C++ forbids zero-size array out << indent << "static constexpr const TArrayRef " << name << ";\n"; } else { @@ -257,7 +257,8 @@ void GenerateEnum( } { StableSortBy(valueInitializerPairsUnsorted, [](const auto& pair) -> const TString& { return pair.second; }); - TVector valueInitializerPairs(Reserve(valueInitializerPairsUnsorted.size())); + std::vector valueInitializerPairs; + valueInitializerPairs.reserve(valueInitializerPairsUnsorted.size()); for (auto& [value, _] : valueInitializerPairsUnsorted) { valueInitializerPairs.push_back(std::move(value)); } @@ -384,7 +385,7 @@ void GenerateEnum( // template<> GetEnumAllCppNames, see IGNIETFERRO-534 out << " template<>\n"; - out << " const TVector& GetEnumAllCppNamesImpl<" << name << ">() {\n"; + out << " const std::vector& GetEnumAllCppNamesImpl<" << name << ">() {\n"; out << " const " << nsNameBufsClass << "& names = " << nsNameBufsClass << "::Instance();\n"; out << " return names.AllEnumCppNames();\n"; out << " }\n"; @@ -444,7 +445,7 @@ int main(int argc, char** argv) { TOptsParseResult res(&opts, argc, argv); - TVector freeArgs = res.GetFreeArgs(); + std::vector freeArgs = res.GetFreeArgs(); TString inputFileName = freeArgs[0]; THolder hOut; diff --git a/tools/enum_parser/enum_serialization_runtime/enum_runtime.h b/tools/enum_parser/enum_serialization_runtime/enum_runtime.h index 7c85ed3934a..b88e3cd1f63 100644 --- a/tools/enum_parser/enum_serialization_runtime/enum_runtime.h +++ b/tools/enum_parser/enum_serialization_runtime/enum_runtime.h @@ -57,7 +57,7 @@ namespace NEnumSerializationRuntime { return AllNames; } - const TVector& AllEnumCppNames() const noexcept { + const std::vector& AllEnumCppNames() const noexcept { return AllCppNames; } @@ -65,7 +65,7 @@ namespace NEnumSerializationRuntime { return Names; } - const TVector& TypelessEnumValues() const noexcept { + const std::vector& TypelessEnumValues() const noexcept { return AllValues; } @@ -73,9 +73,9 @@ namespace NEnumSerializationRuntime { TMap Names; TMap Values; TString AllNames; - TVector AllCppNames; + std::vector AllCppNames; TString ClassName; - TVector AllValues; + std::vector AllValues; }; /// Wraps TEnumDescriptionBase and performs on-demand casts diff --git a/tools/enum_parser/parse_enum/benchmark/main.cpp b/tools/enum_parser/parse_enum/benchmark/main.cpp index 9f2694f236a..fa70bd0f290 100644 --- a/tools/enum_parser/parse_enum/benchmark/main.cpp +++ b/tools/enum_parser/parse_enum/benchmark/main.cpp @@ -9,7 +9,7 @@ namespace { template - TVector SelectValues(size_t count) { + std::vector SelectValues(size_t count) { auto values = GetEnumAllValues().Materialize(); SortBy(values, [](const TEnum& v) { return IntHash(static_cast(v)); }); values.crop(count); @@ -17,8 +17,9 @@ namespace { } template - TVector SelectStrings(size_t count) { - TVector strings(Reserve(GetEnumItemsCount())); + std::vector SelectStrings(size_t count) { + std::vector strings; + strings.reserve(GetEnumItemsCount()); for (const auto& [_, s] : GetEnumNames()) { strings.push_back(s); } diff --git a/tools/enum_parser/parse_enum/parse_enum.cpp b/tools/enum_parser/parse_enum/parse_enum.cpp index 07712411aea..c7f4e6db547 100644 --- a/tools/enum_parser/parse_enum/parse_enum.cpp +++ b/tools/enum_parser/parse_enum/parse_enum.cpp @@ -28,11 +28,11 @@ class TValuesContext: public TCppFullSax { ~TValuesContext() override { } - TVector Values; + std::vector Values; }; -static TVector ParseEnumValues(const TString& strValues) { - TVector result; +static std::vector ParseEnumValues(const TString& strValues) { + std::vector result; TValuesContext ctx; TCppSaxParser parser(&ctx); @@ -153,7 +153,7 @@ class TEnumContext: public TCppFullSax { CurrentItem.CommentText = commentText; CurrentItem.Aliases = ParseEnumValues(commentText); - if (CurrentItem.Aliases && !CurrentItem.CppName) { + if (!CurrentItem.Aliases.empty() && !CurrentItem.CppName) { // this means we process multiline comment when item name was not set yet. ythrow yexception() << "Are you hit with https://clubs.at.yandex-team.ru/stackoverflow/2603 typo? "; } @@ -292,7 +292,7 @@ class TCppContext: public TCppFullSax { /// @param offset: terminating curly brace position void OnLeaveScope(size_t offset) { - if (!Scope) { + if (Scope.empty()) { size_t contextOffsetBegin = (offset >= 256) ? offset - 256 : 0; TString codeContext = TString(Data + contextOffsetBegin, offset - contextOffsetBegin + 1); ythrow yexception() << "C++ source parse failed: unbalanced scope. Did you miss a closing '}' bracket? " @@ -431,7 +431,7 @@ void TEnumParser::Parse(const char* dataIn, size_t lengthIn) { parser.Finish(); // obtain result Enums = cppContext.Enums; - if (cppContext.Scope) { + if (!cppContext.Scope.empty()) { cppContext.PrintEnums(); cppContext.PrintScope(); ythrow yexception() << "Unbalanced scope, something is wrong with enum parser. "; diff --git a/tools/enum_parser/parse_enum/parse_enum.h b/tools/enum_parser/parse_enum/parse_enum.h index ef8b512ae40..b5aa9c5eec6 100644 --- a/tools/enum_parser/parse_enum/parse_enum.h +++ b/tools/enum_parser/parse_enum/parse_enum.h @@ -14,7 +14,7 @@ class TEnumParser { struct TItem { TMaybe Value; TString CppName; - TVector Aliases; + std::vector Aliases; TString CommentText; void Clear() { @@ -30,9 +30,9 @@ class TEnumParser { }; // vector is to preserve declaration order - typedef TVector TItems; + typedef std::vector TItems; - typedef TVector TScope; + typedef std::vector TScope; struct TEnum { TItems Items; @@ -48,7 +48,7 @@ class TEnumParser { } }; - typedef TVector TEnums; + typedef std::vector TEnums; /// Parse results stored here TEnums Enums; diff --git a/tools/fix_elf/patch.cpp b/tools/fix_elf/patch.cpp index d49ebab307d..2e3fdf7ac76 100644 --- a/tools/fix_elf/patch.cpp +++ b/tools/fix_elf/patch.cpp @@ -121,7 +121,7 @@ void Patch(const TString& path, const TString& library, IOutputStream& verboseOu TStringBuf skipFrom("GLIBC_2.14"); TStringBuf patchFrom("GLIBC_2.2.5"); - TVector patchAux; + std::vector patchAux; Elf64_Vernaux* patchFromAux = nullptr; @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) { opts.SetFreeArgTitle(0, "", "File"); TOptsParseResult res(&opts, argc, argv); - TVector files = res.GetFreeArgs(); + std::vector files = res.GetFreeArgs(); IOutputStream& verboseOut = verbose ? Cout : Cnull; diff --git a/tools/rescompiler/main.cpp b/tools/rescompiler/main.cpp index 98a5b9413bc..3d0fd22b825 100644 --- a/tools/rescompiler/main.cpp +++ b/tools/rescompiler/main.cpp @@ -46,7 +46,7 @@ int main(int argc, char** argv) { while (*argv) { if ("-"sv == *argv) { - TVector items = StringSplitter(TString(*(argv + 1))).Split('=').Limit(2).ToList(); + std::vector items = StringSplitter(TString(*(argv + 1))).Split('=').Limit(2).ToList(); GenOne(TString(items[1]), TString(items[0]), out); } else { const char* key = *(argv + 1); diff --git a/tools/rescompressor/main.cpp b/tools/rescompressor/main.cpp index 9aba1002c5d..46ecc81a132 100644 --- a/tools/rescompressor/main.cpp +++ b/tools/rescompressor/main.cpp @@ -76,7 +76,7 @@ class TAsmWriter { } }; -static TString CompressPath(const TVector& replacements, TStringBuf in) { +static TString CompressPath(const std::vector& replacements, TStringBuf in) { for (auto r : replacements) { TStringBuf from, to; r.Split('=', from, to); @@ -95,7 +95,7 @@ int main(int argc, char** argv) { return 1; } - TVector replacements; + std::vector replacements; ind++; TFixedBufferFileOutput asmout(argv[ind]); diff --git a/tools/rorescompiler/main.cpp b/tools/rorescompiler/main.cpp index 7ca5346e4c8..832479d343f 100644 --- a/tools/rorescompiler/main.cpp +++ b/tools/rorescompiler/main.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include using namespace NResource; @@ -32,7 +31,7 @@ int main(int argc, char** argv) { out << "#include \n\n"; while (*argv) { - TVector items = StringSplitter(TString(*(argv))).Split('=').Limit(2).ToList(); + std::vector items = StringSplitter(TString(*(argv))).Split('=').Limit(2).ToList(); GenOne(items[0], items[1], out); argv++; } diff --git a/util/charset/utf8_ut.cpp b/util/charset/utf8_ut.cpp index 9e68881cca2..9b781577889 100644 --- a/util/charset/utf8_ut.cpp +++ b/util/charset/utf8_ut.cpp @@ -100,7 +100,7 @@ Y_UNIT_TEST_SUITE(TUtfUtilTest) { } Y_UNIT_TEST(TestInvalidUTF8) { - TVector testData; + std::vector testData; TFileInput input(ArcadiaSourceRoot() + TStringBuf("/util/charset/ut/utf8/invalid_UTF8.bin")); Load(&input, testData); diff --git a/util/charset/wide_ut.cpp b/util/charset/wide_ut.cpp index b33dd0c0de9..5f702b4ba34 100644 --- a/util/charset/wide_ut.cpp +++ b/util/charset/wide_ut.cpp @@ -964,7 +964,7 @@ class TWideUtilTest: public TTestBase { ToTitle(temp.begin(), temp.size()); UNIT_ASSERT(temp == title); - TVector buffer(WideStringTestData[0], WideStringTestData[0] + CaseTestDataSize); + std::vector buffer(WideStringTestData[0], WideStringTestData[0] + CaseTestDataSize); std::reverse(buffer.begin(), buffer.end()); const TUtf16String reversed = UTF32ToWide(buffer.data(), buffer.size()); diff --git a/util/datetime/parser_ut.cpp b/util/datetime/parser_ut.cpp index 6f5c3002280..d8f3ed337a7 100644 --- a/util/datetime/parser_ut.cpp +++ b/util/datetime/parser_ut.cpp @@ -459,7 +459,7 @@ Y_UNIT_TEST_SUITE(TDateTimeParseTest) { } Y_UNIT_TEST(TestIso8601BigDate) { - TVector> dates{ + std::vector> dates{ {"2019-01-01", 17897}, {"2037-01-01", 24472}, diff --git a/util/digest/sequence_ut.cpp b/util/digest/sequence_ut.cpp index 87d6102ee59..d2fe3b3f884 100644 --- a/util/digest/sequence_ut.cpp +++ b/util/digest/sequence_ut.cpp @@ -21,13 +21,13 @@ class TRangeHashTest: public TTestBase { inline void TestIntVector() { const size_t canonicalHash = static_cast(ULL(1351128487744230578)); - TVector testVec = {1, 2, 4, 3}; + std::vector testVec = {1, 2, 4, 3}; UNIT_ASSERT_EQUAL(canonicalHash, TRangeHash<>()(testVec)); } inline void TestOneElement() { const int testVal = 42; - TVector testVec = {testVal}; + std::vector testVec = {testVal}; UNIT_ASSERT_UNEQUAL(THash()(testVal), TRangeHash<>()(testVec)); } @@ -38,7 +38,7 @@ class TRangeHashTest: public TTestBase { } inline void TestCollectionIndependancy() { - TVector testVec = {'a', 'b', 'c'}; + std::vector testVec = {'a', 'b', 'c'}; TString testStroka = "abc"; UNIT_ASSERT_EQUAL(TRangeHash<>()(testVec), TRangeHash<>()(testStroka)); } diff --git a/util/draft/holder_vector.h b/util/draft/holder_vector.h index 1c62055bd95..fcbff29235c 100644 --- a/util/draft/holder_vector.h +++ b/util/draft/holder_vector.h @@ -5,8 +5,8 @@ #include template -class THolderVector: public TVector, public TNonCopyable { - using TBase = TVector; +class THolderVector: public std::vector, public TNonCopyable { + using TBase = std::vector; public: explicit THolderVector(size_t n = 0) @@ -30,7 +30,7 @@ class THolderVector: public TVector, public TNonCopyable { return TBase::size(); } - // TVector takes ownership of T + // std::vector takes ownership of T void PushBack(T* t) { try { TBase::push_back(t); diff --git a/util/folder/iterator_ut.cpp b/util/folder/iterator_ut.cpp index c54cde55c81..a6b09eeed7f 100644 --- a/util/folder/iterator_ut.cpp +++ b/util/folder/iterator_ut.cpp @@ -9,7 +9,7 @@ #include #include -static TString JoinWithNewline(const TVector& strings) { +static TString JoinWithNewline(const std::vector& strings) { TStringStream ss; for (const auto& string : strings) { ss << string << "\n"; @@ -86,7 +86,7 @@ class TDirIteratorTest: public TTestBase { } private: - TVector Paths_; + std::vector Paths_; THashMap Srch_; }; @@ -192,7 +192,7 @@ class TDirIteratorTest: public TTestBase { } } - TVector fnames; + std::vector fnames; { TDirIterator d(dir, TDirIterator::TOptions().SetSortByName()); @@ -204,7 +204,7 @@ class TDirIteratorTest: public TTestBase { } } - TVector sorted(fnames); + std::vector sorted(fnames); Sort(sorted.begin(), sorted.end()); UNIT_ASSERT_VALUES_EQUAL(JoinWithNewline(fnames), JoinWithNewline(sorted)); diff --git a/util/folder/path.cpp b/util/folder/path.cpp index 29a1689870b..a03a0ae8c35 100644 --- a/util/folder/path.cpp +++ b/util/folder/path.cpp @@ -278,7 +278,7 @@ struct TClosedir { } }; -void TFsPath::ListNames(TVector& children) const { +void TFsPath::ListNames(std::vector& children) const { CheckDefined(); THolder dir(opendir(this->c_str())); if (!dir) { @@ -325,8 +325,8 @@ bool TFsPath::Contains(const TString& component) const { return false; } -void TFsPath::List(TVector& files) const { - TVector names; +void TFsPath::List(std::vector& files) const { + std::vector names; ListNames(names); for (auto& name : names) { files.push_back(Child(name)); @@ -457,7 +457,7 @@ void TFsPath::ForceDelete() const { ClearLastSystemError(); if (stat.IsDir()) { - TVector children; + std::vector children; List(children); for (auto& i : children) { i.ForceDelete(); @@ -479,7 +479,7 @@ void TFsPath::CopyTo(const TString& newPath, bool force) const { } else if (!TFsPath(newPath).IsDirectory()) { ythrow TIoException() << "Target path is not a directory " << newPath; } - TVector children; + std::vector children; List(children); for (auto&& i : children) { i.CopyTo(newPath + "/" + i.GetName(), force); diff --git a/util/folder/path.h b/util/folder/path.h index 9f6642d5cb8..980044b31d1 100644 --- a/util/folder/path.h +++ b/util/folder/path.h @@ -156,8 +156,8 @@ class TFsPath { void MkDirs(const int mode = MODE0777) const; // XXX: rewrite to return iterator - void List(TVector& children) const; - void ListNames(TVector& children) const; + void List(std::vector& children) const; + void ListNames(std::vector& children) const; // Check, if path contains at least one component with a specific name. bool Contains(const TString& component) const; diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp index bb0656ddbc5..fee5344d220 100644 --- a/util/folder/path_ut.cpp +++ b/util/folder/path_ut.cpp @@ -235,11 +235,11 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { dir.Child("c").MkDir(); dir.Child("d").Touch(); - TVector children; + std::vector children; dir.ListNames(children); std::sort(children.begin(), children.end()); - TVector expected; + std::vector expected; expected.push_back("a"); expected.push_back("b"); expected.push_back("c"); diff --git a/util/folder/pathsplit.h b/util/folder/pathsplit.h index d134338e35d..68170be65c5 100644 --- a/util/folder/pathsplit.h +++ b/util/folder/pathsplit.h @@ -6,7 +6,7 @@ #include //do not own any data -struct TPathSplitStore: public TVector { +struct TPathSplitStore: public std::vector { TStringBuf Drive; bool IsAbsolute = false; diff --git a/util/generic/adaptor_ut.cpp b/util/generic/adaptor_ut.cpp index 721f849f934..dd29173427f 100644 --- a/util/generic/adaptor_ut.cpp +++ b/util/generic/adaptor_ut.cpp @@ -34,8 +34,8 @@ struct TState { Y_UNIT_TEST_SUITE(TReverseAdaptor) { Y_UNIT_TEST(ReadTest) { - TVector cont = {1, 2, 3}; - TVector etalon = {3, 2, 1}; + std::vector cont = {1, 2, 3}; + std::vector etalon = {3, 2, 1}; size_t idx = 0; for (const auto& x : Reversed(cont)) { UNIT_ASSERT_VALUES_EQUAL(etalon[idx++], x); @@ -47,8 +47,8 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { } Y_UNIT_TEST(WriteTest) { - TVector cont = {1, 2, 3}; - TVector etalon = {3, 6, 9}; + std::vector cont = {1, 2, 3}; + std::vector etalon = {3, 6, 9}; size_t idx = 0; for (auto& x : Reversed(cont)) { x *= x + idx++; @@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { } Y_UNIT_TEST(InnerTypeTest) { - using TStub = TVector; + using TStub = std::vector; TStub stub; const TStub cstub; @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { } Y_UNIT_TEST(ReverseX2Test) { - TVector cont = {1, 2, 3}; + std::vector cont = {1, 2, 3}; size_t idx = 0; for (const auto& x : Reversed(Reversed(cont))) { UNIT_ASSERT_VALUES_EQUAL(cont[idx++], x); @@ -85,8 +85,8 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { } Y_UNIT_TEST(ReverseX3Test) { - TVector cont = {1, 2, 3}; - TVector etalon = {3, 2, 1}; + std::vector cont = {1, 2, 3}; + std::vector etalon = {3, 2, 1}; size_t idx = 0; for (const auto& x : Reversed(Reversed(Reversed(cont)))) { UNIT_ASSERT_VALUES_EQUAL(etalon[idx++], x); @@ -94,14 +94,14 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { } Y_UNIT_TEST(ReverseTemporaryTest) { - TVector etalon = {3, 2, 1}; - TVector etalon2 = {1, 2, 3}; + std::vector etalon = {3, 2, 1}; + std::vector etalon2 = {1, 2, 3}; size_t idx = 0; - for (const auto& x : Reversed(TVector{1, 2, 3})) { + for (const auto& x : Reversed(std::vector{1, 2, 3})) { UNIT_ASSERT_VALUES_EQUAL(etalon[idx++], x); } idx = 0; - for (const auto& x : Reversed(Reversed(TVector{1, 2, 3}))) { + for (const auto& x : Reversed(Reversed(std::vector{1, 2, 3}))) { UNIT_ASSERT_VALUES_EQUAL(etalon2[idx++], x); } } @@ -109,8 +109,8 @@ Y_UNIT_TEST_SUITE(TReverseAdaptor) { Y_UNIT_TEST(ReverseInitializerListTest) { // initializer_list has no rbegin and rend auto cont = {1, 2, 3}; - TVector etalon = {3, 2, 1}; - TVector etalon2 = {1, 2, 3}; + std::vector etalon = {3, 2, 1}; + std::vector etalon2 = {1, 2, 3}; size_t idx = 0; for (const auto& x : Reversed(cont)) { diff --git a/util/generic/algorithm_ut.cpp b/util/generic/algorithm_ut.cpp index 09c5824cd9b..b88195db7eb 100644 --- a/util/generic/algorithm_ut.cpp +++ b/util/generic/algorithm_ut.cpp @@ -223,7 +223,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { UNIT_ASSERT_EQUAL(2, FindIndex(array, 3)); UNIT_ASSERT_EQUAL(NPOS, FindIndex(array, 42)); - TVector empty; + std::vector empty; UNIT_ASSERT_EQUAL(NPOS, FindIndex(empty, 0)); } @@ -245,39 +245,39 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { UNIT_ASSERT_EQUAL(2, FindIndexIf(array, [](int x) { return x == 3; })); UNIT_ASSERT_EQUAL(NPOS, FindIndexIf(array, [](int x) { return x == 42; })); - TVector empty; + std::vector empty; UNIT_ASSERT_EQUAL(NPOS, FindIndexIf(empty, [](int x) { return x == 3; })); } Y_UNIT_TEST(SortUniqueTest) { { - TVector v; + std::vector v; SortUnique(v); - UNIT_ASSERT_EQUAL(v, TVector()); + UNIT_ASSERT_EQUAL(v, std::vector()); } { const char* ar[] = {"345", "3", "123", "2", "23", "3", "2"}; - TVector v(ar, ar + Y_ARRAY_SIZE(ar)); + std::vector v(ar, ar + Y_ARRAY_SIZE(ar)); SortUnique(v); const char* suAr[] = {"123", "2", "23", "3", "345"}; - TVector suV(suAr, suAr + Y_ARRAY_SIZE(suAr)); + std::vector suV(suAr, suAr + Y_ARRAY_SIZE(suAr)); UNIT_ASSERT_EQUAL(v, suV); } } Y_UNIT_TEST(EraseTest) { - TVector data = {5, 4, 3, 2, 1, 0}; - TVector expected = {5, 4, 2, 1, 0}; + std::vector data = {5, 4, 3, 2, 1, 0}; + std::vector expected = {5, 4, 2, 1, 0}; Erase(data, 3); UNIT_ASSERT_EQUAL(data, expected); } Y_UNIT_TEST(EraseIfTest) { - TVector data = {5, 4, 3, 2, 1, 0}; - TVector expected = {2, 1, 0}; + std::vector data = {5, 4, 3, 2, 1, 0}; + std::vector expected = {2, 1, 0}; EraseIf(data, [](int i) { return i >= 3; }); UNIT_ASSERT_EQUAL(data, expected); } @@ -316,14 +316,14 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { Y_UNIT_TEST(NthElementTest) { { - TVector v; + std::vector v; NthElement(v.begin(), v.begin(), v.end()); - UNIT_ASSERT_EQUAL(v, TVector()); + UNIT_ASSERT_EQUAL(v, std::vector()); } { int data[] = {3, 2, 1, 4, 6, 5, 7, 9, 8}; - TVector testVector(data, data + Y_ARRAY_SIZE(data)); + std::vector testVector(data, data + Y_ARRAY_SIZE(data)); size_t medianInd = testVector.size() / 2; @@ -336,7 +336,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { { const char* data[] = {"3", "234", "1231", "333", "545345", "11", "111", "55", "66"}; - TVector testVector(data, data + Y_ARRAY_SIZE(data)); + std::vector testVector(data, data + Y_ARRAY_SIZE(data)); size_t medianInd = testVector.size() / 2; NthElement(testVector.begin(), testVector.begin() + medianInd, testVector.end()); @@ -352,7 +352,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { Y_UNIT_TEST(BinarySearchTest) { { - TVector v; + std::vector v; bool test = BinarySearch(v.begin(), v.end(), "test"); UNIT_ASSERT_EQUAL(test, false); } @@ -368,7 +368,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } { - TVector data = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; + std::vector data = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; bool test = BinarySearch(data.begin(), data.end(), (size_t)9, TGreater()); UNIT_ASSERT_EQUAL(test, true); @@ -383,8 +383,8 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { Y_UNIT_TEST(EqualRangeTest) { { - TVector v; - using PairOfVector = std::pair::iterator, TVector::iterator>; + std::vector v; + using PairOfVector = std::pair::iterator, std::vector::iterator>; PairOfVector tmp = EqualRange(v.begin(), v.end(), "tmp"); UNIT_ASSERT_EQUAL(tmp.first, tmp.second); @@ -402,15 +402,15 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } { - TVector data = {9, 9, 8, 8, 8, 5, 4, 3, 3, 0, 0}; + std::vector data = {9, 9, 8, 8, 8, 5, 4, 3, 3, 0, 0}; - using PairOfVector = std::pair::iterator, TVector::iterator>; + using PairOfVector = std::pair::iterator, std::vector::iterator>; PairOfVector tmp = EqualRange(data.begin(), data.end(), 8, TGreater()); UNIT_ASSERT_EQUAL(tmp.first - data.begin(), 2); UNIT_ASSERT_EQUAL(tmp.second - tmp.first, 3); - using PairOfVectorReverse = std::pair::reverse_iterator, TVector::reverse_iterator>; + using PairOfVectorReverse = std::pair::reverse_iterator, std::vector::reverse_iterator>; PairOfVectorReverse tmpR = EqualRange(data.rbegin(), data.rend(), (size_t)0); UNIT_ASSERT_EQUAL(tmpR.first, data.rbegin()); @@ -419,19 +419,19 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(AdjacentFindTest) { - TVector v0; + std::vector v0; UNIT_ASSERT_EQUAL(AdjacentFind(v0), v0.end()); - TVector v1 = {1}; + std::vector v1 = {1}; UNIT_ASSERT_EQUAL(AdjacentFind(v1), v1.end()); const int v2[] = {8, 7, 6, 6, 5, 5, 5, 4, 3, 2, 1}; UNIT_ASSERT_EQUAL(AdjacentFind(v2), std::begin(v2) + 2); - TVector v3 = {"six", "five", "four", "three", "two", "one"}; + std::vector v3 = {"six", "five", "four", "three", "two", "one"}; UNIT_ASSERT_EQUAL(AdjacentFind(v3), v3.end()); - TVector v4 = {1, 1, 1, 1, 1}; + std::vector v4 = {1, 1, 1, 1, 1}; for (;;) { if (auto it = AdjacentFind(v4); it == v4.end()) { break; @@ -439,25 +439,25 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { *it += 1; } } - UNIT_ASSERT_VALUES_EQUAL(v4, (TVector{5, 4, 3, 2, 1})); + UNIT_ASSERT_VALUES_EQUAL(v4, (std::vector{5, 4, 3, 2, 1})); } Y_UNIT_TEST(AdjacentFindByTest) { - TVector v0; + std::vector v0; UNIT_ASSERT_EQUAL(AdjacentFindBy(v0, std::negate()), v0.end()); - TVector v1 = {1}; + std::vector v1 = {1}; UNIT_ASSERT_EQUAL(AdjacentFindBy(v1, std::negate()), v1.end()); const int v2[] = {8, 7, 6, 6, 5, 5, 5, 4, 3, 2, 1}; UNIT_ASSERT_EQUAL(AdjacentFindBy(v2, std::negate()), std::begin(v2) + 2); UNIT_ASSERT_EQUAL(AdjacentFindBy(v2, [](const auto& e) { return e / 8; }), std::begin(v2) + 1); - TVector v3 = {"six", "five", "four", "three", "two", "one"}; + std::vector v3 = {"six", "five", "four", "three", "two", "one"}; UNIT_ASSERT_EQUAL(AdjacentFind(v3), v3.end()); UNIT_ASSERT_EQUAL(AdjacentFindBy(v3, std::mem_fn(&TStringBuf::size)), v3.begin() + 1); - TVector v4 = {101, 201, 301, 401, 501}; + std::vector v4 = {101, 201, 301, 401, 501}; for (;;) { if (auto it = AdjacentFindBy(v4, [](int a) { return a % 10; }); it == v4.end()) { break; @@ -465,128 +465,128 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { *it += 1; } } - UNIT_ASSERT_VALUES_EQUAL(v4, (TVector{105, 204, 303, 402, 501})); + UNIT_ASSERT_VALUES_EQUAL(v4, (std::vector{105, 204, 303, 402, 501})); } Y_UNIT_TEST(IsSortedTest) { - TVector v0; + std::vector v0; UNIT_ASSERT_VALUES_EQUAL(IsSorted(v0.begin(), v0.end()), true); - TVector v1 = {1, 2, 3, 4, 5, 5, 5, 6, 6, 7, 8}; + std::vector v1 = {1, 2, 3, 4, 5, 5, 5, 6, 6, 7, 8}; UNIT_ASSERT_VALUES_EQUAL(IsSorted(v1.begin(), v1.end()), true); UNIT_ASSERT_VALUES_EQUAL(IsSorted(v1.begin(), v1.end(), TLess()), true); UNIT_ASSERT_VALUES_EQUAL(IsSorted(v1.begin(), v1.end(), TGreater()), false); - TVector v2 = {1, 2, 1}; + std::vector v2 = {1, 2, 1}; UNIT_ASSERT_VALUES_EQUAL(IsSorted(v2.begin(), v2.end()), false); UNIT_ASSERT_VALUES_EQUAL(IsSorted(v2.begin(), v2.end(), TLess()), false); UNIT_ASSERT_VALUES_EQUAL(IsSorted(v2.begin(), v2.end(), TGreater()), false); } Y_UNIT_TEST(IsSortedByTest) { - TVector v0; + std::vector v0; UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v0.begin(), v0.end(), std::negate()), true); UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v0, std::negate()), true); - TVector v1 = {1}; + std::vector v1 = {1}; UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v1.begin(), v1.end(), std::negate()), true); UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v1, std::negate()), true); - TVector v2 = {8, 7, 6, 6, 5, 5, 5, 4, 3, 2, 1}; + std::vector v2 = {8, 7, 6, 6, 5, 5, 5, 4, 3, 2, 1}; UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v2.begin(), v2.end(), std::negate()), true); UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v2, std::negate()), true); - TVector v3 = {1, 2, 1}; + std::vector v3 = {1, 2, 1}; UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v3.begin(), v3.end(), std::negate()), false); UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v3, std::negate()), false); } Y_UNIT_TEST(SortTestTwoIterators) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; Sort(collection.begin(), collection.end()); - TVector expected = {2, 7, 10}; + std::vector expected = {2, 7, 10}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(SortTestTwoIteratorsAndComparator) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; Sort(collection.begin(), collection.end(), [](int l, int r) { return l > r; }); - TVector expected = {10, 7, 2}; + std::vector expected = {10, 7, 2}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(SortTestContainer) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; Sort(collection); - TVector expected = {2, 7, 10}; + std::vector expected = {2, 7, 10}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(SortTestContainerAndComparator) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; Sort(collection, [](int l, int r) { return l > r; }); - TVector expected = {10, 7, 2}; + std::vector expected = {10, 7, 2}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortTestTwoIterators) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; StableSort(collection.begin(), collection.end()); - TVector expected = {2, 7, 10}; + std::vector expected = {2, 7, 10}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortTestTwoIteratorsAndComparator) { - TVector collection = {404, 101, 106, 203, 102, 205, 401}; + std::vector collection = {404, 101, 106, 203, 102, 205, 401}; StableSort(collection.begin(), collection.end(), [](int l, int r) { return (l / 100) < (r / 100); }); - TVector expected = {101, 106, 102, 203, 205, 404, 401}; + std::vector expected = {101, 106, 102, 203, 205, 404, 401}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortTestContainer) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; StableSort(collection); - TVector expected = {2, 7, 10}; + std::vector expected = {2, 7, 10}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortTestContainerAndComparator) { - TVector collection = {404, 101, 106, 203, 102, 205, 401}; + std::vector collection = {404, 101, 106, 203, 102, 205, 401}; StableSort(collection, [](int l, int r) { return (l / 100) < (r / 100); }); - TVector expected = {101, 106, 102, 203, 205, 404, 401}; + std::vector expected = {101, 106, 102, 203, 205, 404, 401}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(SortByTest) { - TVector collection = {10, 2, 7}; + std::vector collection = {10, 2, 7}; SortBy(collection, [](int x) { return -x; }); - TVector expected = {10, 7, 2}; + std::vector expected = {10, 7, 2}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortByTest) { - TVector collection = {404, 101, 106, 203, 102, 205, 401}; + std::vector collection = {404, 101, 106, 203, 102, 205, 401}; StableSortBy(collection, [](int x) { return x / 100; }); - TVector expected = {101, 106, 102, 203, 205, 404, 401}; + std::vector expected = {101, 106, 102, 203, 205, 404, 401}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(SortUniqueByTest) { - TVector collection = {404, 101, 101, 203, 101, 203, 404}; + std::vector collection = {404, 101, 101, 203, 101, 203, 404}; StableSortUniqueBy(collection, [](int x) { return x / 100; }); - TVector expected = {101, 203, 404}; + std::vector expected = {101, 203, 404}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(StableSortUniqueByTest) { - TVector collection = {404, 101, 106, 203, 102, 205, 401}; + std::vector collection = {404, 101, 106, 203, 102, 205, 401}; StableSortUniqueBy(collection, [](int x) { return x / 100; }); - TVector expected = {101, 203, 404}; + std::vector expected = {101, 203, 404}; UNIT_ASSERT_VALUES_EQUAL(collection, expected); } Y_UNIT_TEST(IotaTest) { - TVector v(10); + std::vector v(10); Iota(v.begin(), v.end(), 0); UNIT_ASSERT_VALUES_EQUAL(v[0], 0); @@ -602,10 +602,10 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { Y_UNIT_TEST(CopyNTest) { int data[] = {1, 2, 3, 4, 8, 7, 6, 5}; const size_t vSize = 10; - TVector result(10, 0); + std::vector result(10, 0); size_t toCopy = 5; - TVector::iterator iter = CopyN(data, toCopy, result.begin()); + std::vector::iterator iter = CopyN(data, toCopy, result.begin()); UNIT_ASSERT_VALUES_EQUAL(iter - result.begin(), toCopy); UNIT_ASSERT_VALUES_EQUAL(result.size(), 10); for (size_t idx = 0; idx < toCopy; ++idx) { @@ -635,9 +635,9 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { const size_t count = 9; int data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; const size_t vSize = 10; - TVector v(vSize, 0); + std::vector v(vSize, 0); - TVector::iterator iter = CopyIf(data, data + count, v.begin(), [](int x) { return !(x % 3); }); + std::vector::iterator iter = CopyIf(data, data + count, v.begin(), [](int x) { return !(x % 3); }); UNIT_ASSERT_VALUES_EQUAL(v.size(), vSize); UNIT_ASSERT_VALUES_EQUAL(iter - v.begin(), 3); v.resize(iter - v.begin()); @@ -647,7 +647,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(MinMaxElementTest) { - TVector v(10); + std::vector v(10); Iota(v.begin(), v.end(), 0); UNIT_ASSERT_EQUAL(*MinMaxElement(v.begin(), v.end()).first, 0); UNIT_ASSERT_EQUAL(*MinMaxElement(v.begin(), v.end()).second, 9); @@ -674,7 +674,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { return x * x; }), 5); - const TVector vec(array, array + Y_ARRAY_SIZE(array)); + const std::vector vec(array, array + Y_ARRAY_SIZE(array)); UNIT_ASSERT_VALUES_EQUAL(*MaxElementBy(vec, [](int x) { return -1.0 * x; }), 1); @@ -700,7 +700,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { return 'a' + x; }), 1); - const TVector vec(std::begin(array), std::end(array)); + const std::vector vec(std::begin(array), std::end(array)); UNIT_ASSERT_VALUES_EQUAL(*MinElementBy(vec, [](int x) { return -x; }), 5); @@ -716,7 +716,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { auto singleElementSequence = {'z'}; UNIT_ASSERT_VALUES_EQUAL(*MinElementBy(singleElementSequence, identity), 'z'); - const TVector strings = {"one", "two", "three", "four"}; + const std::vector strings = {"one", "two", "three", "four"}; auto stringLength = [](TStringBuf s) { return s.size(); }; @@ -725,12 +725,12 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(MaxElementByReturnsEndForEmptyRange) { - const TVector empty; + const std::vector empty; UNIT_ASSERT_EQUAL(MaxElementBy(empty, [](int) { return 0; }), empty.end()); } Y_UNIT_TEST(MaxElementByDoesntCallFunctorForEmptyRange) { - const TVector empty; + const std::vector empty; auto functor = [](int) { UNIT_ASSERT(false); return 0; @@ -739,12 +739,12 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(MinElementByReturnsEndForEmptyRange) { - const TVector empty; + const std::vector empty; UNIT_ASSERT_EQUAL(MinElementBy(empty, [](int) { return 0; }), empty.end()); } Y_UNIT_TEST(MinElementByDoesntCallFunctorForEmptyRange) { - const TVector empty; + const std::vector empty; auto functor = [](int) { UNIT_ASSERT(false); return 0; @@ -787,7 +787,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { UNIT_ASSERT(!AllOf(std::make_tuple(1, 2, 0, 4, 5), [&](auto v) { UNIT_ASSERT_LT(v, 3); return 0 != v; })); UNIT_ASSERT(AllOf(std::make_tuple(1, 2, 3, 4, 5), [](auto v) { return 0 != v; })); { - auto pred = std::function([x = TVector(1, 0)](auto v) { return x.front() != v; }); + auto pred = std::function([x = std::vector(1, 0)](auto v) { return x.front() != v; }); UNIT_ASSERT(AllOf(std::make_tuple(1, 2), pred)); UNIT_ASSERT(AllOf(std::make_tuple(1, 2), pred)); } @@ -802,7 +802,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { UNIT_ASSERT(!AnyOf(std::tuple<>{}, [](auto) { return true; })); UNIT_ASSERT(AnyOf(std::make_tuple(0, 1, 2, 3, 4), [&](auto v) { UNIT_ASSERT_LT(v, 2); return 1 == v; })); UNIT_ASSERT(AnyOf(std::make_tuple(1, 2, 3, 4, 5), [](auto v) { return 5 == v; })); - auto pred = std::function([x = TVector(1, 0)](auto v) { return x.front() == v; }); + auto pred = std::function([x = std::vector(1, 0)](auto v) { return x.front() == v; }); UNIT_ASSERT(!AnyOf(std::make_tuple(1, 2), pred)); UNIT_ASSERT(!AnyOf(std::make_tuple(1, 2), pred)); { @@ -820,7 +820,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { UNIT_ASSERT_EQUAL(FindIf(array, [](int x) { return x == 1; }), begin(array)); UNIT_ASSERT_EQUAL(FindIf(array, [](int x) { return x > 5; }), end(array)); - TVector vector = {1, 2, 3, 4, 5}; + std::vector vector = {1, 2, 3, 4, 5}; UNIT_ASSERT_EQUAL(FindIf(vector, [](int x) { return x == 1; }), begin(vector)); UNIT_ASSERT_EQUAL(FindIf(vector, [](int x) { return x > 5; }), end(vector)); @@ -829,7 +829,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { *iter = 5; // Compilability test. Check if the returned iterator is const. Should not compile - const TVector constVector = {1, 2, 3, 4, 5}; + const std::vector constVector = {1, 2, 3, 4, 5}; auto constIter = FindIf(constVector, [](int x) { return x == 1; }); Y_UNUSED(constIter); // *constIter = 5; @@ -854,7 +854,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(TestLowerBoundBy) { - using TIntPairs = TVector>; + using TIntPairs = std::vector>; auto data = TIntPairs{{1, 5}, {3, 2}, {3, 4}, {8, 0}, {5, 4}}; auto getKey = [](const auto& x) { return x.second; }; @@ -874,7 +874,7 @@ Y_UNIT_TEST_SUITE(TAlgorithm) { } Y_UNIT_TEST(TestUpperBoundBy) { - using TIntPairs = TVector>; + using TIntPairs = std::vector>; auto data = TIntPairs{{1, 5}, {3, 2}, {3, 4}, {8, 0}, {5, 4}}; auto getKey = [](const auto& x) { return x.second; }; diff --git a/util/generic/array_ref.h b/util/generic/array_ref.h index 1ac60ac7d3c..949b5e8b5e5 100644 --- a/util/generic/array_ref.h +++ b/util/generic/array_ref.h @@ -10,13 +10,13 @@ * `TArrayRef` works pretty much like `std::span` with dynamic extent, presenting * an array-like interface into a contiguous sequence of objects. * - * It can be used at interface boundaries instead of `TVector` or + * It can be used at interface boundaries instead of `std::vector` or * pointer-size pairs, and is actually a preferred way to pass contiguous data * into functions. * * Note that `TArrayRef` can be auto-constructed from any contiguous container * (with `size` and `data` members), and thus you don't have to change client code - * when switching over from passing `TVector` to `TArrayRef`. + * when switching over from passing `std::vector` to `TArrayRef`. * * Note that `TArrayRef` has the same const-semantics as raw pointers: * - `TArrayRef` is a non-const reference to non-const data (like `T*`); diff --git a/util/generic/array_ref_ut.cpp b/util/generic/array_ref_ut.cpp index 4c8eaf7135a..ba6eae715e8 100644 --- a/util/generic/array_ref_ut.cpp +++ b/util/generic/array_ref_ut.cpp @@ -174,10 +174,10 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { auto fc = [](TArrayRef) {}; auto fm = [](TArrayRef) {}; - fc(TVector({1})); + fc(std::vector({1})); - const TVector ac = {1}; - TVector am = {1}; + const std::vector ac = {1}; + std::vector am = {1}; fc(ac); fc(am); @@ -214,13 +214,13 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { } Y_UNIT_TEST(SubRegion) { - TVector x; + std::vector x; for (size_t i = 0; i < 42; ++i) { x.push_back('a' + (i * 42424243) % 13); } TArrayRef ref(x.data(), 42); for (size_t i = 0; i <= 50; ++i) { - TVector expected; + std::vector expected; for (size_t j = 0; j <= 100; ++j) { UNIT_ASSERT(MakeArrayRef(expected) == ref.SubRegion(i, j)); if (i + j < 42) { @@ -260,13 +260,13 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { } Y_UNIT_TEST(TestTypeDeductionViaMakeArrayRef) { - TVector vec{17, 19, 21}; + std::vector vec{17, 19, 21}; TArrayRef ref = MakeArrayRef(vec); UNIT_ASSERT_VALUES_EQUAL(21, ref[2]); ref[1] = 23; UNIT_ASSERT_VALUES_EQUAL(23, vec[1]); - const TVector& constVec(vec); + const std::vector& constVec(vec); TArrayRef constRef = MakeArrayRef(constVec); UNIT_ASSERT_VALUES_EQUAL(21, constRef[2]); @@ -305,7 +305,7 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { } Y_UNIT_TEST(TestMakeConstArrayRef) { - TVector data; + std::vector data; // Won't compile because can't deduce `T` for `Foo` // Foo(data); @@ -316,7 +316,7 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { // Success! Foo(MakeConstArrayRef(data)); - const TVector constData; + const std::vector constData; Foo(MakeConstArrayRef(constData)); } } diff --git a/util/generic/buffer_ut.cpp b/util/generic/buffer_ut.cpp index 437d7122ec2..7524de8deee 100644 --- a/util/generic/buffer_ut.cpp +++ b/util/generic/buffer_ut.cpp @@ -164,7 +164,7 @@ Y_UNIT_TEST(TestSpeed) { } { - TVector buf; + std::vector buf; t2 = MicroSeconds(); diff --git a/util/generic/fwd.h b/util/generic/fwd.h index 5cc2da40e51..4d4e67fb0af 100644 --- a/util/generic/fwd.h +++ b/util/generic/fwd.h @@ -61,7 +61,7 @@ class TDeque; template > class TQueue; -template , class C = TLess> +template , class C = TLess> class TPriorityQueue; template , class EqualKey = TEqualTo, class Alloc = std::allocator> diff --git a/util/generic/hash_primes_ut.cpp b/util/generic/hash_primes_ut.cpp index 7b5bf8b5c9a..0fef409cb5d 100644 --- a/util/generic/hash_primes_ut.cpp +++ b/util/generic/hash_primes_ut.cpp @@ -14,8 +14,8 @@ Y_UNIT_TEST_SUITE(TestHashPrimes) { UNIT_ASSERT_VALUES_EQUAL(HashBucketCount(8), 17); } - static TVector Numbers() { - TVector numbers; + static std::vector Numbers() { + std::vector numbers; TFastRng64 rng{961923}; size_t k = 1; @@ -31,8 +31,8 @@ Y_UNIT_TEST_SUITE(TestHashPrimes) { return numbers; } - static TVector Divisors() { - TVector divisors; + static std::vector Divisors() { + std::vector divisors; divisors.push_back(HashBucketCountExt(0)()); for (;;) { const size_t prevSize = divisors.back(); @@ -46,8 +46,8 @@ Y_UNIT_TEST_SUITE(TestHashPrimes) { } Y_UNIT_TEST(Remainder) { - const TVector numbers = Numbers(); - const TVector divisors = Divisors(); + const std::vector numbers = Numbers(); + const std::vector divisors = Divisors(); auto testDivisor = [&](const auto& c) { for (size_t n : numbers) { @@ -65,7 +65,7 @@ Y_UNIT_TEST_SUITE(TestHashPrimes) { Y_UNIT_TEST(MisleadingHints) { TFastRng64 rng{332142}; - TVector cases = Numbers(); + std::vector cases = Numbers(); for (size_t d : Divisors()) { cases.push_back(d); } diff --git a/util/generic/is_in_ut.cpp b/util/generic/is_in_ut.cpp index 763018a0885..7a6ff2c8020 100644 --- a/util/generic/is_in_ut.cpp +++ b/util/generic/is_in_ut.cpp @@ -53,7 +53,7 @@ Y_UNIT_TEST_SUITE(TIsIn) { TestIsInWithCont>("found"); // vector also compiles and works - TVector v; + std::vector v; v.push_back("found"); UNIT_ASSERT(IsIn(v, "found")); UNIT_ASSERT(!IsIn(v, "not found")); @@ -102,8 +102,8 @@ Y_UNIT_TEST_SUITE(TIsIn) { const TString b = "b"; UNIT_ASSERT(!IsIn({"a", "b", "c"}, b.data())); // compares pointers by value. Whether it's good or not. - UNIT_ASSERT(IsIn(TVector({"a", "b", "c"}), b.data())); - UNIT_ASSERT(IsIn(TVector({"a", "b", "c"}), "b")); + UNIT_ASSERT(IsIn(std::vector({"a", "b", "c"}), b.data())); + UNIT_ASSERT(IsIn(std::vector({"a", "b", "c"}), "b")); } Y_UNIT_TEST(IsInArrayTest) { diff --git a/util/generic/iterator_range_ut.cpp b/util/generic/iterator_range_ut.cpp index a7e3670ae10..b032962fbe9 100644 --- a/util/generic/iterator_range_ut.cpp +++ b/util/generic/iterator_range_ut.cpp @@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(IteratorRange) { } Y_UNIT_TEST(OperatorsAndReferences) { - TVector values{1, 2, 3, 4, 5}; + std::vector values{1, 2, 3, 4, 5}; auto range = MakeIteratorRange(values.begin(), values.end()); UNIT_ASSERT_VALUES_EQUAL(range[2], 3); UNIT_ASSERT_VALUES_EQUAL(range[range[2]], 4); @@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(IteratorRange) { range[0] = 100501; UNIT_ASSERT_VALUES_EQUAL(range[0], 100501); - TVector valuesBool{false, true, false, false, false, false, true}; + std::vector valuesBool{false, true, false, false, false, false, true}; auto rangeBVector = MakeIteratorRange(valuesBool.begin(), valuesBool.end()); UNIT_ASSERT_VALUES_EQUAL(rangeBVector[1], true); rangeBVector[0] = true; diff --git a/util/generic/iterator_ut.cpp b/util/generic/iterator_ut.cpp index 00be19e10ec..2c6f9b66726 100644 --- a/util/generic/iterator_ut.cpp +++ b/util/generic/iterator_ut.cpp @@ -4,7 +4,7 @@ Y_UNIT_TEST_SUITE(TIterator) { Y_UNIT_TEST(ToForwardIteratorTest) { - TVector x = {1, 2}; + std::vector x = {1, 2}; UNIT_ASSERT_VALUES_EQUAL(*std::prev(x.end()), *ToForwardIterator(x.rbegin())); UNIT_ASSERT_VALUES_EQUAL(*ToForwardIterator(std::prev(x.rend())), *x.begin()); } @@ -52,7 +52,7 @@ Y_UNIT_TEST_SUITE(TInputRangeAdaptor) { }; Y_UNIT_TEST(TUrlPart) { - const TVector expected = {TStringBuf("yandex.ru"), TStringBuf("search?")}; + const std::vector expected = {TStringBuf("yandex.ru"), TStringBuf("search?")}; auto expected_part = expected.begin(); for (const TStringBuf& part : TUrlPart(TStringBuf("yandex.ru/search?"))) { UNIT_ASSERT_VALUES_EQUAL(part, *expected_part); diff --git a/util/generic/map_ut.cpp b/util/generic/map_ut.cpp index 79e832b024f..7182a6db306 100644 --- a/util/generic/map_ut.cpp +++ b/util/generic/map_ut.cpp @@ -434,7 +434,7 @@ Y_UNIT_TEST_SUITE(TYMapTest) { c.insert(std::make_pair(TKey(2), 102)); c.insert(std::make_pair(TKey(3), 103)); - TVector values; + std::vector values; for (auto& i : c) { values.push_back(i.second); } diff --git a/util/generic/maybe_ut.cpp b/util/generic/maybe_ut.cpp index 2c1a425c5ef..5d64a38c52a 100644 --- a/util/generic/maybe_ut.cpp +++ b/util/generic/maybe_ut.cpp @@ -533,7 +533,7 @@ Y_UNIT_TEST_SUITE(TMaybeTest) { } { - auto m3 = MakeMaybe>({1, 2, 3, 4, 5}); + auto m3 = MakeMaybe>({1, 2, 3, 4, 5}); UNIT_ASSERT(m3->size() == 5); UNIT_ASSERT(m3->at(0) == 1); UNIT_ASSERT(m3->at(1) == 2); @@ -564,13 +564,13 @@ Y_UNIT_TEST_SUITE(TMaybeTest) { { struct TMockStruct5 { - TMockStruct5(const TVector& vec, bool someFlag) + TMockStruct5(const std::vector& vec, bool someFlag) : Vec_(vec) , SomeFlag_(someFlag) { } - TVector Vec_; + std::vector Vec_; bool SomeFlag_; }; diff --git a/util/generic/objects_counter_ut.cpp b/util/generic/objects_counter_ut.cpp index 4d5da37a56f..e6c387af613 100644 --- a/util/generic/objects_counter_ut.cpp +++ b/util/generic/objects_counter_ut.cpp @@ -8,7 +8,7 @@ Y_UNIT_TEST_SUITE(ObjectsCounter) { Y_UNIT_TEST(Test1) { TObject obj; - TVector objects; + std::vector objects; for (ui32 i = 0; i < 100; ++i) { objects.push_back(obj); } diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp index 1e84e4fadb9..d35bd8f7e93 100644 --- a/util/generic/ptr_ut.cpp +++ b/util/generic/ptr_ut.cpp @@ -342,9 +342,9 @@ void TPointerTest::TestIntrPtr() { TIntrusivePtr p, p2; TOp3 op3; { - TVector> f1; + std::vector> f1; { - TVector> f2; + std::vector> f2; f2.push_back(new TOp); p = new TOp; f2.push_back(p); @@ -562,7 +562,7 @@ namespace { } void TPointerTest::TestOperatorBool() { - using TVec = TVector; + using TVec = std::vector; // to be sure TImplicitlyCastable works as expected UNIT_ASSERT((TImplicitlyCastable::Result)); diff --git a/util/generic/serialized_enum.h b/util/generic/serialized_enum.h index 8188c43eede..a00902cca51 100644 --- a/util/generic/serialized_enum.h +++ b/util/generic/serialized_enum.h @@ -36,7 +36,7 @@ namespace NEnumSerializationRuntime { template struct TSelectEnumRepresentationType; - template > + template > class TMappedArrayView; template > @@ -47,7 +47,7 @@ namespace NEnumSerializationRuntime { template using TMappedDictView = NDetail::TMappedDictView::TType, TValueType>; - /// Class with behaviour similar to TVector + /// Class with behaviour similar to std::vector template using TMappedArrayView = NDetail::TMappedArrayView::TType>; @@ -80,7 +80,7 @@ namespace NEnumSerializationRuntime { * @tparam EnumT enum type */ template - const TVector& GetEnumAllCppNamesImpl(); + const std::vector& GetEnumAllCppNamesImpl(); /** * Converts @c e to a string. Works like @c ToString(e) function, but returns @c TStringBuf instead of @c TString. @@ -127,7 +127,7 @@ Y_CONST_FUNCTION const TString& GetEnumAllNames() { * @tparam EnumT enum type */ template -Y_CONST_FUNCTION const TVector& GetEnumAllCppNames() { +Y_CONST_FUNCTION const std::vector& GetEnumAllCppNames() { return ::NEnumSerializationRuntime::GetEnumAllCppNamesImpl(); } @@ -173,7 +173,7 @@ namespace NEnumSerializationRuntime { } }; - /// Wrapper class with behaviour similar to TVector + /// Wrapper class with behaviour similar to std::vector /// /// @tparam TEnumType enum type at the external interface /// @tparam TRepresentationType designated underlying type of enum @@ -268,7 +268,7 @@ namespace NEnumSerializationRuntime { } // Allocate container and copy view's content into it - template