detect if the session is up and opened, lock PlacementRef else
This commit is contained in:
parent
6c187224eb
commit
e89b4503fd
7 changed files with 26 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -91,6 +91,13 @@ namespace session {
|
|||
{ }
|
||||
|
||||
|
||||
|
||||
bool
|
||||
SessManagerImpl::isUp ()
|
||||
{
|
||||
return bool(pImpl_);
|
||||
}
|
||||
|
||||
/** @note no transactional behaviour.
|
||||
* may succeed partial.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ namespace session {
|
|||
virtual void load () ;
|
||||
virtual void save () ;
|
||||
|
||||
virtual bool isUp () ;
|
||||
|
||||
|
||||
public:
|
||||
/* ==== proc layer internal API ==== */
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ namespace session {
|
|||
public:
|
||||
static PlacementMO& resolveID (PlacementMO::ID const&) ;
|
||||
static bool isRegisteredID (PlacementMO::ID const&) ;
|
||||
|
||||
static bool isAccessible() ;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue