OpenWalnut  1.5.0dev
WOutputPropertyHandler.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include "WOutputPropertyHandler.h"
26 
28  WPropertyGroup::SPtr properties,
30  m_protonData( protonData ),
31  m_properties( properties ),
32  m_dataUpdate( dataUpdate )
33 {
34 }
35 
37 {
39  WPropGroup outputGroup = m_properties->addPropertyGroup( "Output", "Configures the third output" );
40  m_energyDeposition = outputGroup->addProperty( "Energy deposition", "Enables the energy deposition output", true, notifier );
41  m_eventID = outputGroup->addProperty( "Event id", "Enables the event id output", false, notifier );
42 }
43 
45 {
46  m_dataUpdate();
47 }
48 
50 {
51  return m_energyDeposition;
52 }
53 
55 {
56  return m_eventID;
57 }
boost::function< void() > CallbackPtr
Function typedf for updating the data.
WPropBool m_eventID
Whether to send the eventID or not.
WPropBool getEnergyDeposition()
Getter.
WOutputPropertyHandler(WProtonData::SPtr protonData, WPropertyGroup::SPtr properties, WOutputPropertyHandler::CallbackPtr dataUpdate)
constructor
WOutputPropertyHandler::CallbackPtr m_dataUpdate
A function variable that reinitializes the WDataSets.
WPropBool m_energyDeposition
Whether to send the energy deposition or not.
void createProperties()
creates the group property and the subroperties.
WPropertyGroup::SPtr m_properties
A property variable that is generated by the WModul.
void updateProperties()
update current group property and the subproperties.
boost::function< void(std::shared_ptr< WPropertyBase >)> PropertyChangeNotifierType
Signal signature emitted during set operations.
std::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type
std::shared_ptr< WProtonData > SPtr
shared_ptr that points to itself
Definition: WProtonData.h:52