Line 1... |
Line 1... |
// $Id: Rw11UnitVirt.ipp 504 2013-04-13 15:37:24Z mueller $
|
// $Id: Rw11UnitVirt.ipp 515 2013-05-04 17:28:59Z mueller $
|
//
|
//
|
// Copyright 2013- by Walter F.J. Mueller
|
// Copyright 2013- by Walter F.J. Mueller
|
//
|
//
|
// This program is free software; you may redistribute and/or modify it under
|
// This program is free software; you may redistribute and/or modify it under
|
// the terms of the GNU General Public License as published by the Free
|
// the terms of the GNU General Public License as published by the Free
|
Line 11... |
Line 11... |
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for complete details.
|
// for complete details.
|
//
|
//
|
// Revision History:
|
// Revision History:
|
// Date Rev Version Comment
|
// Date Rev Version Comment
|
|
// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
|
// 2013-03-03 494 1.0 Initial version
|
// 2013-03-03 494 1.0 Initial version
|
// 2013-02-05 483 0.1 First draft
|
// 2013-02-05 483 0.1 First draft
|
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
|
|
/*!
|
/*!
|
\file
|
\file
|
\version $Id: Rw11UnitVirt.ipp 504 2013-04-13 15:37:24Z mueller $
|
\version $Id: Rw11UnitVirt.ipp 515 2013-05-04 17:28:59Z mueller $
|
\brief Implemenation (inline) of Rw11UnitVirt.
|
\brief Implemenation (inline) of Rw11UnitVirt.
|
*/
|
*/
|
|
|
#include "boost/thread/locks.hpp"
|
#include "boost/thread/locks.hpp"
|
|
|
Line 68... |
Line 69... |
template
|
template
|
inline bool Rw11UnitVirt::Attach(const std::string& url, RerrMsg& emsg)
|
inline bool Rw11UnitVirt::Attach(const std::string& url, RerrMsg& emsg)
|
{
|
{
|
// synchronize with server thread
|
// synchronize with server thread
|
boost::lock_guard lock(Connect());
|
boost::lock_guard lock(Connect());
|
if (fpVirt) DetachCleanup();
|
if (fpVirt) Detach();
|
fpVirt.reset(TV::New(url, this, emsg));
|
fpVirt.reset(TV::New(url, this, emsg));
|
if (fpVirt) AttachSetup();
|
if (fpVirt) AttachDone();
|
return fpVirt;
|
return fpVirt;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
Line 82... |
Line 83... |
template
|
template
|
inline void Rw11UnitVirt::Detach()
|
inline void Rw11UnitVirt::Detach()
|
{
|
{
|
// synchronize with server thread
|
// synchronize with server thread
|
boost::lock_guard lock(Connect());
|
boost::lock_guard lock(Connect());
|
if (fpVirt) DetachCleanup();
|
if (!fpVirt) return;
|
|
DetachCleanup();
|
fpVirt.reset();
|
fpVirt.reset();
|
|
DetachDone();
|
return;
|
return;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|