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