proxygen
folly::gen::detail::Append< Collection > Class Template Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::Append< Collection >:
folly::gen::Operator< Append< Collection > > folly::gen::FBounded< Self >

Public Member Functions

 Append (Collection *collection)
 
template<class Value , class Source >
Collection & compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Append< Collection > >
ResultGen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Private Attributes

Collection * collection_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::gen::Operator< Append< Collection > >
 Operator ()=default
 
 Operator (Operator &&) noexcept=default
 
 Operator (const Operator &)=default
 
Operatoroperator= (Operator &&) noexcept=default
 
Operatoroperator= (const Operator &)=default
 

Detailed Description

template<class Collection>
class folly::gen::detail::Append< Collection >

Append - For collecting values from a source into a given output container by appending.

This type is usually used through the helper function 'appendTo', like:

vector<int64_t> ids; from(results) | map([](Person& p) { return p.id }) | appendTo(ids);

Definition at line 2267 of file Base-inl.h.

Constructor & Destructor Documentation

template<class Collection >
folly::gen::detail::Append< Collection >::Append ( Collection *  collection)
inlineexplicit

Definition at line 2271 of file Base-inl.h.

2271 : collection_(collection) {}
Collection * collection_
Definition: Base-inl.h:2268

Member Function Documentation

template<class Collection >
template<class Value , class Source >
Collection& folly::gen::detail::Append< Collection >::compose ( const GenImpl< Value, Source > &  source) const
inline

Definition at line 2274 of file Base-inl.h.

References v, and testing::Value().

2274  {
2275  static_assert(!Source::infinite, "Cannot appendTo with infinite source");
2276  source | [&](Value v) {
2277  collection_->insert(collection_->end(), std::forward<Value>(v));
2278  };
2279  return *collection_;
2280  }
auto v
bool Value(const T &value, M matcher)
Collection * collection_
Definition: Base-inl.h:2268

Member Data Documentation

template<class Collection >
Collection* folly::gen::detail::Append< Collection >::collection_
private

Definition at line 2268 of file Base-inl.h.


The documentation for this class was generated from the following file: