VPTissue Reference Manual
|
Interface for project-like behavior. More...
#include <IProject.h>
Classes | |
struct | WidgetCallback |
Public Types | |
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 |
Public Member Functions | |
virtual | ~IProject () |
Virtual destructor. | |
virtual FileIterator | Add (const std::string &name)=0 |
Add existing file to project. More... | |
virtual std::shared_ptr< IFile > | Back ()=0 |
Get last file. More... | |
virtual std::shared_ptr< const IFile > | Back () const =0 |
Get last file. More... | |
virtual FileIterator | begin ()=0 |
Get iterator pointing to first file. | |
virtual ConstFileIterator | begin () const =0 |
Get iterator pointing to first file. | |
virtual void | Close ()=0 |
Close project. More... | |
virtual FileIterator | end ()=0 |
Get iterator pointing to one position after last file. | |
virtual ConstFileIterator | end () const =0 |
Get iterator pointing to one position after file. | |
virtual FileIterator | Find (const std::string &name)=0 |
Get iterator pointing to file with given name. More... | |
virtual ConstFileIterator | Find (const std::string &name) const =0 |
Get iterator pointing to file with given name. More... | |
virtual std::shared_ptr< IFile > | Front ()=0 |
Get first file. More... | |
virtual std::shared_ptr< const IFile > | Front () const =0 |
Get first file. More... | |
virtual std::shared_ptr< IFile > | Get (const std::string &name)=0 |
Get file with given name. More... | |
virtual std::shared_ptr< const IFile > | Get (const std::string &name) const =0 |
Get file with given name. More... | |
virtual std::vector< QAction * > | GetContextMenuActions () const =0 |
Get Qt actions that can be triggered on this project. | |
virtual const std::string & | GetIndexFile () const =0 |
Get name of index file for this type of project. | |
virtual const std::string & | GetPath () const =0 |
Get path project was initialized with. | |
virtual std::shared_ptr< Session::ISession > | GetSession () const =0 |
Get session pointer. THIS IS A TEMPORARY HACK. | |
virtual std::string | GetSessionFileName () const =0 |
Get name of file used to initiate session. More... | |
virtual std::vector< WidgetCallback > | GetWidgets ()=0 |
Get map of widget creator callbacks. | |
virtual bool | IsLeaf (const std::string &name) const =0 |
Test whether file with given name exists in project. More... | |
virtual bool | IsOpened () const =0 |
Test whether project is in 'opened' state. More... | |
virtual bool | IsWatchingDirectory () const =0 |
Test whether project is currently watching its directory for changes. More... | |
virtual void | Open ()=0 |
Open most recent file in project. | |
virtual void | Open (const std::string &name)=0 |
Open given file in project. More... | |
virtual void | Open (FileIterator it)=0 |
Open given file in project. More... | |
virtual void | Refresh ()=0 |
Refresh project. | |
virtual void | Remove (const std::string &name)=0 |
Remove file with given name. More... | |
virtual void | Remove (FileIterator it)=0 |
Remove file pointed to by iterator. More... | |
virtual Session::ISession & | Session () const =0 |
Get session of opened project. More... | |
virtual void | SetWatchingDirectory (bool)=0 |
Set whether project must watch its directory for changes. More... | |
Public Member Functions inherited from SimShell::Ws::IPreferences | |
virtual const boost::property_tree::ptree & | GetPreferences () const =0 |
virtual void | SetPreferences (const boost::property_tree::ptree &)=0 |
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 SimShell::Ws::IUserData | |
virtual const boost::property_tree::ptree & | GetUserData (const std::string &user) const =0 |
virtual void | SetUserData (const std::string &user, const boost::property_tree::ptree &)=0 |
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 () |
Interface for project-like behavior.
A project is a container of files, indexed by name. Files can be added/removed.
Additionally, a project can be in "closed" or "opened" state. If a project resides in "opened" state, it keeps a session internally.
A project has associated with it a tree of preferences and a tree of user data.
Definition at line 59 of file IProject.h.
using SimShell::Ws::IProject::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.
Second argument : path of project. Third argument : preferences file name. Fourth argument : pointer to workspace to which project belongs.
Definition at line 71 of file IProject.h.
|
pure virtual |
Add existing file to project.
Exception | if no such file. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get last file.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get last file.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Close project.
This only has effect if we are in 'opened' state.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get iterator pointing to file with given name.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get iterator pointing to file with given name.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get first file.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get first file.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get file with given name.
Exception | if no such file. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get file with given name.
Exception | if no such file. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get name of file used to initiate session.
If project is not opened, will return empty string.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Test whether file with given name exists in project.
name | Name of file to test existence. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Test whether project is in 'opened' state.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Test whether project is currently watching its directory for changes.
Default is true.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Open given file in project.
name | File to open. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Open given file in project.
it | Iterator pointing to file to open. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Remove file with given name.
name | Name of file to remove. |
Exception | if no such file. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Remove file pointed to by iterator.
it | Iterator pointing to file to remove. |
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Get session of opened project.
If project is not opened, will throw exception.
Implemented in SimShell::Ws::Project< FileType, index_file >.
|
pure virtual |
Set whether project must watch its directory for changes.
Default is true.
Implemented in SimShell::Ws::Project< FileType, index_file >.