proxygen
proxygen::TraceEvent::MetaData Struct Reference

#include <TraceEvent.h>

Classes

struct  ConvVisitor
 
struct  ConvVisitor< std::string >
 
struct  ConvVisitor< std::vector< std::string > >
 

Public Types

using MetaDataType = boost::variant< int64_t, std::string, std::vector< std::string >>
 

Public Member Functions

template<typename T , typename = typename std::enable_if<std::is_integral<T>::value, void>::type>
 MetaData (T value)
 
 MetaData (const std::string &value)
 
 MetaData (std::string &&value)
 
 MetaData (const char *value)
 
 MetaData (const folly::fbstring &value)
 
 MetaData (const std::vector< std::string > &value)
 
 MetaData (std::vector< std::string > &&value)
 
template<typename T >
T getValueAs () const
 
const std::type_info & type () const
 

Public Attributes

MetaDataType value_
 

Detailed Description

Definition at line 39 of file TraceEvent.h.

Member Typedef Documentation

Definition at line 42 of file TraceEvent.h.

Constructor & Destructor Documentation

template<typename T , typename = typename std::enable_if<std::is_integral<T>::value, void>::type>
proxygen::TraceEvent::MetaData::MetaData ( T  value)
inline

Definition at line 47 of file TraceEvent.h.

48  : value_(folly::to<int64_t>(value)) {}
static const char *const value
Definition: Conv.cpp:50
proxygen::TraceEvent::MetaData::MetaData ( const std::string value)
inline

Definition at line 50 of file TraceEvent.h.

50  :
51  value_(value) {
52  }
static const char *const value
Definition: Conv.cpp:50
proxygen::TraceEvent::MetaData::MetaData ( std::string &&  value)
inline

Definition at line 54 of file TraceEvent.h.

54  :
56  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
static const char *const value
Definition: Conv.cpp:50
proxygen::TraceEvent::MetaData::MetaData ( const char *  value)
inline

Definition at line 58 of file TraceEvent.h.

58  :
60  }
static const char *const value
Definition: Conv.cpp:50
const char * string
Definition: Conv.cpp:212
proxygen::TraceEvent::MetaData::MetaData ( const folly::fbstring value)
inline

Definition at line 62 of file TraceEvent.h.

62  :
63  value_(value.toStdString()) {
64  }
std::basic_string< E, T, A > toStdString() const
Definition: FBString.h:1227
proxygen::TraceEvent::MetaData::MetaData ( const std::vector< std::string > &  value)
inline

Definition at line 66 of file TraceEvent.h.

66  :
67  value_(value) {
68  }
proxygen::TraceEvent::MetaData::MetaData ( std::vector< std::string > &&  value)
inline

Definition at line 70 of file TraceEvent.h.

70  :
71  value_(std::move(value)) {
72  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

template<typename T >
T proxygen::TraceEvent::MetaData::getValueAs ( ) const
inline

Definition at line 75 of file TraceEvent.h.

References folly::apply_visitor(), and value_.

75  {
76  ConvVisitor<T> visitor;
77  return boost::apply_visitor(visitor, value_);
78  }
decltype(auto) apply_visitor(Visitor &&visitor, const DiscriminatedPtr< Args... > &variant)
const std::type_info& proxygen::TraceEvent::MetaData::type ( ) const
inline

Definition at line 80 of file TraceEvent.h.

References value_.

80  {
81  return value_.type();
82  }

Member Data Documentation

MetaDataType proxygen::TraceEvent::MetaData::value_

Definition at line 96 of file TraceEvent.h.

Referenced by getValueAs(), and type().


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