OpenWalnut  1.4.0
WGrid.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 <cstddef>
26 
27 #include <boost/shared_ptr.hpp>
28 
29 #include "../common/WProperties.h"
30 
31 #include "WGrid.h"
32 
33 WGrid::WGrid( size_t size )
34  : m_infoProperties( boost::shared_ptr< WProperties >( new WProperties( "Grid Properties", "Grid's information properties" ) ) ),
35  m_size( size )
36 {
37  m_infoProperties->setPurpose( PV_PURPOSE_INFORMATION );
38  WPropInt sizeGrid = m_infoProperties->addProperty( "Grid size: ", "The number of position in the grid.", static_cast<int>( m_size ) );
39 }
40 
42 {
43 }
44 
45 size_t WGrid::size() const
46 {
47  return m_size;
48 }
49 
50 boost::shared_ptr< WProperties > WGrid::getInformationProperties() const
51 {
52  return m_infoProperties;
53 }
virtual ~WGrid()
Since WGrid is a base class and thus should be polymorphic we add virtual destructor.
Definition: WGrid.cpp:41
WGrid(size_t size)
Constructs a new WGrid instance.
Definition: WGrid.cpp:33
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
boost::shared_ptr< WPropertyGroup > getInformationProperties() const
Returns a pointer to the information properties object of the grid.
Definition: WGrid.cpp:50
size_t m_size
Stores the number of positions.
Definition: WGrid.h:89
size_t size() const
The number of positions in this grid.
Definition: WGrid.cpp:45
boost::shared_ptr< WPropertyGroup > m_infoProperties
The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION".
Definition: WGrid.h:83