proxygen
Widget Class Reference

#include <widget.h>

Public Member Functions

 Widget (int number, const std::string &name)
 
 ~Widget ()
 
float GetFloatValue () const
 
int GetIntValue () const
 
std::string GetStringValue () const
 
void GetCharPtrValue (char *buffer, size_t max_size) const
 
 ~Widget ()
 
 Widget (int number, const std::string &name)
 
 ~Widget ()
 
float GetFloatValue () const
 
int GetIntValue () const
 
std::string GetStringValue () const
 
void GetCharPtrValue (char *buffer, size_t max_size) const
 
 Widget (int number, const std::string &name)
 
 ~Widget ()
 
float GetFloatValue () const
 
int GetIntValue () const
 
std::string GetStringValue () const
 
void GetCharPtrValue (char *buffer, size_t max_size) const
 

Static Public Member Functions

static void customDeleter (Widget *w, TLPDestructionMode mode)
 

Public Attributes

int val_
 

Static Public Attributes

static int totalVal_ = 0
 

Private Attributes

float number_
 
std::string name_
 

Detailed Description

Definition at line 42 of file widget.h.

Constructor & Destructor Documentation

Widget::Widget ( int  number,
const std::string name 
)

Definition at line 40 of file widget.cc.

41  : number_(number),
42  name_(name) {}
float number_
Definition: widget.h:57
std::string name_
Definition: widget.h:58
int number
const char * name
Definition: http_parser.c:437
Widget::~Widget ( )

Definition at line 44 of file widget.cc.

44 {}
Widget::~Widget ( )
inline

Definition at line 53 of file ThreadLocalTest.cpp.

53  {
54  totalVal_ += val_;
55  }
static int totalVal_
Widget::Widget ( int  number,
const std::string name 
)
Widget::~Widget ( )
Widget::Widget ( int  number,
const std::string name 
)
Widget::~Widget ( )

Member Function Documentation

static void Widget::customDeleter ( Widget w,
TLPDestructionMode  mode 
)
inlinestatic

Definition at line 57 of file ThreadLocalTest.cpp.

References folly::ALL_THREADS, and totalVal_.

Referenced by TEST().

57  {
58  totalVal_ += (mode == TLPDestructionMode::ALL_THREADS) ? 1000 : 1;
59  delete w;
60  }
folly::Optional< PskKeyExchangeMode > mode
static int totalVal_
void Widget::GetCharPtrValue ( char *  buffer,
size_t  max_size 
) const

Definition at line 58 of file widget.cc.

References name_.

Referenced by TEST().

58  {
59  // Copy the char* representation of name_ into buffer, up to max_size.
60  strncpy(buffer, name_.c_str(), max_size-1);
61  buffer[max_size-1] = '\0';
62  return;
63 }
std::vector< uint8_t > buffer(kBufferSize+16)
std::string name_
Definition: widget.h:58
void Widget::GetCharPtrValue ( char *  buffer,
size_t  max_size 
) const
void Widget::GetCharPtrValue ( char *  buffer,
size_t  max_size 
) const
float Widget::GetFloatValue ( ) const

Definition at line 46 of file widget.cc.

References number_.

Referenced by TEST().

46  {
47  return number_;
48 }
float number_
Definition: widget.h:57
float Widget::GetFloatValue ( ) const
float Widget::GetFloatValue ( ) const
int Widget::GetIntValue ( ) const
int Widget::GetIntValue ( ) const

Definition at line 50 of file widget.cc.

References number_.

Referenced by TEST().

50  {
51  return static_cast<int>(number_);
52 }
float number_
Definition: widget.h:57
int Widget::GetIntValue ( ) const
std::string Widget::GetStringValue ( ) const

Definition at line 54 of file widget.cc.

References name_.

Referenced by TEST().

54  {
55  return name_;
56 }
std::string name_
Definition: widget.h:58
std::string Widget::GetStringValue ( ) const
std::string Widget::GetStringValue ( ) const

Member Data Documentation

std::string Widget::name_
private

Definition at line 58 of file widget.h.

Referenced by GetCharPtrValue(), and GetStringValue().

float Widget::number_
private

Definition at line 57 of file widget.h.

Referenced by GetFloatValue(), and GetIntValue().

int Widget::totalVal_ = 0
static

Definition at line 51 of file ThreadLocalTest.cpp.

Referenced by customDeleter(), and TEST().

int Widget::val_

Definition at line 52 of file ThreadLocalTest.cpp.


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