Stub implementation of the various subsystem facades
This commit is contained in:
parent
2dd90e4fad
commit
3518235b57
14 changed files with 763 additions and 12 deletions
72
src/backend/enginefacade.cpp
Normal file
72
src/backend/enginefacade.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
EngineFacade - access point for communicating with the render engine
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "backend/enginefacade.hpp"
|
||||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
using lumiera::Subsys;
|
||||
|
||||
class EngineSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if renderengine should be started");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("pull up renderengine and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("initiate halting the engine");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static lumiera::Singleton<EngineSubsysDescriptor> theDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
|
||||
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
EngineFacade::getDescriptor()
|
||||
{
|
||||
return theDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
63
src/backend/enginefacade.hpp
Normal file
63
src/backend/enginefacade.hpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
ENGINEFACADE.hpp - access point for communicating with the render engine
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BACKEND_INTERFACE_ENGINEFACADE_H
|
||||
#define BACKEND_INTERFACE_ENGINEFACADE_H
|
||||
|
||||
|
||||
#include "lumiera/subsys.hpp"
|
||||
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* Interface to the backend layer (render engine subsystem):
|
||||
* Global access point for starting the render engine subsystem and
|
||||
* for defining the public interface(s) for talking with the engine.
|
||||
*
|
||||
* While the engine is partially implemented relying on Proc-Layer
|
||||
* operations, the general access point and the playback/render
|
||||
* controller is considered part of the backend. This results in
|
||||
* a "W"-shaped control flow: from GUI to backend to proc to
|
||||
* backend, feeding resulting data to output.
|
||||
*
|
||||
*/
|
||||
struct EngineFacade
|
||||
{
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to pull up and
|
||||
* shut down the renderengine. */
|
||||
static lumiera::Subsys& getDescriptor();
|
||||
|
||||
|
||||
//////////////////TODO: define the global access interface for the engine
|
||||
//////////////////TODO: provide a function for accessing this interface
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
#endif
|
||||
72
src/backend/netnodefacade.cpp
Normal file
72
src/backend/netnodefacade.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
NetNodeFacade - access point for maintaining a renderfarm node
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "backend/netnodefacade.hpp"
|
||||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
using lumiera::Subsys;
|
||||
|
||||
class NetNodeSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if render node service should be provided");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("open a render node server port and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("initiate shutting down the render node");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static lumiera::Singleton<NetNodeSubsysDescriptor> theDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
|
||||
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
NetNodeFacade::getDescriptor()
|
||||
{
|
||||
return theDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
61
src/backend/netnodefacade.hpp
Normal file
61
src/backend/netnodefacade.hpp
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
NETNODEFACADE.hpp - access point for maintaining a renderfarm node
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BACKEND_INTERFACE_NETNODEFACADE_H
|
||||
#define BACKEND_INTERFACE_NETNODEFACADE_H
|
||||
|
||||
|
||||
#include "lumiera/subsys.hpp"
|
||||
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* Interface to the backend layer (renderfarm node):
|
||||
* Global access point for starting a server listening on a TCP port
|
||||
* and accepting render tasks. Possibly such a server could also
|
||||
* use the backend file/media access functions to provide a media
|
||||
* data access service.
|
||||
*
|
||||
* @todo define the services provided by such a node.
|
||||
*
|
||||
*/
|
||||
struct NetNodeFacade
|
||||
{
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to start and stop
|
||||
* a node server accepting render / file jobs via network. */
|
||||
static lumiera::Subsys& getDescriptor();
|
||||
|
||||
|
||||
//////////////////TODO: define the global access interface for a renderfarm node server
|
||||
//////////////////TODO: provide a function for accessing this interface
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
#endif
|
||||
72
src/backend/scriptrunnerfacade.cpp
Normal file
72
src/backend/scriptrunnerfacade.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
ScriptRunnerFacade - access point for running a script within Lumiera application context
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "backend/scriptrunnerfacade.hpp"
|
||||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
using lumiera::Subsys;
|
||||
|
||||
class ScriptRunnerSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if a script should be executed");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("start the script as defined by the options and register script abort/exit hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("halt any running script");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static lumiera::Singleton<ScriptRunnerSubsysDescriptor> theDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
|
||||
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
ScriptRunnerFacade::getDescriptor()
|
||||
{
|
||||
return theDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
59
src/backend/scriptrunnerfacade.hpp
Normal file
59
src/backend/scriptrunnerfacade.hpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
SCRIPTRUNNERFACADE.hpp - access point for running a script within Lumiera application context
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BACKEND_INTERFACE_SCRIPTRUNNERFACADE_H
|
||||
#define BACKEND_INTERFACE_SCRIPTRUNNERFACADE_H
|
||||
|
||||
|
||||
#include "lumiera/subsys.hpp"
|
||||
|
||||
|
||||
|
||||
namespace backend {
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Interface to the backend layer (script runner):
|
||||
* Global access point for starting a script within Lumiera application
|
||||
* context.
|
||||
*
|
||||
* @todo build the (LUA,C)-script runner.
|
||||
*
|
||||
*/
|
||||
struct ScriptRunnerFacade
|
||||
{
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to start a script and to
|
||||
* (prematurely) abort a running script. */
|
||||
static lumiera::Subsys& getDescriptor();
|
||||
|
||||
|
||||
//////////////////TODO: define the access interface for starting a (LUA, C, ...)-script
|
||||
//////////////////TODO: provide a function for accessing this interface
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace backend
|
||||
#endif
|
||||
80
src/gui/guifacade.hpp
Normal file
80
src/gui/guifacade.hpp
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
GUIFACADE.hpp - access point for communicating with the Lumiera GTK GUI
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
/** @file guifacade.hpp
|
||||
** Interface for the GUI loader and for accessing the GUI interface from the
|
||||
** lower layers of Lumiera. While part of the public interface of the Lumiera GUI,
|
||||
** the implementation of this facility is part of the core application (and not
|
||||
** contained within the GUI dynamic module), because it's job is to load and
|
||||
** activate this module and to startup the GUI.
|
||||
**
|
||||
** @see lumiera::AppState
|
||||
** @see lumiera::Option
|
||||
** @see guifacade.cpp
|
||||
** @see main.cpp
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GUI_FACADE_H
|
||||
#define GUI_FACADE_H
|
||||
|
||||
|
||||
#include "lumiera/subsys.hpp"
|
||||
|
||||
|
||||
|
||||
namespace gui {
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* Global access point for loading and starting up the Lumiera GTK GUI
|
||||
* and for defining the public interface(s) for addressing the GUI
|
||||
* from Backend or Proc-Layer.
|
||||
*
|
||||
* If running Lumiera with a GUI is required (the default case),
|
||||
* it is loaded as dynamic module, thus defining the interface(s)
|
||||
* for any further access. After successfully loading and starting
|
||||
* the GUI, this gui::Facade is wired internally with this interface
|
||||
* such as to allow transparent access from within the core. This
|
||||
* startup sequence includes providing the GUI with similar facade
|
||||
* access via interface handles for communication with Backend and
|
||||
* Proc-Layer.
|
||||
*
|
||||
*/
|
||||
struct GuiFacade
|
||||
{
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to load,
|
||||
* start and stop the Lumiera GTK GUI. */
|
||||
static lumiera::Subsys& getDescriptor();
|
||||
|
||||
|
||||
//////////////////TODO: define the global access interface for the GUI
|
||||
//////////////////TODO: provide a function for accessing this interface
|
||||
//////////////////TODO: register similar proxy/facade interfaces for Proc/Backend
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace gui
|
||||
#endif
|
||||
|
|
@ -96,7 +96,7 @@ namespace lumiera {
|
|||
|
||||
|
||||
|
||||
using AppState::ExitCode;
|
||||
typedef AppState::ExitCode ExitCode;
|
||||
|
||||
|
||||
ExitCode
|
||||
|
|
|
|||
72
src/lumiera/guifacade.cpp
Normal file
72
src/lumiera/guifacade.cpp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
GuiFacade - access point for communicating with the Lumiera GTK GUI
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "gui/guifacade.hpp"
|
||||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
namespace gui {
|
||||
|
||||
using lumiera::Subsys;
|
||||
|
||||
class GuiSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if a GUI is needed");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("load and start the GUI and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("initiate closing the GUI");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static lumiera::Singleton<GuiSubsysDescriptor> theDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
|
||||
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
GuiFacade::getDescriptor()
|
||||
{
|
||||
return theDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace gui
|
||||
|
|
@ -30,18 +30,24 @@
|
|||
#include "lumiera/appstate.hpp"
|
||||
#include "lumiera/option.hpp"
|
||||
|
||||
#include "backend/enginefacade.hpp"
|
||||
#include "backend/netnodefacade.hpp"
|
||||
#include "backend/scriptrunnerfacade.hpp"
|
||||
#include "proc/facade.hpp"
|
||||
#include "gui/guifacade.hpp"
|
||||
|
||||
using util::Cmdline;
|
||||
using lumiera::Subsys;
|
||||
using lumiera::AppState;
|
||||
using lumiera::ON_GLOBAL_INIT;
|
||||
|
||||
namespace {
|
||||
Subsys engine = backend::EngineFacade::getDescriptor();
|
||||
Subsys netNode = backend::NetNodeFacade::getDescriptor();
|
||||
Subsys script = backend::ScriptRunnerFacade::getDescriptor();
|
||||
Subsys builder = proc::Facade::getBuilderDescriptor();
|
||||
Subsys session = proc::Facade::getSessionDescriptor();
|
||||
Subsys lumigui = gui::Facade::getDescriptor();
|
||||
Subsys& engine = backend::EngineFacade::getDescriptor();
|
||||
Subsys& netNode = backend::NetNodeFacade::getDescriptor();
|
||||
Subsys& script = backend::ScriptRunnerFacade::getDescriptor();
|
||||
Subsys& builder = proc::Facade::getBuilderDescriptor();
|
||||
Subsys& session = proc::Facade::getSessionDescriptor();
|
||||
Subsys& lumigui = gui::GuiFacade::getDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,9 +48,11 @@ namespace lumiera {
|
|||
: syntax("Run a collection of test cases. Supported parameters"),
|
||||
parameters()
|
||||
{
|
||||
UNIMPLEMENTED ("parse main Lumiera application parameters");
|
||||
|
||||
syntax.add_options()
|
||||
("help,h", "produce help message")
|
||||
("group,g", op::value<string>()->default_value(Suite::ALLGROUP),
|
||||
("group,g", op::value<string>()->default_value("blablubb"),
|
||||
"the group (selection) of testcases to execute")
|
||||
("describe", op::bool_switch(),
|
||||
"enumerate all testcases in this Suite in a format usable with ./test.sh.")
|
||||
|
|
@ -87,6 +89,8 @@ namespace lumiera {
|
|||
const string
|
||||
Option::getTestgroup ()
|
||||
{
|
||||
NOTREACHED; ////////////////////////////TODO: define real query functions
|
||||
|
||||
ASSERT (parameters.count ("group"));
|
||||
return parameters["group"].as<string>();
|
||||
}
|
||||
|
|
@ -96,6 +100,8 @@ namespace lumiera {
|
|||
const string
|
||||
Option::getTestID ()
|
||||
{
|
||||
NOTREACHED; ////////////////////////////TODO: define real query functions
|
||||
|
||||
if (parameters.count ("id") &&
|
||||
parameters["id"].as<VectS>().size() > 0)
|
||||
return parameters["id"].as<VectS>()[0];
|
||||
|
|
@ -107,6 +113,8 @@ namespace lumiera {
|
|||
const bool
|
||||
Option::getDescribe ()
|
||||
{
|
||||
NOTREACHED; ////////////////////////////TODO: define real query functions
|
||||
|
||||
return parameters["describe"].as<bool>();
|
||||
}
|
||||
|
||||
|
|
@ -115,6 +123,8 @@ namespace lumiera {
|
|||
ostream&
|
||||
operator<< (ostream& os, const Option& to)
|
||||
{
|
||||
NOTREACHED; ////////////////////////////TODO: define real query help messg
|
||||
|
||||
return os << to.syntax;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
//#include "include/symbol.hpp"
|
||||
#include "include/error.hpp"
|
||||
#include "lumiera/option.hpp"
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
//#include <boost/scoped_ptr.hpp>
|
||||
|
|
@ -59,7 +60,6 @@ namespace lumiera {
|
|||
// using boost::scoped_ptr;
|
||||
using boost::noncopyable;
|
||||
|
||||
typedef void (SigTerm)(Error*); ///////////////////TODO better use Glib-- Signal type?
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +71,8 @@ namespace lumiera {
|
|||
: private noncopyable
|
||||
{
|
||||
public:
|
||||
// Subsys ();
|
||||
typedef void (SigTerm)(Error*); ///////////////////TODO better use Glib-- Signal type?
|
||||
|
||||
|
||||
virtual ~Subsys () {};
|
||||
|
||||
|
|
@ -112,7 +113,7 @@ namespace lumiera {
|
|||
|
||||
|
||||
//------ implementation skeleton ----------
|
||||
Subsys&
|
||||
inline Subsys&
|
||||
Subsys::depends (Subsys& prereq)
|
||||
{
|
||||
TODO ("anything else to care when defining a dependency on the prerequisite subsystem??");/////////////////////TODO
|
||||
|
|
@ -122,7 +123,7 @@ namespace lumiera {
|
|||
|
||||
|
||||
|
||||
bool
|
||||
inline bool
|
||||
Subsys::isRunning()
|
||||
{
|
||||
UNIMPLEMENTED ("maintain isRunning flag in a threadsafe manner");
|
||||
|
|
|
|||
110
src/proc/facade.cpp
Normal file
110
src/proc/facade.cpp
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
Facade - access point for communicating with the Proc-Interface
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "proc/facade.hpp"
|
||||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
namespace proc {
|
||||
|
||||
using lumiera::Subsys;
|
||||
|
||||
|
||||
class BuilderSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if we need a Builder Thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("fire up a Builder in a separate Thread, and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("halt the Builder and cancel any build process"); /////TODO really cancel??
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class SessionSubsysDescriptor
|
||||
: public Subsys
|
||||
{
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
{
|
||||
UNIMPLEMENTED ("determine, if an existing Session schould be loaded");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
{
|
||||
UNIMPLEMENTED ("load an existing session as denoted by the options and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
{
|
||||
UNIMPLEMENTED ("initiate closing this Session");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static lumiera::Singleton<BuilderSubsysDescriptor> theBuilderDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
static lumiera::Singleton<BuilderSubsysDescriptor> theSessionDescriptor; //////////////////TODO: work out startup sequence. Don't use static init!
|
||||
|
||||
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
Facade::getBuilderDescriptor()
|
||||
{
|
||||
return theBuilderDescriptor();
|
||||
}
|
||||
|
||||
|
||||
/** @internal intended for use by main(). */
|
||||
Subsys&
|
||||
Facade::getSessionDescriptor()
|
||||
{
|
||||
return theSessionDescriptor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace proc
|
||||
73
src/proc/facade.hpp
Normal file
73
src/proc/facade.hpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
FACADE.hpp - access point for communicating with the Proc-Interface
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PROC_INTERFACE_FACADE_H
|
||||
#define PROC_INTERFACE_FACADE_H
|
||||
|
||||
|
||||
#include "lumiera/subsys.hpp"
|
||||
|
||||
|
||||
|
||||
namespace proc {
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* Global access point for loading and starting up the Lumiera GTK GUI
|
||||
* and for defining the public interface(s) for addressing the GUI
|
||||
* from Backend or Proc-Layer.
|
||||
*
|
||||
* If running Lumiera with a GUI is required (the default case),
|
||||
* it is loaded as dynamic module, thus defining the interface(s)
|
||||
* for any further access. After successfully loading and starting
|
||||
* the GUI, this gui::Facade is wired internally with this interface
|
||||
* such as to allow transparent access from within the core. This
|
||||
* startup sequence includes providing the GUI with similar facade
|
||||
* access via interface handles for communication with Backend and
|
||||
* Proc-Layer.
|
||||
*
|
||||
*/
|
||||
struct Facade
|
||||
{
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to fire off
|
||||
* or halt the Builder thread within Proc. */
|
||||
static lumiera::Subsys& getBuilderDescriptor();
|
||||
|
||||
|
||||
/** provide a descriptor for lumiera::AppState,
|
||||
* wired accordingly to allow main to load and
|
||||
* save an existing session. */
|
||||
static lumiera::Subsys& getSessionDescriptor();
|
||||
|
||||
|
||||
//////////////////TODO: define the global access interfaces for the Proc-Layer
|
||||
//////////////////TODO: provide a function for accessing this interface
|
||||
//////////////////TODO: register similar proxy/facade interfaces for the GUI
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace proc
|
||||
#endif
|
||||
Loading…
Reference in a new issue