detect if the session is up and opened, lock PlacementRef else

This commit is contained in:
Fischlurch 2009-12-13 04:27:57 +01:00
parent 6c187224eb
commit e89b4503fd
7 changed files with 26 additions and 2 deletions

View file

@ -204,7 +204,8 @@ namespace mobject {
bool
checkValidity () const
{
return session::SessionServiceFetch::isRegisteredID (this->id_);
return session::SessionServiceFetch::isAccessible() // session interface opened?
&& session::SessionServiceFetch::isRegisteredID (this->id_);
}
static void

View file

@ -127,6 +127,9 @@ namespace mobject {
class SessManager : private boost::noncopyable
{
public:
/** diagnostics: session interface opened? */
virtual bool isUp () =0;
/** clear current session contents
* without resetting overall session config.
* Afterwards, the session will contain only one

View file

@ -119,7 +119,7 @@ namespace session {
/** constant \em invalid path token. Created by locating an invalid scope */
const ScopePath ScopePath::INVALID = ScopePath(Scope());
const ScopePath ScopePath::INVALID = ScopePath(Scope()); ///////////////////////TODO can this initialisation be deferred? it causes creation of an default session very early
/** a \em valid path consists of more than just the root element.

View file

@ -91,6 +91,13 @@ namespace session {
{ }
bool
SessManagerImpl::isUp ()
{
return bool(pImpl_);
}
/** @note no transactional behaviour.
* may succeed partial.
*/

View file

@ -51,6 +51,8 @@ namespace session {
virtual void load () ;
virtual void save () ;
virtual bool isUp () ;
public:
/* ==== proc layer internal API ==== */

View file

@ -63,6 +63,8 @@ namespace session {
public:
static PlacementMO& resolveID (PlacementMO::ID const&) ;
static bool isRegisteredID (PlacementMO::ID const&) ;
static bool isAccessible() ;
};

View file

@ -33,6 +33,15 @@
namespace mobject {
namespace session {
/** is the element-fetch service usable?
* Effectively this means: is the session up?
*/
bool
SessionServiceFetch::isAccessible ()
{
return Session::current.isUp();
}
/** verify the given placement-ID (hash) is valid,
* by checking if it refers to a Placement instance
* currently registered with the PlacementIndex of the