16 #ifndef OSGWIDGET_UI_OBJECT_PARENT
17 #define OSGWIDGET_UI_OBJECT_PARENT
20 #include <osg/observer_ptr>
31 typedef std::vector<ptr_type>
Vector;
47 ConstIterator
end()
const {
51 typename Vector::size_type
size()
const {
56 return _getByName(name);
59 const object_type*
getByName(
const std::string& name)
const {
60 return _getByName(name);
64 return _getByIndex(index);
67 const object_type*
getByIndex(
unsigned int index)
const {
68 return _getByIndex(index);
86 Iterator i = std::find(
begin(),
end(), obj);
88 if(i ==
end())
return false;
96 for(Iterator i =
begin(); i !=
end(); i++)
if(i->get()->getName() == name) {
110 object_type* _getByName(
const std::string& name)
const {
111 for(ConstIterator i =
begin(); i !=
end(); i++) {
112 if(i->valid() && i->get()->getName() == name)
return i->get();
118 object_type* _getByIndex(
unsigned int index)
const {
119 for(ConstIterator i =
begin(); i !=
end(); i++) {
120 if(i->valid() && i->get()->getIndex() == index)
return i->get();