Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
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
 

Detailed Description

Definition at line 42 of file widget.h.

Constructor & Destructor Documentation

◆ Widget()

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

Definition at line 40 of file widget.cc.

41 : number_(number),
42 name_(name) {}
std::string name

◆ ~Widget()

Widget::~Widget ( )

Definition at line 44 of file widget.cc.

44{}

Member Function Documentation

◆ GetCharPtrValue()

void Widget::GetCharPtrValue ( char * buffer,
size_t max_size ) const

Definition at line 58 of file widget.cc.

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}
Here is the caller graph for this function:

◆ GetFloatValue()

float Widget::GetFloatValue ( ) const

Definition at line 46 of file widget.cc.

46 {
47 return number_;
48}
Here is the caller graph for this function:

◆ GetIntValue()

int Widget::GetIntValue ( ) const

Definition at line 50 of file widget.cc.

50 {
51 return static_cast<int>(number_);
52}
Here is the caller graph for this function:

◆ GetStringValue()

std::string Widget::GetStringValue ( ) const

Definition at line 54 of file widget.cc.

54 {
55 return name_;
56}
Here is the caller graph for this function:

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