16#ifndef OSGWIDGET_UI_OBJECT_PARENT
17#define OSGWIDGET_UI_OBJECT_PARENT
31 typedef std::vector<ptr_type>
Vector;
51 typename Vector::size_type
size()
const {
56 return _getByName(name);
60 return _getByName(name);
64 return _getByIndex(index);
68 return _getByIndex(index);
88 if(i ==
end())
return false;
110 object_type* _getByName(
const std::string& name)
const {
112 if(i->valid() && i->get()->getName() == name)
return i->get();
118 object_type* _getByIndex(
unsigned int index)
const {
120 if(i->valid() && i->get()->getIndex() == index)
return i->get();
The osgWidget library is a NodeKit that extends the core scene graph to support a 2D (and eventually ...
Definition Box:21
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
Definition UIObjectParent:26
Iterator end()
Definition UIObjectParent:43
const Vector & getObjects() const
Definition UIObjectParent:79
Vector _objects
Definition UIObjectParent:105
T object_type
Definition UIObjectParent:29
const object_type * getByName(const std::string &name) const
Definition UIObjectParent:59
object_type * getByName(const std::string &name)
Definition UIObjectParent:55
Vector::iterator Iterator
Definition UIObjectParent:32
bool _removeByName(const std::string &name)
Definition UIObjectParent:95
const object_type * getByIndex(unsigned int index) const
Definition UIObjectParent:67
object_type * getByIndex(unsigned int index)
Definition UIObjectParent:63
Vector::const_iterator ConstIterator
Definition UIObjectParent:33
Iterator begin()
Definition UIObjectParent:35
bool _remove(object_type *obj)
Definition UIObjectParent:85
Vector::size_type size() const
Definition UIObjectParent:51
unsigned int getNumObjects() const
Definition UIObjectParent:71
std::vector< ptr_type > Vector
Definition UIObjectParent:31
ConstIterator begin() const
Definition UIObjectParent:39
Vector & getObjects()
Definition UIObjectParent:75
osg::observer_ptr< object_type > ptr_type
Definition UIObjectParent:30
ConstIterator end() const
Definition UIObjectParent:47