2009-10-14 05:48:24 +02:00
|
|
|
/*
|
|
|
|
|
SCOPE-PATH.hpp - logical access path down from Session root
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, 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 MOBJECT_SESSION_SCOPE_PATH_H
|
|
|
|
|
#define MOBJECT_SESSION_SCOPE_PATH_H
|
|
|
|
|
|
|
|
|
|
//#include "proc/mobject/mobject.hpp"
|
2009-10-18 19:08:21 +02:00
|
|
|
//#include "proc/mobject/placement-ref.hpp"
|
|
|
|
|
#include "proc/mobject/session/scope.hpp"
|
2009-11-21 04:48:29 +01:00
|
|
|
#include "lib/iter-adapter.hpp"
|
2009-10-14 05:48:24 +02:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
//#include <string>
|
|
|
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
|
//using std::string;
|
|
|
|
|
|
|
|
|
|
namespace mobject {
|
|
|
|
|
namespace session {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TODO type comment
|
|
|
|
|
*/
|
|
|
|
|
class ScopePath
|
|
|
|
|
{
|
2009-10-18 01:30:43 +02:00
|
|
|
vector<Scope> path_;
|
2009-10-14 05:48:24 +02:00
|
|
|
|
2009-11-21 04:48:29 +01:00
|
|
|
typedef vector<Scope> _VType;
|
|
|
|
|
typedef _VType::const_reverse_iterator _VIter;
|
|
|
|
|
typedef lib::RangeIter<_VIter> _IterType;
|
|
|
|
|
|
2009-10-14 05:48:24 +02:00
|
|
|
public:
|
|
|
|
|
ScopePath();
|
|
|
|
|
|
2009-11-21 04:48:29 +01:00
|
|
|
/// Iteration is always ascending from leaf to root
|
|
|
|
|
typedef _IterType iterator;
|
|
|
|
|
iterator begin() const;
|
|
|
|
|
iterator end() const;
|
2009-10-29 04:32:00 +01:00
|
|
|
|
|
|
|
|
Scope getLeaf() const;
|
|
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
2009-10-14 05:48:24 +02:00
|
|
|
};
|
|
|
|
|
///////////////////////////TODO currently just fleshing the API
|
|
|
|
|
|
|
|
|
|
|
2009-11-21 04:48:29 +01:00
|
|
|
inline ScopePath::iterator
|
|
|
|
|
ScopePath::begin() const
|
|
|
|
|
{
|
|
|
|
|
return iterator (path_.rbegin(), path_.rend());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline ScopePath::iterator
|
|
|
|
|
ScopePath::end() const
|
|
|
|
|
{
|
|
|
|
|
return iterator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 05:48:24 +02:00
|
|
|
}} // namespace mobject::session
|
|
|
|
|
#endif
|