VPTissue Reference Manual
SimShell::Ws::Project< FileType, index_file > Class Template Reference

Abstraction of project in workspace on file system. More...

#include <Project.h>

Inheritance diagram for SimShell::Ws::Project< FileType, index_file >:
Inheritance graph
Collaboration diagram for SimShell::Ws::Project< FileType, index_file >:
Collaboration graph

Public Member Functions

 Project (const std::string &path, const std::string &prefs_file, const std::shared_ptr< IWorkspace > &w)
 Constructor. More...
 
 Project (Project< FileType, index_file > &&)
 Move constructor.
 
virtual ~Project ()
 Virtual destructor.
 
virtual FileIterator Add (const std::string &name)
 
virtual std::shared_ptr< IFileBack ()
 
virtual std::shared_ptr< const IFileBack () const
 
virtual FileIterator begin ()
 
virtual ConstFileIterator begin () const
 
virtual void Close ()
 
virtual FileIterator end ()
 
virtual ConstFileIterator end () const
 
virtual FileIterator Find (const std::string &name)
 
virtual ConstFileIterator Find (const std::string &name) const
 
virtual std::shared_ptr< IFileFront ()
 
virtual std::shared_ptr< const IFileFront () const
 
virtual std::shared_ptr< IFileGet (const std::string &name)
 
virtual std::shared_ptr< const IFileGet (const std::string &name) const
 
virtual const std::string & GetIndexFile () const
 
virtual const std::string & GetPath () const
 
virtual std::shared_ptr< Session::ISessionGetSession () const
 
virtual std::string GetSessionFileName () const
 
virtual const boost::property_tree::ptree & GetUserData (const std::string &user) const
 
virtual bool IsLeaf (const std::string &name) const
 
virtual bool IsOpened () const
 
virtual bool IsWatchingDirectory () const
 
virtual void Open ()
 
virtual void Open (const std::string &name)
 
virtual void Open (FileIterator)
 
virtual void Refresh ()
 
virtual void Remove (const std::string &name)
 
virtual void Remove (FileIterator)
 
virtual Session::ISessionSession () const
 
virtual void SetUserData (const std::string &user, const boost::property_tree::ptree &)
 
virtual void SetWatchingDirectory (bool)
 
- Public Member Functions inherited from SimShell::Ws::IProject
virtual ~IProject ()
 Virtual destructor.
 
virtual std::vector< QAction * > GetContextMenuActions () const =0
 Get Qt actions that can be triggered on this project.
 
virtual std::vector< WidgetCallbackGetWidgets ()=0
 Get map of widget creator callbacks.
 
- Public Member Functions inherited from SimPT_Sim::Util::Subject< Event::PreferencesChanged, std::weak_ptr< const void > >
void Notify (const EventType &)
 
void Register (const U *, CallbackType)
 
void Unregister (const U *)
 
void UnregisterAll ()
 
- Public Member Functions inherited from SimPT_Sim::Util::Subject< Event::ProjectChanged, std::weak_ptr< const void > >
void Notify (const EventType &)
 
void Register (const U *, CallbackType)
 
void Unregister (const U *)
 
void UnregisterAll ()
 
- Public Member Functions inherited from SimShell::Ws::Preferences
 Preferences (const std::string &file)
 
 Preferences (Preferences &&)
 
virtual const boost::property_tree::ptree & GetPreferences () const
 
virtual void SetPreferences (const boost::property_tree::ptree &)
 

Protected Attributes

FileMap m_files
 Mapping from file name to file objects.
 
Util::FileSystemWatcher m_filesystem_watcher
 Watches project directory for changes.
 
std::string m_path
 Path of project directory.
 
std::shared_ptr< Session::ISessionm_session
 Opened state.
 
std::string m_session_name
 Name of opened file.
 
boost::property_tree::ptree m_user_data
 User data. Mutable because a GetUserData() with non-existing argument will create an empty user data ptree for that argument.
 
std::shared_ptr< IWorkspacem_workspace
 Workspace to which project belongs.
 
- Protected Attributes inherited from SimShell::Ws::Preferences
boost::property_tree::ptree m_preferences
 

Additional Inherited Members

- Public Types inherited from SimShell::Ws::IProject
using ConstFileIterator = typename FileMap::const_iterator
 
using ConstructorType = std::function< std::shared_ptr< IProject >(const std::string &, const std::string &, const std::string &, const std::shared_ptr< IWorkspace > &)>
 First argument : type of project to create. More...
 
using FileIterator = typename FileMap::iterator
 
using FileMap = std::map< std::string, std::shared_ptr< IFile >>
 
- Public Types inherited from SimPT_Sim::Util::Subject< Event::PreferencesChanged, std::weak_ptr< const void > >
typedef std::function< void(const EventType &)> CallbackType
 
typedef Event::PreferencesChanged EventType
 
typedef const std::weak_ptr< const void > * KeyType
 
- Public Types inherited from SimPT_Sim::Util::Subject< Event::ProjectChanged, std::weak_ptr< const void > >
typedef std::function< void(const EventType &)> CallbackType
 
typedef Event::ProjectChanged EventType
 
typedef const std::weak_ptr< const void > * KeyType
 

Detailed Description

template<class FileType, const std::string & index_file>
class SimShell::Ws::Project< FileType, index_file >

Abstraction of project in workspace on file system.

Template parameters:

  • FileType: Any class that has a public static data member named 'Constructor' of (function) type IFile::ConstructorType in it. The 'Constructor' function should return any IFile implementation based on the file name and path. (Typically the extension is used to determine the type actually constructed)
  • index_file: String containing the filename of the project index file. Possibly a hidden file to discourage manual editing. The project index file only contains the project user data (see IUserData), but may contain the list of project files in the future.

Definition at line 45 of file cpp_simshell/workspace/Project.h.

Constructor & Destructor Documentation

template<class FileType, const std::string & index_file>
SimShell::Ws::Project< FileType, index_file >::Project ( const std::string &  path,
const std::string &  prefs_file,
const std::shared_ptr< IWorkspace > &  w 
)

Constructor.

Parameters
pathPath to project.

Member Function Documentation

template<class FileType , const std::string & index_file>
IProject::FileIterator SimShell::Ws::Project< FileType, index_file >::Add ( const std::string &  name)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 82 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< IFile > SimShell::Ws::Project< FileType, index_file >::Back ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 97 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< const IFile > SimShell::Ws::Project< FileType, index_file >::Back ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 103 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::FileIterator SimShell::Ws::Project< FileType, index_file >::begin ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 110 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::ConstFileIterator SimShell::Ws::Project< FileType, index_file >::begin ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 117 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Close ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 124 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::FileIterator SimShell::Ws::Project< FileType, index_file >::end ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 134 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::ConstFileIterator SimShell::Ws::Project< FileType, index_file >::end ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 141 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::FileIterator SimShell::Ws::Project< FileType, index_file >::Find ( const std::string &  name)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 148 of file Project_def.h.

template<class FileType , const std::string & index_file>
IProject::ConstFileIterator SimShell::Ws::Project< FileType, index_file >::Find ( const std::string &  name) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 155 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< IFile > SimShell::Ws::Project< FileType, index_file >::Front ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 166 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< const IFile > SimShell::Ws::Project< FileType, index_file >::Front ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 172 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< IFile > SimShell::Ws::Project< FileType, index_file >::Get ( const std::string &  name)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 178 of file Project_def.h.

template<class FileType , const std::string & index_file>
shared_ptr< const IFile > SimShell::Ws::Project< FileType, index_file >::Get ( const std::string &  name) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 190 of file Project_def.h.

template<class FileType , const std::string & index_file>
const string & SimShell::Ws::Project< FileType, index_file >::GetIndexFile ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 202 of file Project_def.h.

template<class FileType , const std::string & index_file>
const string & SimShell::Ws::Project< FileType, index_file >::GetPath ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 208 of file Project_def.h.

Referenced by SimPT_Shell::ConverterWindow::ConverterWindow().

Here is the caller graph for this function:

template<class FileType , const std::string & index_file>
std::shared_ptr< Session::ISession > SimShell::Ws::Project< FileType, index_file >::GetSession ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 214 of file Project_def.h.

template<class FileType , const std::string & index_file>
string SimShell::Ws::Project< FileType, index_file >::GetSessionFileName ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 222 of file Project_def.h.

template<class FileType , const std::string & index_file>
const ptree & SimShell::Ws::Project< FileType, index_file >::GetUserData ( const std::string &  user) const
virtual
See also
IUserData

Implements SimShell::Ws::IUserData.

Definition at line 228 of file Project_def.h.

template<class FileType , const std::string & index_file>
bool SimShell::Ws::Project< FileType, index_file >::IsLeaf ( const std::string &  name) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 240 of file Project_def.h.

template<class FileType , const std::string & index_file>
bool SimShell::Ws::Project< FileType, index_file >::IsOpened ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 246 of file Project_def.h.

template<class FileType , const std::string & index_file>
bool SimShell::Ws::Project< FileType, index_file >::IsWatchingDirectory ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 252 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Open ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 258 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Open ( const std::string &  name)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 264 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Open ( FileIterator  it)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 270 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Refresh ( )
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Reimplemented in SimPT_Shell::Ws::Project.

Definition at line 279 of file Project_def.h.

Referenced by SimPT_Shell::Ws::Project::Refresh().

Here is the caller graph for this function:

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Remove ( const std::string &  name)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 323 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::Remove ( IProject< FileType, index_file >::FileIterator  it)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 335 of file Project_def.h.

template<class FileType , const std::string & index_file>
Session::ISession & SimShell::Ws::Project< FileType, index_file >::Session ( ) const
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 346 of file Project_def.h.

template<class FileType, const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::SetUserData ( const std::string &  user,
const boost::property_tree::ptree &   
)
virtual
See also
IUserData

Implements SimShell::Ws::IUserData.

Definition at line 361 of file Project_def.h.

template<class FileType , const std::string & index_file>
void SimShell::Ws::Project< FileType, index_file >::SetWatchingDirectory ( bool  a)
virtual
See also
IProject

Implements SimShell::Ws::IProject.

Definition at line 355 of file Project_def.h.


The documentation for this class was generated from the following files: