1 #ifndef WS_WORKSPACE_H_INCLUDED
2 #define WS_WORKSPACE_H_INCLUDED
45 template <
class ProjectType, const std::
string& index_file>
53 const std::string& prefs_file);
62 virtual ProjectIterator
begin();
65 virtual ConstProjectIterator
begin()
const;
68 virtual ProjectIterator
end();
71 virtual ConstProjectIterator
end()
const;
74 virtual ProjectIterator
Add(
const std::string& type,
const std::string& name);
77 virtual std::shared_ptr<IProject>
Back();
80 virtual std::shared_ptr<const IProject>
Back()
const;
83 virtual ProjectIterator
Find(
const std::string& name);
86 virtual ConstProjectIterator
Find(
const std::string& name)
const;
89 virtual bool IsProject(
const std::string& name)
const;
92 virtual std::shared_ptr<IProject>
Front();
95 virtual std::shared_ptr<const IProject>
Front()
const;
98 virtual std::shared_ptr<IProject>
Get(
const std::string& name);
101 virtual std::shared_ptr<const IProject>
Get(
const std::string& name)
const;
107 virtual const std::string&
GetPath()
const;
110 virtual const boost::property_tree::ptree&
GetUserData(
const std::string& user)
const;
113 virtual ProjectIterator
New(
const std::string& type,
const std::string& name);
119 virtual ProjectIterator
Rename(ProjectIterator,
const std::string& new_name);
122 virtual ProjectIterator
Rename(
const std::string& old_name,
const std::string& new_name);
125 virtual void Remove(ProjectIterator);
128 virtual void Remove(
const std::string& name);
131 virtual void SetUserData(
const std::string& user,
const boost::property_tree::ptree&);
155 #endif // end_of_inclde_guard
virtual ProjectIterator begin()
Utility class for being informed about changes to a file/directory on the filesystem.
Implementation of IPreferences.
virtual bool IsProject(const std::string &name) const
ProjectMap m_projects
Mapping from project name to project.
Interface for Preferences.
virtual std::shared_ptr< IProject > Get(const std::string &name)
Workspace(const std::string &path, const std::string &prefs_file)
Constructor.
std::string m_path
Path workspace was initialized with.
virtual ProjectIterator Rename(ProjectIterator, const std::string &new_name)
Util::FileSystemWatcher m_filesystem_watcher
Watch workspace index file for changes.
boost::property_tree::ptree m_user_data
GetUserData() with non-existing argument creates an empty user data.
Interface for workspace-like behavior.
std::string m_prefs_file
Name of preferences file.
virtual std::shared_ptr< IProject > Back()
virtual const boost::property_tree::ptree & GetUserData(const std::string &user) const
Interface for IWorkspace.
virtual void Remove(ProjectIterator)
virtual void SetUserData(const std::string &user, const boost::property_tree::ptree &)
virtual ProjectIterator Add(const std::string &type, const std::string &name)
Abstraction of workspace on file system.
virtual const std::string & GetPath() const
virtual std::shared_ptr< IProject > Front()
virtual ProjectIterator end()
virtual const std::string & GetIndexFile() const
virtual ~Workspace()
Virtual destructor.
virtual ProjectIterator Find(const std::string &name)
Namespace for generic graphical shell for simulators.
Definition for FileSystemWatcher.
virtual ProjectIterator New(const std::string &type, const std::string &name)