Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a187fe10
Commit
a187fe10
authored
Feb 02, 2010
by
Sebastian Eichelbaum
Browse files
[ADD] - added base class common for every property
parent
007cf56d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
0 deletions
+152
-0
src/common/WPropertyBase.cpp
src/common/WPropertyBase.cpp
+53
-0
src/common/WPropertyBase.h
src/common/WPropertyBase.h
+99
-0
No files found.
src/common/WPropertyBase.cpp
0 → 100644
View file @
a187fe10
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include "WPropertyBase.h"
WPropertyBase
::
WPropertyBase
(
std
::
string
name
,
std
::
string
description
)
:
m_name
(
name
),
m_description
(
description
)
{
// initialize members
}
WPropertyBase
::~
WPropertyBase
()
{
// cleanup
}
std
::
string
WPropertyBase
::
getName
()
const
{
return
m_name
;
}
std
::
string
WPropertyBase
::
getDescription
()
const
{
return
m_description
;
}
PROPERTY_TYPE
WPropertyBase
::
getType
()
const
{
return
m_type
;
}
src/common/WPropertyBase.h
0 → 100644
View file @
a187fe10
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WPROPERTYBASE_H
#define WPROPERTYBASE_H
#include <string>
#include "WPropertyTypes.h"
/**
* Abstract base class for all properties. Simply provides name and type information.
*/
class
WPropertyBase
{
public:
/**
* Create an empty named property.
*
* \param name the name of the property
* \param description the description of the property
*/
WPropertyBase
(
std
::
string
name
,
std
::
string
description
);
/**
* Destructor.
*/
virtual
~
WPropertyBase
();
/**
* Gets the name of the class.
*
* \return the name.
*/
std
::
string
getName
()
const
;
/**
* Gets the description of the property.
*
* \return the description
*/
std
::
string
getDescription
()
const
;
/**
* Gets the real WPropertyVariable type of this instance.
*
* \return the real type.
*/
virtual
PROPERTY_TYPE
getType
()
const
;
protected:
/**
* Name of the property.
*/
std
::
string
m_name
;
/**
* Description of the property.
*/
std
::
string
m_description
;
/**
* Type of the PropertyVariable instance
*/
PROPERTY_TYPE
m_type
;
/**
* Calculates the type of the property. This has to be done by the implementing class.
*/
virtual
void
updateType
()
=
0
;
private:
};
#endif // WPROPERTYBASE_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment