Helper for property controlled subsystems
- Subsystem which manages a list of elements which are controlled through the property tree. - Fix a ShivaVG compiler warning. - Add some helper functions to trigger property removed/add events for a whole property tree.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
// Base class for elements of property controlled subsystems
|
||||
//
|
||||
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include "PropertyBasedElement.hxx"
|
||||
|
||||
namespace simgear
|
||||
{
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
PropertyBasedElement::PropertyBasedElement(SGPropertyNode* node):
|
||||
_node(node)
|
||||
{
|
||||
_node->addChangeListener(this);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
PropertyBasedElement::~PropertyBasedElement()
|
||||
{
|
||||
_node->removeChangeListener(this);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
SGConstPropertyNode_ptr PropertyBasedElement::getProps() const
|
||||
{
|
||||
return _node;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
SGPropertyNode_ptr PropertyBasedElement::getProps()
|
||||
{
|
||||
return _node;
|
||||
}
|
||||
|
||||
} // namespace simgear
|
||||
Reference in New Issue
Block a user