some cleanup and re-ordering

This commit is contained in:
Fischlurch 2009-01-30 00:17:01 +01:00
parent 19e85a95d4
commit ee950d6255
5 changed files with 58 additions and 48 deletions

View file

@ -28,31 +28,6 @@
using util::cStr;
#include "include/guinotificationfacade.h"
namespace gui {
/** storage for the facade proxy factory used by client code to invoke through the interface */
lumiera::facade::Accessor<GuiNotification> GuiNotification::facade;
} // namespace gui
#include "proc/play/dummy-player-service.hpp"
namespace proc {
namespace play {
/** storage for the DummyPlayer facade proxy factory... */
lumiera::facade::Accessor<DummyPlayer> DummyPlayer::facade;
} }
namespace lumiera {
namespace facade {
@ -117,10 +92,30 @@ namespace lumiera {
Proxy<IHA>::close();
}
} // namespace facade
} // namespace lumiera
/* ==================== GuiNotification =================================== */
#include "include/guinotificationfacade.h"
namespace gui {
/** storage for the facade proxy factory used by client code to invoke through the interface */
lumiera::facade::Accessor<GuiNotification> GuiNotification::facade;
} // namespace gui
namespace lumiera {
namespace facade {
typedef InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_GuiNotification, 0)
, gui::GuiNotification
> Handle_GuiNotification;
@ -144,7 +139,10 @@ namespace lumiera {
template void openProxy<Handle_GuiNotification> (Handle_GuiNotification const&);
template void closeProxy<Handle_GuiNotification> (void);
} // namespace facade
} // namespace lumiera
@ -152,6 +150,20 @@ namespace lumiera {
/* ==================== DummyPlayer ======================================= */
#include "proc/play/dummy-player-service.hpp"
namespace proc {
namespace play {
/** storage for the DummyPlayer facade proxy factory... */
lumiera::facade::Accessor<DummyPlayer> DummyPlayer::facade;
} }
namespace lumiera {
namespace facade {
typedef lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0)
, proc::play::DummyPlayer
> Handle_DummyPlayer;

View file

@ -86,8 +86,6 @@ namespace proc {
class Process
: public lib::Handle<ProcessImpl>
{
friend class ProcessImpl;
public:
void play(bool);
void* const getFrame();

View file

@ -87,11 +87,23 @@ namespace lib {
template<class Y> explicit Handle (weak_ptr<Y> const& wr) : smPtr_(wr) { }
template<class Y> explicit Handle (std::auto_ptr<Y> & ar) : smPtr_(ar) { }
Handle& operator= (Handle const& r) { smPtr_ = r.smPtr_; return *this; }
Handle& operator=(Handle const& r) { smPtr_ = r.smPtr_; return *this; }
template<class Y> Handle& operator=(shared_ptr<Y> const& sr) { smPtr_ = sr; return *this; }
template<class Y> Handle& operator=(std::auto_ptr<Y> & ar) { smPtr_ = ar; return *this; }
/** Activation of the handle by the managing service.
* @param impl the implementation object this handle is tied to
* @param whenDead functor to be invoked when reaching end-of-life
*/
template<typename DEL>
Handle&
activate (IMP* impl, DEL whenDead)
{
smPtr_.reset (impl, whenDead);
return *this;
}
/** deactivate this handle, so it isn't tied any longer
* to the associated implementation or service object.
* When all handles have either been deactivated or
@ -106,24 +118,11 @@ namespace lib {
/** implicit conversion to "bool" */
operator __unspecified_bool_type() const { return &Handle::smPtr_; } // never throws
bool operator! () const { return !bool(smPtr_); } // dito
protected:
/** Activation of the handle by the managing service.
* @param impl the implementation object this handle is tied to
* @param whenDead functor to be invoked when reaching end-of-life
*/
template<typename DEL>
Handle&
activate (IMP* impl, DEL whenDead)
{
smPtr_.reset (impl, whenDead);
return *this;
}
IMP&
impl()
{

View file

@ -291,8 +291,9 @@ namespace proc {
/* === Process Implementation === */
ProcessImpl::ProcessImpl() : fps_(0), play_(false), imageGen_(0) {}
ProcessImpl::~ProcessImpl() {}
ProcessImpl::ProcessImpl()
: fps_(0), play_(false), imageGen_(0)
{ }
DummyPlayer::Process

View file

@ -67,7 +67,8 @@ namespace proc {
* ProcessImpl instance and have to manage the lifecycle manually.
*/
class ProcessImpl
: public lumiera_playprocess
: public lumiera_playprocess,
boost::noncopyable
{
uint fps_;
bool play_;
@ -77,7 +78,6 @@ namespace proc {
public:
ProcessImpl() ;
~ProcessImpl();
/* Implementation-level API to be used By DummyPlayerService */