mc_rtc::gui::Element Struct Reference

#include <mc_rtc/gui/elements.h>

Inheritance diagram for mc_rtc::gui::Element:

Public Member Functions

const std::string & name () const
 
int id () const
 
void id (int idIn)
 
void write (mc_rtc::MessagePackBuilder &)
 
bool handleRequest (const mc_rtc::Configuration &)
 
 Element ()
 

Static Public Member Functions

static constexpr size_t write_size ()
 

Protected Member Functions

 Element (const std::string &name)
 

Protected Attributes

std::string name_
 
int id_
 

Detailed Description

Element is the common class for every element's type available in the GUI. Since we use static polymorphism in the StateBuilder we don't need to make any functions virtual

Constructor & Destructor Documentation

◆ Element() [1/2]

mc_rtc::gui::Element::Element ( )
inline

Invalid element, used for Python bindings

◆ Element() [2/2]

mc_rtc::gui::Element::Element ( const std::string &  name)
protected

Member Function Documentation

◆ handleRequest()

bool mc_rtc::gui::Element::handleRequest ( const mc_rtc::Configuration )
inline

Take care of answering request from the client

◆ id() [1/2]

int mc_rtc::gui::Element::id ( ) const
inline

Access the stack id of an element (also referred to as SID)

Elements that should be displayed on the same line share the same id

◆ id() [2/2]

void mc_rtc::gui::Element::id ( int  idIn)
inline

Set the stack id of an element

◆ name()

const std::string& mc_rtc::gui::Element::name ( ) const
inline

Name of the element

◆ write()

void mc_rtc::gui::Element::write ( mc_rtc::MessagePackBuilder )
inline

Write the widget to a MessagePackBuilder

Writes nothing, the default data is written by GUIState since it knows if the sid is relevant.

◆ write_size()

static constexpr size_t mc_rtc::gui::Element::write_size ( )
inlinestaticconstexpr

Returns the size of the array representing the widget in the MessagePack

By default, it includes the widget name, type and SID.

Member Data Documentation

◆ id_

int mc_rtc::gui::Element::id_
protected

◆ name_

std::string mc_rtc::gui::Element::name_
protected

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