gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
non_value_widget.hpp
Go to the documentation of this file.
1 
25 #ifndef NONVALUEWIDGET_HPP
26 #define NONVALUEWIDGET_HPP
27 
29 
30 namespace gphoto2pp
31 {
37  {
38  public:
45  int countChildren() const;
46 
54  template<typename T>
55  T getChildByName(std::string const & name) const
56  {
57  auto cameraWidget = getChildByNameWrapper(name);
58  return T(cameraWidget);
59  }
60 
68  template<typename T>
69  T getChildByLabel(std::string const & label) const
70  {
71  auto cameraWidget = getChildByLabelWrapper(label);
72  return T(cameraWidget);
73  }
74 
82  template<typename T>
83  T getChild(int index) const
84  {
85  auto cameraWidget = getChildWrapper(index);
86  return T(cameraWidget);
87  }
88 
96  template<typename T>
97  T getChildById(int id) const
98  {
99  auto cameraWidget = getChildByIdWrapper(id);
100  return T(cameraWidget);
101  }
102 
103  protected:
104  NonValueWidget(gphoto2::_CameraWidget* cameraWidget);
105 
114  gphoto2::_CameraWidget* getChildByNameWrapper(std::string const & name) const;
115 
124  gphoto2::_CameraWidget* getChildByLabelWrapper(std::string const & label) const;
125 
135  gphoto2::_CameraWidget* getChildWrapper(int index) const;
136 
145  gphoto2::_CameraWidget* getChildByIdWrapper(int id) const;
146  };
147 
148 }
149 
150 #endif // NONVALUEWIDGET_HPP