Commit 17806d1d authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - basic requirement classes for checking the complyment of several...

[ADD] - basic requirement classes for checking the complyment of several requirements on the target system.
parent 667cad58
//---------------------------------------------------------------------------
//
// 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 "WRequirement.h"
WRequirement::WRequirement()
{
// initialize members
}
WRequirement::~WRequirement()
{
// cleanup
}
//---------------------------------------------------------------------------
//
// 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 WREQUIREMENT_H
#define WREQUIREMENT_H
/**
* Base class for all possible kinds of requirements. Derive your own kind of requirement from this class. This allows easy checking of required
* features on a target system. Of course this is only useful for things checkable during runtime. You should avoid writing classes for checking
* weather some library is installed or not. This is checked by the linker on the target system.
*/
class WRequirement
{
public:
/**
* Default constructor.
*/
WRequirement();
/**
* Destructor.
*/
virtual ~WRequirement();
/**
* Checks if the requirement is fulfilled on the system. Implement this for your specific case.
*
* \return true if the specific requirement is fulfilled.
*/
virtual bool isComplied() const = 0;
protected:
private:
};
#endif // WREQUIREMENT_H
//---------------------------------------------------------------------------
//
// 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 "WGraphicsEngine.h"
#include "WGERequirement.h"
WGERequirement::WGERequirement():
WRequirement()
{
// initialize members
}
WGERequirement::~WGERequirement()
{
// cleanup
}
bool WGERequirement::isComplied() const
{
// TODO(all): implement this properly if you modify the WGE for no-gui versions of OpenWalnut.
return true;
}
//---------------------------------------------------------------------------
//
// 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 WGEREQUIREMENT_H
#define WGEREQUIREMENT_H
#include "../common/WRequirement.h"
/**
* This requirement ensures an up and running WGE.
*/
class WGERequirement: public WRequirement
{
public:
/**
* Create instance. If your module uses this requirement, it needs running WGE.
*/
WGERequirement();
/**
* Destructor.
*/
virtual ~WGERequirement();
/**
* Checks if the requirement is fulfilled on the system. Implement this for your specific case.
*
* \return true if the specific requirement is fulfilled.
*/
virtual bool isComplied() const = 0;
protected:
private:
};
#endif // WGEREQUIREMENT_H
......@@ -74,7 +74,7 @@ class OWKERNEL_EXPORT WModule: public WThreadedRunner,
friend class WModuleConnector; // requires access to notify members
template< typename T > friend class WModuleInputData; // requires access for convenience functions to automatically add a created connector
template< typename T > friend class WModuleOutputData; // requires access for convenience functions to automatically add a created connector
friend class WModuleFactory; // for proper creation of module instaces, the factory needs access to protected functions.
friend class WModuleFactory; // for proper creation of module instances, the factory needs access to protected functions.
// (especially initialize)
friend class WModuleContainer; // for proper management of m_container WModuleContainer needs access.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment